@smartnet360/svelte-components 0.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/Desktop/Desktop.svelte +423 -0
  2. package/dist/Desktop/Desktop.svelte.d.ts +26 -0
  3. package/dist/Desktop/Grid/Half.svelte +50 -0
  4. package/dist/Desktop/Grid/Half.svelte.d.ts +29 -0
  5. package/dist/Desktop/Grid/Quarter.svelte +103 -0
  6. package/dist/Desktop/Grid/Quarter.svelte.d.ts +27 -0
  7. package/dist/Desktop/Grid/README.md +331 -0
  8. package/dist/Desktop/Grid/ResizeHandle.svelte +118 -0
  9. package/dist/Desktop/Grid/ResizeHandle.svelte.d.ts +23 -0
  10. package/dist/Desktop/Grid/index.d.ts +4 -0
  11. package/dist/Desktop/Grid/index.js +4 -0
  12. package/dist/Desktop/Grid/resizeStore.d.ts +16 -0
  13. package/dist/Desktop/Grid/resizeStore.js +39 -0
  14. package/dist/Desktop/GridRenderer.svelte +328 -0
  15. package/dist/Desktop/GridRenderer.svelte.d.ts +25 -0
  16. package/dist/Desktop/GridSelector/ComponentPalette.svelte +243 -0
  17. package/dist/Desktop/GridSelector/ComponentPalette.svelte.d.ts +27 -0
  18. package/dist/Desktop/GridSelector/ConfigurationPanel.svelte +242 -0
  19. package/dist/Desktop/GridSelector/ConfigurationPanel.svelte.d.ts +28 -0
  20. package/dist/Desktop/GridSelector/GridSelector.svelte +232 -0
  21. package/dist/Desktop/GridSelector/GridSelector.svelte.d.ts +43 -0
  22. package/dist/Desktop/GridSelector/LayoutPicker.svelte +241 -0
  23. package/dist/Desktop/GridSelector/LayoutPicker.svelte.d.ts +28 -0
  24. package/dist/Desktop/GridSelector/LayoutPreview.svelte +309 -0
  25. package/dist/Desktop/GridSelector/LayoutPreview.svelte.d.ts +32 -0
  26. package/dist/Desktop/GridSelector/index.d.ts +4 -0
  27. package/dist/Desktop/GridSelector/index.js +4 -0
  28. package/dist/Desktop/GridViewer.svelte +125 -0
  29. package/dist/Desktop/GridViewer.svelte.d.ts +21 -0
  30. package/dist/Desktop/README.md +279 -0
  31. package/dist/Desktop/gridLayouts.d.ts +76 -0
  32. package/dist/Desktop/gridLayouts.js +351 -0
  33. package/dist/Desktop/index.d.ts +7 -0
  34. package/dist/Desktop/index.js +7 -0
  35. package/dist/Desktop/launchHelpers.d.ts +25 -0
  36. package/dist/Desktop/launchHelpers.js +77 -0
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +1 -0
  39. package/package.json +65 -0
