Skip to content

Commit ae50bdc

Browse files
committed
Add Grid 3 gridset processor modules
Introduces support for Grid 3 gridset processing, including command definitions and detection, plugin cell type detection, symbol extraction and search, style helpers, and image resolution. Updates resolver and styleHelpers to support symbol library references and cell shapes. Adds new modules for commands, pluginTypes, symbolExtractor, symbolSearch, and symbols, and updates gridsetProcessor and index to export enhanced functionality.
1 parent 8633ef3 commit ae50bdc

11 files changed

Lines changed: 3088 additions & 3 deletions

File tree

src/processors/gridset/commands.ts

Lines changed: 1013 additions & 0 deletions
Large diffs are not rendered by default.

src/processors/gridset/index.ts

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
/**
2+
* Grid 3 Enhanced Support Module
3+
*
4+
* This module exports all enhanced Grid 3 functionality including:
5+
* - Cell shape detection and support
6+
* - Plugin cell type detection (Workspace, LiveCell, AutoContent)
7+
* - Comprehensive command definitions and detection
8+
* - Color utilities and style helpers
9+
* - Image resolution helpers
10+
*/
11+
12+
// Style helpers
13+
export {
14+
CellBackgroundShape,
15+
SHAPE_NAMES,
16+
type Grid3Style,
17+
DEFAULT_GRID3_STYLES,
18+
CATEGORY_STYLES,
19+
createDefaultStylesXml,
20+
createCategoryStyle,
21+
} from './styleHelpers';
22+
23+
// Plugin cell type detection
24+
export {
25+
detectPluginCellType,
26+
type Grid3PluginMetadata,
27+
Grid3CellType,
28+
WORKSPACE_TYPES,
29+
LIVECELL_TYPES,
30+
AUTOCONTENT_TYPES,
31+
getCellTypeDisplayName,
32+
isWorkspaceCell,
33+
isLiveCell,
34+
isAutoContentCell,
35+
isRegularCell,
36+
} from './pluginTypes';
37+
38+
// Command definitions and detection
39+
export {
40+
detectCommand,
41+
getCommandDefinition,
42+
getCommandsByPlugin,
43+
getCommandsByCategory,
44+
getAllCommandIds,
45+
getAllPluginIds,
46+
extractCommandParameters,
47+
GRID3_COMMANDS,
48+
type Grid3CommandDefinition,
49+
type CommandParameter,
50+
type ExtractedParameters,
51+
Grid3CommandCategory,
52+
} from './commands';
53+
54+
// Import for local use in constant definitions
55+
import { getAllCommandIds, getAllPluginIds } from './commands';
56+
import { CellBackgroundShape } from './styleHelpers';
57+
import { Grid3CellType } from './pluginTypes';
58+
import { Grid3CommandCategory } from './commands';
59+
60+
// Color utilities
61+
export { ensureAlphaChannel, darkenColor, lightenColor, hexToRgba, rgbaToHex } from './colorUtils';
62+
63+
// Password handling
64+
export {
65+
resolveGridsetPassword,
66+
getZipEntriesWithPassword,
67+
resolveGridsetPasswordFromEnv,
68+
} from './password';
69+
70+
// Helper functions
71+
export {
72+
getPageTokenImageMap,
73+
getAllowedImageEntries,
74+
openImage,
75+
generateGrid3Guid,
76+
createSettingsXml,
77+
createFileMapXml,
78+
getCommonDocumentsPath,
79+
findGrid3UserPaths,
80+
findGrid3HistoryDatabases,
81+
findGrid3Vocabularies,
82+
findGrid3UserHistory,
83+
findGrid3Users,
84+
isGrid3Installed,
85+
readGrid3History,
86+
readGrid3HistoryForUser,
87+
readAllGrid3History,
88+
type Grid3UserPath,
89+
type Grid3VocabularyPath,
90+
type Grid3HistoryEntry,
91+
} from './helpers';
92+
93+
// Symbol library handling
94+
export {
95+
parseSymbolReference,
96+
isSymbolReference,
97+
resolveSymbolReference,
98+
getAvailableSymbolLibraries,
99+
getSymbolLibraryInfo,
100+
extractSymbolReferences,
101+
analyzeSymbolUsage,
102+
createSymbolReference,
103+
getSymbolLibraryName,
104+
getSymbolPath,
105+
isKnownSymbolLibrary,
106+
getSymbolLibraryDisplayName,
107+
getDefaultGrid3Path,
108+
getSymbolLibrariesDir,
109+
getSymbolSearchIndexesDir,
110+
symbolReferenceToFilename,
111+
SYMBOL_LIBRARIES,
112+
type SymbolReference,
113+
type SymbolLibraryInfo,
114+
type SymbolResolutionOptions,
115+
type SymbolResolutionResult,
116+
type SymbolUsageStats,
117+
type SymbolLibraryName,
118+
} from './symbols';
119+
120+
// Backward compatibility aliases for old function names
121+
export { getSymbolsDir, getSymbolSearchDir } from './symbols';
122+
123+
// Image resolution
124+
export {
125+
resolveGrid3CellImage,
126+
isSymbolLibraryReference,
127+
parseImageSymbolReference,
128+
} from './resolver';
129+
130+
// Symbol extraction and conversion
131+
export {
132+
extractButtonImage,
133+
extractSymbolLibraryImage,
134+
convertToAstericsImage,
135+
analyzeSymbolExtraction,
136+
suggestExtractionStrategy,
137+
exportSymbolReferencesToCsv,
138+
createSymbolManifest,
139+
type ExtractedImage,
140+
type SymbolExtractionOptions,
141+
type SymbolReport,
142+
type SymbolManifest,
143+
} from './symbolExtractor';
144+
145+
// Symbol search functionality
146+
export {
147+
parsePixFile,
148+
loadSearchIndexes,
149+
searchSymbols,
150+
searchSymbolsWithReferences,
151+
getSymbolFilename,
152+
getSymbolDisplayName,
153+
getAllSearchTerms,
154+
getSearchSuggestions,
155+
countLibrarySymbols,
156+
getSymbolSearchStats,
157+
type SymbolSearchResult,
158+
type SymbolSearchOptions,
159+
type LibrarySearchIndex,
160+
type SymbolSearchStats,
161+
} from './symbolSearch';
162+
163+
/**
164+
* Get all Grid 3 command IDs as a readonly array
165+
* Useful for validation and autocomplete
166+
*/
167+
export const GRID3_COMMAND_IDS = Object.freeze(getAllCommandIds());
168+
169+
/**
170+
* Get all Grid 3 plugin IDs as a readonly array
171+
*/
172+
export const GRID3_PLUGIN_IDS = Object.freeze(getAllPluginIds());
173+
174+
/**
175+
* Grid 3 cell shapes enum values
176+
*/
177+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
178+
export const GRID3_CELL_SHAPES = Object.freeze(Object.values(CellBackgroundShape));
179+
180+
/**
181+
* Grid 3 cell types enum values
182+
*/
183+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
184+
export const GRID3_CELL_TYPES = Object.freeze(Object.values(Grid3CellType));
185+
186+
/**
187+
* Grid 3 command categories enum values
188+
*/
189+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
190+
export const GRID3_COMMAND_CATEGORIES = Object.freeze(Object.values(Grid3CommandCategory));

0 commit comments

Comments
 (0)