@@ -0,0 +1,351 @@
1
+ /**
2
+ * Grid Layout Configurations
3
+ *
4
+ * Defines all available grid layout types that can be created using the existing
5
+ * Half and Quarter components. Each layout specifies the component structure,
6
+ * slots for content assignment, and metadata for the Grid Selector.
7
+ */
8
+ /**
9
+ * All available grid layout definitions
10
+ * Based on the existing Half and Quarter components
11
+ */
12
+ export const GRID_LAYOUTS = {
13
+ // Basic Half Layouts
14
+ 'half-horizontal': {
15
+ id: 'half-horizontal',
16
+ name: 'Half Horizontal (1x1)',
17
+ description: 'Two equal horizontal sections (left and right)',
18
+ icon: '⬌',
19
+ category: 'basic',
20
+ slots: [
21
+ {
22
+ id: 'left',
23
+ name: 'Left Section',
24
+ description: 'Left half of the screen',
25
+ position: { x: 0, y: 0, width: 50, height: 100 }
26
+ },
27
+ {
28
+ id: 'right',
29
+ name: 'Right Section',
30
+ description: 'Right half of the screen',
31
+ position: { x: 50, y: 0, width: 50, height: 100 }
32
+ }
33
+ ],
34
+ componentStructure: [
35
+ { type: 'Half', position: 'left' },
36
+ { type: 'Half', position: 'right' }
37
+ ],
38
+ previewSvg: `
39
+ <svg viewBox="0 0 100 60" class="layout-preview">
40
+ <rect x="2" y="2" width="46" height="56" fill="#e3f2fd" stroke="#1976d2" stroke-width="1"/>
41
+ <rect x="52" y="2" width="46" height="56" fill="#f3e5f5" stroke="#7b1fa2" stroke-width="1"/>
42
+ <text x="25" y="33" text-anchor="middle" font-size="8" fill="#1976d2">Left</text>
43
+ <text x="75" y="33" text-anchor="middle" font-size="8" fill="#7b1fa2">Right</text>
44
+ </svg>
45
+ `
46
+ },
47
+ 'half-vertical': {
48
+ id: 'half-vertical',
49
+ name: 'Half Vertical (1x1)',
50
+ description: 'Two equal vertical sections (top and bottom)',
51
+ icon: '⬍',
52
+ category: 'basic',
53
+ slots: [
54
+ {
55
+ id: 'top',
56
+ name: 'Top Section',
57
+ description: 'Top half of the screen',
58
+ position: { x: 0, y: 0, width: 100, height: 50 }
59
+ },
60
+ {
61
+ id: 'bottom',
62
+ name: 'Bottom Section',
63
+ description: 'Bottom half of the screen',
64
+ position: { x: 0, y: 50, width: 100, height: 50 }
65
+ }
66
+ ],
67
+ componentStructure: [
68
+ { type: 'Half', position: 'top' },
69
+ { type: 'Half', position: 'bottom' }
70
+ ],
71
+ previewSvg: `
72
+ <svg viewBox="0 0 100 60" class="layout-preview">
73
+ <rect x="2" y="2" width="96" height="26" fill="#e8f5e8" stroke="#388e3c" stroke-width="1"/>
74
+ <rect x="2" y="32" width="96" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
75
+ <text x="50" y="17" text-anchor="middle" font-size="8" fill="#388e3c">Top</text>
76
+ <text x="50" y="47" text-anchor="middle" font-size="8" fill="#f57c00">Bottom</text>
77
+ </svg>
78
+ `
79
+ },
80
+ // Asymmetric Layouts (Half + Quarters)
81
+ 'left-half-right-quarters': {
82
+ id: 'left-half-right-quarters',
83
+ name: 'Left Half + Right Quarters (1x2)',
84
+ description: 'Left section takes half, right side split into two quarters',
85
+ icon: '⬌⬍',
86
+ category: 'asymmetric',
87
+ slots: [
88
+ {
89
+ id: 'left',
90
+ name: 'Left Section',
91
+ description: 'Full left half',
92
+ position: { x: 0, y: 0, width: 50, height: 100 }
93
+ },
94
+ {
95
+ id: 'top-right',
96
+ name: 'Top Right',
97
+ description: 'Top quarter of right side',
98
+ position: { x: 50, y: 0, width: 50, height: 50 }
99
+ },
100
+ {
101
+ id: 'bottom-right',
102
+ name: 'Bottom Right',
103
+ description: 'Bottom quarter of right side',
104
+ position: { x: 50, y: 50, width: 50, height: 50 }
105
+ }
106
+ ],
107
+ componentStructure: [
108
+ { type: 'Half', position: 'left' },
109
+ { type: 'Quarter', position: 'right' }
110
+ ],
111
+ previewSvg: `
112
+ <svg viewBox="0 0 100 60" class="layout-preview">
113
+ <rect x="2" y="2" width="46" height="56" fill="#e3f2fd" stroke="#1976d2" stroke-width="1"/>
114
+ <rect x="52" y="2" width="46" height="26" fill="#f3e5f5" stroke="#7b1fa2" stroke-width="1"/>
115
+ <rect x="52" y="32" width="46" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
116
+ <text x="25" y="33" text-anchor="middle" font-size="8" fill="#1976d2">Left</text>
117
+ <text x="75" y="17" text-anchor="middle" font-size="6" fill="#7b1fa2">Top Right</text>
118
+ <text x="75" y="47" text-anchor="middle" font-size="6" fill="#f57c00">Bottom Right</text>
119
+ </svg>
120
+ `
121
+ },
122
+ 'right-half-left-quarters': {
123
+ id: 'right-half-left-quarters',
124
+ name: 'Right Half + Left Quarters (2x1)',
125
+ description: 'Right section takes half, left side split into two quarters',
126
+ icon: '⬍⬌',
127
+ category: 'asymmetric',
128
+ slots: [
129
+ {
130
+ id: 'top-left',
131
+ name: 'Top Left',
132
+ description: 'Top quarter of left side',
133
+ position: { x: 0, y: 0, width: 50, height: 50 }
134
+ },
135
+ {
136
+ id: 'bottom-left',
137
+ name: 'Bottom Left',
138
+ description: 'Bottom quarter of left side',
139
+ position: { x: 0, y: 50, width: 50, height: 50 }
140
+ },
141
+ {
142
+ id: 'right',
143
+ name: 'Right Section',
144
+ description: 'Full right half',
145
+ position: { x: 50, y: 0, width: 50, height: 100 }
146
+ }
147
+ ],
148
+ componentStructure: [
149
+ { type: 'Quarter', position: 'left' },
150
+ { type: 'Half', position: 'right' }
151
+ ],
152
+ previewSvg: `
153
+ <svg viewBox="0 0 100 60" class="layout-preview">
154
+ <rect x="2" y="2" width="46" height="26" fill="#e8f5e8" stroke="#388e3c" stroke-width="1"/>
155
+ <rect x="2" y="32" width="46" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
156
+ <rect x="52" y="2" width="46" height="56" fill="#f3e5f5" stroke="#7b1fa2" stroke-width="1"/>
157
+ <text x="25" y="17" text-anchor="middle" font-size="6" fill="#388e3c">Top Left</text>
158
+ <text x="25" y="47" text-anchor="middle" font-size="6" fill="#f57c00">Bottom Left</text>
159
+ <text x="75" y="33" text-anchor="middle" font-size="8" fill="#7b1fa2">Right</text>
160
+ </svg>
161
+ `
162
+ },
163
+ 'top-half-bottom-quarters': {
164
+ id: 'top-half-bottom-quarters',
165
+ name: 'Top Half + Bottom Quarters (1x2)',
166
+ description: 'Top section takes half, bottom split into two quarters',
167
+ icon: '⬌⬍',
168
+ category: 'asymmetric',
169
+ slots: [
170
+ {
171
+ id: 'top',
172
+ name: 'Top Section',
173
+ description: 'Full top half',
174
+ position: { x: 0, y: 0, width: 100, height: 50 }
175
+ },
176
+ {
177
+ id: 'bottom-left',
178
+ name: 'Bottom Left',
179
+ description: 'Left quarter of bottom',
180
+ position: { x: 0, y: 50, width: 50, height: 50 }
181
+ },
182
+ {
183
+ id: 'bottom-right',
184
+ name: 'Bottom Right',
185
+ description: 'Right quarter of bottom',
186
+ position: { x: 50, y: 50, width: 50, height: 50 }
187
+ }
188
+ ],
189
+ componentStructure: [
190
+ { type: 'Half', position: 'top' },
191
+ { type: 'Quarter', position: 'bottom' }
192
+ ],
193
+ previewSvg: `
194
+ <svg viewBox="0 0 100 60" class="layout-preview">
195
+ <rect x="2" y="2" width="96" height="26" fill="#e3f2fd" stroke="#1976d2" stroke-width="1"/>
196
+ <rect x="2" y="32" width="46" height="26" fill="#e8f5e8" stroke="#388e3c" stroke-width="1"/>
197
+ <rect x="52" y="32" width="46" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
198
+ <text x="50" y="17" text-anchor="middle" font-size="8" fill="#1976d2">Top</text>
199
+ <text x="25" y="47" text-anchor="middle" font-size="6" fill="#388e3c">Bottom Left</text>
200
+ <text x="75" y="47" text-anchor="middle" font-size="6" fill="#f57c00">Bottom Right</text>
201
+ </svg>
202
+ `
203
+ },
204
+ 'bottom-half-top-quarters': {
205
+ id: 'bottom-half-top-quarters',
206
+ name: 'Bottom Half + Top Quarters (2x1)',
207
+ description: 'Bottom section takes half, top split into two quarters',
208
+ icon: '⬍⬌',
209
+ category: 'asymmetric',
210
+ slots: [
211
+ {
212
+ id: 'top-left',
213
+ name: 'Top Left',
214
+ description: 'Left quarter of top',
215
+ position: { x: 0, y: 0, width: 50, height: 50 }
216
+ },
217
+ {
218
+ id: 'top-right',
219
+ name: 'Top Right',
220
+ description: 'Right quarter of top',
221
+ position: { x: 50, y: 0, width: 50, height: 50 }
222
+ },
223
+ {
224
+ id: 'bottom',
225
+ name: 'Bottom Section',
226
+ description: 'Full bottom half',
227
+ position: { x: 0, y: 50, width: 100, height: 50 }
228
+ }
229
+ ],
230
+ componentStructure: [
231
+ { type: 'Quarter', position: 'top' },
232
+ { type: 'Half', position: 'bottom' }
233
+ ],
234
+ previewSvg: `
235
+ <svg viewBox="0 0 100 60" class="layout-preview">
236
+ <rect x="2" y="2" width="46" height="26" fill="#e8f5e8" stroke="#388e3c" stroke-width="1"/>
237
+ <rect x="52" y="2" width="46" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
238
+ <rect x="2" y="32" width="96" height="26" fill="#f3e5f5" stroke="#7b1fa2" stroke-width="1"/>
239
+ <text x="25" y="17" text-anchor="middle" font-size="6" fill="#388e3c">Top Left</text>
240
+ <text x="75" y="17" text-anchor="middle" font-size="6" fill="#f57c00">Top Right</text>
241
+ <text x="50" y="47" text-anchor="middle" font-size="8" fill="#7b1fa2">Bottom</text>
242
+ </svg>
243
+ `
244
+ },
245
+ // Full Quarters Layout (2x2)
246
+ 'quarters': {
247
+ id: 'quarters',
248
+ name: 'Four Quarters (2x2)',
249
+ description: 'Four equal quadrants in a 2x2 grid',
250
+ icon: '⬜',
251
+ category: 'symmetric',
252
+ slots: [
253
+ {
254
+ id: 'top-left',
255
+ name: 'Top Left',
256
+ description: 'Top left quadrant',
257
+ position: { x: 0, y: 0, width: 50, height: 50 }
258
+ },
259
+ {
260
+ id: 'top-right',
261
+ name: 'Top Right',
262
+ description: 'Top right quadrant',
263
+ position: { x: 50, y: 0, width: 50, height: 50 }
264
+ },
265
+ {
266
+ id: 'bottom-left',
267
+ name: 'Bottom Left',
268
+ description: 'Bottom left quadrant',
269
+ position: { x: 0, y: 50, width: 50, height: 50 }
270
+ },
271
+ {
272
+ id: 'bottom-right',
273
+ name: 'Bottom Right',
274
+ description: 'Bottom right quadrant',
275
+ position: { x: 50, y: 50, width: 50, height: 50 }
276
+ }
277
+ ],
278
+ componentStructure: [
279
+ { type: 'Quarter', position: 'left' },
280
+ { type: 'Quarter', position: 'right' }
281
+ ],
282
+ previewSvg: `
283
+ <svg viewBox="0 0 100 60" class="layout-preview">
284
+ <rect x="2" y="2" width="46" height="26" fill="#e3f2fd" stroke="#1976d2" stroke-width="1"/>
285
+ <rect x="52" y="2" width="46" height="26" fill="#f3e5f5" stroke="#7b1fa2" stroke-width="1"/>
286
+ <rect x="2" y="32" width="46" height="26" fill="#e8f5e8" stroke="#388e3c" stroke-width="1"/>
287
+ <rect x="52" y="32" width="46" height="26" fill="#fff3e0" stroke="#f57c00" stroke-width="1"/>
288
+ <text x="25" y="17" text-anchor="middle" font-size="6" fill="#1976d2">Top Left</text>
289
+ <text x="75" y="17" text-anchor="middle" font-size="6" fill="#7b1fa2">Top Right</text>
290
+ <text x="25" y="47" text-anchor="middle" font-size="6" fill="#388e3c">Bottom Left</text>
291
+ <text x="75" y="47" text-anchor="middle" font-size="6" fill="#f57c00">Bottom Right</text>
292
+ </svg>
293
+ `
294
+ }
295
+ };
296
+ /**
297
+ * Get layout by ID
298
+ */
299
+ export function getLayoutById(id) {
300
+ return GRID_LAYOUTS[id];
301
+ }
302
+ /**
303
+ * Get all layouts by category
304
+ */
305
+ export function getLayoutsByCategory(category) {
306
+ return Object.values(GRID_LAYOUTS).filter(layout => layout.category === category);
307
+ }
308
+ /**
309
+ * Get all available layouts
310
+ */
311
+ export function getAllLayouts() {
312
+ return Object.values(GRID_LAYOUTS);
313
+ }
314
+ /**
315
+ * Get layouts ordered by complexity (basic -> asymmetric -> symmetric)
316
+ */
317
+ export function getLayoutsOrdered() {
318
+ const basic = getLayoutsByCategory('basic');
319
+ const asymmetric = getLayoutsByCategory('asymmetric');
320
+ const symmetric = getLayoutsByCategory('symmetric');
321
+ return [...basic, ...asymmetric, ...symmetric];
322
+ }
323
+ /**
324
+ * Validate if a component assignment is complete
325
+ */
326
+ export function validateComponentAssignments(layoutId, assignments) {
327
+ const layout = getLayoutById(layoutId);
328
+ if (!layout) {
329
+ return { isValid: false, missingSlots: [] };
330
+ }
331
+ const assignedSlots = assignments.map(a => a.slotId);
332
+ const requiredSlots = layout.slots.map(s => s.id);
333
+ const missingSlots = requiredSlots.filter(slot => !assignedSlots.includes(slot));
334
+ return {
335
+ isValid: missingSlots.length === 0,
336
+ missingSlots
337
+ };
338
+ }
339
+ /**
340
+ * Create a new grid configuration
341
+ */
342
+ export function createGridConfiguration(name, layoutId, assignments) {
343
+ return {
344
+ id: `grid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
345
+ name,
346
+ layoutId,
347
+ componentAssignments: assignments,
348
+ created: new Date().toISOString(),
349
+ modified: new Date().toISOString()
350
+ };
351
+ }
@@ -0,0 +1,7 @@
1
+ export { Half, Quarter, ResizeHandle, resizeStore } from './Grid/index.js';
2
+ export { default as Desktop } from './Desktop.svelte';
3
+ export { default as GridRenderer } from './GridRenderer.svelte';
4
+ export { default as GridViewer } from './GridViewer.svelte';
5
+ export { GridSelector, type ComponentConfig } from './GridSelector/index.js';
6
+ export { createWindowLauncher, createTabLauncher, createNavigationLauncher, createModalLauncher } from './launchHelpers.js';
7
+ export { getAllLayouts, getLayoutById, getLayoutsByCategory, getLayoutsOrdered, validateComponentAssignments, createGridConfiguration, type GridLayoutDefinition, type GridSlot, type ComponentAssignment, type GridConfiguration } from './gridLayouts.js';
@@ -0,0 +1,7 @@
1
+ export { Half, Quarter, ResizeHandle, resizeStore } from './Grid/index.js';
2
+ export { default as Desktop } from './Desktop.svelte';
3
+ export { default as GridRenderer } from './GridRenderer.svelte';
4
+ export { default as GridViewer } from './GridViewer.svelte';
5
+ export { GridSelector } from './GridSelector/index.js';
6
+ export { createWindowLauncher, createTabLauncher, createNavigationLauncher, createModalLauncher } from './launchHelpers.js';
7
+ export { getAllLayouts, getLayoutById, getLayoutsByCategory, getLayoutsOrdered, validateComponentAssignments, createGridConfiguration } from './gridLayouts.js';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Launch Helpers
3
+ *
4
+ * Utility functions to help parent applications implement grid launching functionality.
5
+ * These are optional helpers - parents can implement their own launch logic.
6
+ */
7
+ import type { GridConfiguration } from './gridLayouts.js';
8
+ import type { ComponentConfig } from './GridSelector/index.js';
9
+ /**
10
+ * Create a launch handler that opens grids in new windows using localStorage
11
+ * This recreates the previous built-in behavior as a reusable helper
12
+ */
13
+ export declare function createWindowLauncher(gridViewerUrl: string, availableComponents: ComponentConfig[], windowFeatures?: string): (grid: GridConfiguration) => void;
14
+ /**
15
+ * Create a launch handler that opens grids in new tabs (simpler window features)
16
+ */
17
+ export declare function createTabLauncher(gridViewerUrl: string, availableComponents: ComponentConfig[]): (grid: GridConfiguration) => void;
18
+ /**
19
+ * Create a launch handler that uses direct URL navigation (same tab)
20
+ */
21
+ export declare function createNavigationLauncher(gridViewerUrl: string, availableComponents: ComponentConfig[]): (grid: GridConfiguration) => void;
22
+ /**
23
+ * Example of a custom launch handler that could show a modal instead
24
+ */
25
+ export declare function createModalLauncher(openModalCallback: (grid: GridConfiguration) => void): (grid: GridConfiguration) => void;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Launch Helpers
3
+ *
4
+ * Utility functions to help parent applications implement grid launching functionality.
5
+ * These are optional helpers - parents can implement their own launch logic.
6
+ */
7
+ /**
8
+ * Create a launch handler that opens grids in new windows using localStorage
9
+ * This recreates the previous built-in behavior as a reusable helper
10
+ */
11
+ export function createWindowLauncher(gridViewerUrl, availableComponents, windowFeatures = 'width=1200,height=800,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,status=no') {
12
+ return (grid) => {
13
+ // Create temporary storage key
14
+ const key = `grid-viewer-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
15
+ // Store only the grid configuration and component IDs - not the actual components
16
+ const data = {
17
+ grid,
18
+ // Store component configs without the actual component objects
19
+ componentConfigs: availableComponents.map(comp => ({
20
+ id: comp.id,
21
+ name: comp.name,
22
+ icon: comp.icon,
23
+ description: comp.description,
24
+ category: comp.category
25
+ }))
26
+ };
27
+ localStorage.setItem(key, JSON.stringify(data));
28
+ // Open new window with the key parameter
29
+ const url = `${gridViewerUrl}?key=${key}`;
30
+ const newWindow = window.open(url, `grid-${grid.id}`, windowFeatures);
31
+ // Focus the new window if it opened successfully
32
+ if (newWindow) {
33
+ newWindow.focus();
34
+ }
35
+ else {
36
+ // Clean up if window failed to open
37
+ localStorage.removeItem(key);
38
+ alert('Failed to open new window. Please check your browser\'s popup blocker settings.');
39
+ }
40
+ };
41
+ }
42
+ /**
43
+ * Create a launch handler that opens grids in new tabs (simpler window features)
44
+ */
45
+ export function createTabLauncher(gridViewerUrl, availableComponents) {
46
+ return createWindowLauncher(gridViewerUrl, availableComponents, 'scrollbars=yes,resizable=yes');
47
+ }
48
+ /**
49
+ * Create a launch handler that uses direct URL navigation (same tab)
50
+ */
51
+ export function createNavigationLauncher(gridViewerUrl, availableComponents) {
52
+ return (grid) => {
53
+ // Create temporary storage key
54
+ const key = `grid-viewer-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
55
+ const data = {
56
+ grid,
57
+ componentConfigs: availableComponents.map(comp => ({
58
+ id: comp.id,
59
+ name: comp.name,
60
+ icon: comp.icon,
61
+ description: comp.description,
62
+ category: comp.category
63
+ }))
64
+ };
65
+ localStorage.setItem(key, JSON.stringify(data));
66
+ // Navigate to the grid viewer in the same tab
67
+ window.location.href = `${gridViewerUrl}?key=${key}`;
68
+ };
69
+ }
70
+ /**
71
+ * Example of a custom launch handler that could show a modal instead
72
+ */
73
+ export function createModalLauncher(openModalCallback) {
74
+ return (grid) => {
75
+ openModalCallback(grid);
76
+ };
77
+ }
@@ -0,0 +1 @@
1
+ export { Half, Quarter, ResizeHandle, resizeStore, Desktop, GridSelector, GridRenderer, GridViewer, type ComponentConfig, getAllLayouts, getLayoutById, getLayoutsByCategory, getLayoutsOrdered, validateComponentAssignments, createGridConfiguration, type GridLayoutDefinition, type GridSlot, type ComponentAssignment, type GridConfiguration, createWindowLauncher, createTabLauncher, createNavigationLauncher, createModalLauncher } from './Desktop/index.js';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { Half, Quarter, ResizeHandle, resizeStore, Desktop, GridSelector, GridRenderer, GridViewer, getAllLayouts, getLayoutById, getLayoutsByCategory, getLayoutsOrdered, validateComponentAssignments, createGridConfiguration, createWindowLauncher, createTabLauncher, createNavigationLauncher, createModalLauncher } from './Desktop/index.js';
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@smartnet360/svelte-components",
3
+ "version": "0.0.1-beta.2",
4
+ "scripts": {
5
+ "dev": "vite dev",
6
+ "build": "vite build && npm run prepack",
7
+ "preview": "vite preview",
8
+ "prepare": "svelte-kit sync || echo ''",
9
+ "prepack": "svelte-kit sync && svelte-package && publint",
10
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
+ "format": "prettier --write .",
13
+ "lint": "prettier --check . && eslint .",
14
+ "release:beta": "npm version prerelease --preid=beta && npm publish --tag beta --access public",
15
+ "release:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha --access public",
16
+ "release:patch": "npm version patch && npm publish --tag latest --access public",
17
+ "release:minor": "npm version minor && npm publish --tag latest --access public",
18
+ "release:major": "npm version major && npm publish --tag latest --access public"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "sideEffects": [
24
+ "**/*.css"
25
+ ],
26
+ "svelte": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "type": "module",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "svelte": "./dist/index.js"
33
+ }
34
+ },
35
+ "peerDependencies": {
36
+ "svelte": "^5.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@eslint/compat": "^1.2.5",
40
+ "@eslint/js": "^9.18.0",
41
+ "@sveltejs/adapter-auto": "^6.0.0",
42
+ "@sveltejs/kit": "^2.22.0",
43
+ "@sveltejs/package": "^2.0.0",
44
+ "@sveltejs/vite-plugin-svelte": "^6.0.0",
45
+ "eslint": "^9.18.0",
46
+ "eslint-config-prettier": "^10.0.1",
47
+ "eslint-plugin-svelte": "^3.0.0",
48
+ "globals": "^16.0.0",
49
+ "prettier": "^3.4.2",
50
+ "prettier-plugin-svelte": "^3.3.3",
51
+ "publint": "^0.3.2",
52
+ "sass": "^1.92.1",
53
+ "svelte": "^5.0.0",
54
+ "svelte-check": "^4.0.0",
55
+ "typescript": "^5.0.0",
56
+ "typescript-eslint": "^8.20.0",
57
+ "vite": "^7.0.4"
58
+ },
59
+ "keywords": [
60
+ "svelte"
61
+ ],
62
+ "dependencies": {
63
+ "bootstrap": "^5.2.3"
64
+ }
65
+ }