@stacksjs/hello-world-stx 0.75.329 → 0.75.334

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 (37) hide show
  1. package/README.md +7 -0
  2. package/dist/bundle.js +474 -0
  3. package/dist/bundle.js.map +23 -0
  4. package/dist/custom-elements.d.ts +153 -0
  5. package/dist/custom-elements.json +927 -0
  6. package/dist/index.d.ts +13 -0
  7. package/dist/index.js +13 -0
  8. package/dist/runtime.js +309 -0
  9. package/dist/ssr.d.ts +27 -0
  10. package/dist/ssr.js +388 -0
  11. package/dist/stacks-context-menu-item.d.ts +27 -0
  12. package/dist/stacks-context-menu-item.js +85 -0
  13. package/dist/stacks-context-menu.d.ts +24 -0
  14. package/dist/stacks-context-menu.js +35 -0
  15. package/dist/stacks-desktop-icon.d.ts +33 -0
  16. package/dist/stacks-desktop-icon.js +114 -0
  17. package/dist/stacks-feature-button.d.ts +26 -0
  18. package/dist/stacks-feature-button.js +56 -0
  19. package/dist/stacks-input-group.d.ts +28 -0
  20. package/dist/stacks-input-group.js +68 -0
  21. package/dist/stacks-login-form.d.ts +28 -0
  22. package/dist/stacks-login-form.js +85 -0
  23. package/dist/stacks-login-screen.d.ts +26 -0
  24. package/dist/stacks-login-screen.js +77 -0
  25. package/dist/stacks-notification-popup.d.ts +26 -0
  26. package/dist/stacks-notification-popup.js +85 -0
  27. package/dist/stacks-package-item.d.ts +26 -0
  28. package/dist/stacks-package-item.js +49 -0
  29. package/dist/stacks-start-menu-item.d.ts +28 -0
  30. package/dist/stacks-start-menu-item.js +99 -0
  31. package/dist/stacks-start-menu.d.ts +26 -0
  32. package/dist/stacks-start-menu.js +85 -0
  33. package/dist/stacks-taskbar.d.ts +24 -0
  34. package/dist/stacks-taskbar.js +63 -0
  35. package/dist/stacks-window.d.ts +31 -0
  36. package/dist/stacks-window.js +104 -0
  37. package/package.json +4 -4
package/dist/ssr.js ADDED
@@ -0,0 +1,388 @@
1
+ const definitions = {
2
+ "stacks-context-menu": {
3
+ "template": "<div class=\"context-menu\" id=\"{{ id }}\" style=\"display: none;\">\n <slot />\n </div>",
4
+ "styles": "",
5
+ "shadowMode": false,
6
+ "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "reflect": true
10
+ }
11
+ }
12
+ },
13
+ "stacks-context-menu-item": {
14
+ "template": "@if (hasSubmenu)\n <div class=\"context-menu-item has-submenu\">\n @if (icon)\n <div class=\"context-menu-item-icon\">{{ icon }}</div>\n @endif\n <div>{{ label }}</div>\n <div class=\"context-submenu\">\n <slot />\n </div>\n </div>\n @else\n <button class=\"context-menu-item\" @if (onclick)onclick=\"{{ onclick }}\"@endif>\n @if (icon)\n <div class=\"context-menu-item-icon\">{{ icon }}</div>\n @endif\n <div>{{ label }}</div>\n </button>\n @endif",
15
+ "styles": "",
16
+ "shadowMode": false,
17
+ "properties": {
18
+ "icon": {
19
+ "type": "string",
20
+ "default": "",
21
+ "reflect": true
22
+ },
23
+ "label": {
24
+ "type": "string",
25
+ "reflect": true
26
+ },
27
+ "onclick": {
28
+ "type": "string",
29
+ "reflect": true
30
+ },
31
+ "hasSubmenu": {
32
+ "type": "boolean",
33
+ "default": false,
34
+ "reflect": true
35
+ }
36
+ }
37
+ },
38
+ "stacks-desktop-icon": {
39
+ "template": "<button\n class=\"desktop-icon\"\n data-icon-id=\"{{ id }}\"\n data-icon-type=\"{{ type }}\"\n data-icon-section=\"{{ section }}\"\n data-icon-url=\"{{ url }}\"\n style=\"@if(style){{ style }}@else left: {{ left }}; top: {{ top }};@endif\"\n @if (onclick)\n onclick=\"{{ onclick }}\"\n @endif\n >\n <div class=\"desktop-icon-image\">{{ icon }}</div>\n <div class=\"desktop-icon-label\">{{ label }}</div>\n </button>",
40
+ "styles": "",
41
+ "shadowMode": false,
42
+ "properties": {
43
+ "id": {
44
+ "type": "string",
45
+ "reflect": true
46
+ },
47
+ "icon": {
48
+ "type": "string",
49
+ "default": "📄",
50
+ "reflect": true
51
+ },
52
+ "label": {
53
+ "type": "string",
54
+ "reflect": true
55
+ },
56
+ "type": {
57
+ "type": "string",
58
+ "default": "window",
59
+ "reflect": true
60
+ },
61
+ "section": {
62
+ "type": "string",
63
+ "default": "",
64
+ "reflect": true
65
+ },
66
+ "url": {
67
+ "type": "string",
68
+ "default": "",
69
+ "reflect": true
70
+ },
71
+ "onclick": {
72
+ "type": "string",
73
+ "reflect": true
74
+ },
75
+ "left": {
76
+ "type": "string",
77
+ "default": "20px",
78
+ "reflect": true
79
+ },
80
+ "top": {
81
+ "type": "string",
82
+ "default": "20px",
83
+ "reflect": true
84
+ },
85
+ "style": {
86
+ "type": "string",
87
+ "default": "",
88
+ "reflect": true
89
+ }
90
+ }
91
+ },
92
+ "stacks-feature-button": {
93
+ "template": "<button\n class=\"feature-btn @if (active)active@endif\"\n @if (onclick)onclick=\"{{ onclick }}\"@endif\n >\n {{ label }}\n </button>",
94
+ "styles": "",
95
+ "shadowMode": false,
96
+ "properties": {
97
+ "label": {
98
+ "type": "string",
99
+ "reflect": true
100
+ },
101
+ "onclick": {
102
+ "type": "string",
103
+ "reflect": true
104
+ },
105
+ "active": {
106
+ "type": "boolean",
107
+ "default": false,
108
+ "reflect": true
109
+ }
110
+ }
111
+ },
112
+ "stacks-input-group": {
113
+ "template": "<div class=\"login-input-group\">\n <label>{{ label }}:</label>\n <input\n type=\"{{ type }}\"\n id=\"{{ id }}\"\n class=\"{{ classList }}\"\n placeholder=\"{{ placeholder }}\"\n />\n </div>",
114
+ "styles": "",
115
+ "shadowMode": false,
116
+ "properties": {
117
+ "id": {
118
+ "type": "string",
119
+ "reflect": true
120
+ },
121
+ "label": {
122
+ "type": "string",
123
+ "reflect": true
124
+ },
125
+ "type": {
126
+ "type": "string",
127
+ "default": "text",
128
+ "reflect": true
129
+ },
130
+ "placeholder": {
131
+ "type": "string",
132
+ "default": "",
133
+ "reflect": true
134
+ },
135
+ "class": {
136
+ "type": "string",
137
+ "default": "login-input",
138
+ "reflect": true
139
+ }
140
+ }
141
+ },
142
+ "stacks-login-form": {
143
+ "template": "<div id=\"{{ id }}\" class=\"hidden login-form\">\n <div class=\"login-form-background\">\n <div class=\"login-form-container\">\n <button class=\"login-close-btn\" onclick=\"closeLoginScreens()\">×</button>\n <div class=\"login-form-header\">\n <button class=\"login-back-button\" onclick=\"hideLoginForms()\">← Back</button>\n <div class=\"login-form-title\">\n <div class=\"login-form-icon\">{{ icon }}</div>\n <h2>{{ title }}</h2>\n </div>\n </div>\n\n <div class=\"login-form-content\">\n <div class=\"login-form-prompt\">{{ prompt }}</div>\n <slot />\n <div class=\"login-actions\">\n <button class=\"login-submit-btn\" onclick=\"{{ submitHandler }}\">\n <span class=\"login-btn-icon\">→</span>\n <span>Log In</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>",
144
+ "styles": "",
145
+ "shadowMode": false,
146
+ "properties": {
147
+ "id": {
148
+ "type": "string",
149
+ "reflect": true
150
+ },
151
+ "icon": {
152
+ "type": "string",
153
+ "default": "👤",
154
+ "reflect": true
155
+ },
156
+ "title": {
157
+ "type": "string",
158
+ "default": "Login",
159
+ "reflect": true
160
+ },
161
+ "prompt": {
162
+ "type": "string",
163
+ "default": "Enter your credentials",
164
+ "reflect": true
165
+ },
166
+ "submitHandler": {
167
+ "type": "string",
168
+ "default": "handleLogin()",
169
+ "reflect": true
170
+ }
171
+ }
172
+ },
173
+ "stacks-login-screen": {
174
+ "template": "<div id=\"{{ id }}\" class=\"hidden login-screen\">\n <div class=\"login-background\">\n <div class=\"login-container\">\n <button class=\"login-close-btn\" onclick=\"closeLoginScreens()\">×</button>\n <div class=\"login-header\">\n <div class=\"login-logo\">{{ logoText }}</div>\n <div class=\"login-subtitle\">{{ subtitle }}</div>\n </div>\n\n <div class=\"login-users\">\n <slot name=\"login-options\">\n <button class=\"login-user-button\" id=\"email-login-btn\">\n <div class=\"login-user-icon\">👤</div>\n <div class=\"login-user-name\">Email Login</div>\n </button>\n <button class=\"login-user-button\" id=\"license-login-btn\">\n <div class=\"login-user-icon\">🔑</div>\n <div class=\"login-user-name\">License Key</div>\n </button>\n </slot>\n </div>\n\n <div class=\"login-footer\">\n <slot name=\"footer\">\n <div class=\"login-footer-text\">After you log in, you can access the STACKS Desktop</div>\n </slot>\n </div>\n </div>\n </div>\n </div>",
175
+ "styles": "",
176
+ "shadowMode": false,
177
+ "properties": {
178
+ "id": {
179
+ "type": "string",
180
+ "default": "login-screen",
181
+ "reflect": true
182
+ },
183
+ "logoText": {
184
+ "type": "string",
185
+ "default": "STACKS",
186
+ "reflect": true
187
+ },
188
+ "subtitle": {
189
+ "type": "string",
190
+ "default": "To begin, click your user name",
191
+ "reflect": true
192
+ }
193
+ }
194
+ },
195
+ "stacks-notification-popup": {
196
+ "template": "<div class=\"notification-popup\" id=\"{{ id }}\" style=\"display: none;\">\n <div class=\"notification-header\">\n <span class=\"notification-title\">{{ title }}</span>\n <button class=\"notification-close\" onclick=\"closeNotificationPopup()\">×</button>\n </div>\n <div class=\"notification-content\">\n <slot />\n </div>\n @if (showSignup)\n <div class=\"notification-signup\" id=\"notification-signup\">\n <div class=\"notification-separator\"></div>\n <div class=\"notification-signup-text\">Get updates on new features & releases:</div>\n <div class=\"notification-signup-form\">\n <input\n type=\"email\"\n id=\"notification-email\"\n class=\"notification-email-input\"\n placeholder=\"your@email.com\"\n autocomplete=\"email\"\n />\n <button class=\"notification-signup-btn\" onclick=\"handleEmailSignup()\">\n Sign Up\n </button>\n </div>\n </div>\n <div class=\"notification-success\" id=\"notification-success\" style=\"display: none;\">\n <div class=\"notification-separator\"></div>\n <div class=\"notification-success-content\">\n <div class=\"notification-success-icon\">✓</div>\n <div class=\"notification-success-text\">\n <div class=\"notification-success-title\">Thanks for subscribing!</div>\n <div class=\"notification-success-subtitle\">We'll keep you updated.</div>\n </div>\n </div>\n </div>\n @endif\n </div>",
197
+ "styles": "",
198
+ "shadowMode": false,
199
+ "properties": {
200
+ "id": {
201
+ "type": "string",
202
+ "default": "notification-popup",
203
+ "reflect": true
204
+ },
205
+ "title": {
206
+ "type": "string",
207
+ "default": "Notifications",
208
+ "reflect": true
209
+ },
210
+ "showSignup": {
211
+ "type": "boolean",
212
+ "default": true,
213
+ "reflect": true
214
+ }
215
+ }
216
+ },
217
+ "stacks-package-item": {
218
+ "template": "<div class=\"package-item\">\n <div class=\"package-emoji\">{{ emoji }}</div>\n <div class=\"package-title\">{{ title }}</div>\n <div class=\"package-desc\">{{ description }}</div>\n </div>",
219
+ "styles": "",
220
+ "shadowMode": false,
221
+ "properties": {
222
+ "emoji": {
223
+ "type": "string",
224
+ "reflect": true
225
+ },
226
+ "title": {
227
+ "type": "string",
228
+ "reflect": true
229
+ },
230
+ "description": {
231
+ "type": "string",
232
+ "reflect": true
233
+ }
234
+ }
235
+ },
236
+ "stacks-start-menu": {
237
+ "template": "<div class=\"start-menu\" id=\"{{ id }}\" style=\"display: none;\">\n <div class=\"start-menu-header\">\n <div class=\"start-menu-user-image\">{{ userImage }}</div>\n <div class=\"start-menu-user-name\">{{ userName }}</div>\n </div>\n\n <div class=\"start-menu-content\">\n <div class=\"start-menu-left\">\n <div class=\"start-menu-pinned\">\n <slot name=\"pinned-items\" />\n </div>\n <div class=\"start-menu-separator\"></div>\n <slot name=\"all-programs\">\n <button class=\"start-menu-item all-programs\">\n <span>All Programs</span>\n <span class=\"arrow\">▸</span>\n </button>\n </slot>\n </div>\n\n <div class=\"start-menu-right\">\n <slot name=\"right-items\" />\n </div>\n </div>\n\n <div class=\"start-menu-footer\">\n <slot name=\"footer\">\n <button class=\"start-menu-footer-btn\" onclick=\"showLoginScreen()\">\n <span class=\"footer-icon\">🔑</span>\n <span>Log Off</span>\n </button>\n <button class=\"start-menu-footer-btn\" onclick=\"window.location.reload()\">\n <span class=\"footer-icon\">🔄</span>\n <span>Restart</span>\n </button>\n </slot>\n </div>\n </div>",
238
+ "styles": "",
239
+ "shadowMode": false,
240
+ "properties": {
241
+ "id": {
242
+ "type": "string",
243
+ "default": "start-menu",
244
+ "reflect": true
245
+ },
246
+ "userName": {
247
+ "type": "string",
248
+ "default": "Developer",
249
+ "reflect": true
250
+ },
251
+ "userImage": {
252
+ "type": "string",
253
+ "default": "👤",
254
+ "reflect": true
255
+ }
256
+ }
257
+ },
258
+ "stacks-start-menu-item": {
259
+ "template": "@if (url)\n <button\n class=\"start-menu-item {{ highlighted ? 'highlighted' : '' }}\"\n onclick=\"window.open('{{ url }}', '_blank')\"\n >\n <span class=\"start-menu-item-icon\">{{ icon }}</span>\n <span class=\"start-menu-item-label\">{{ label }}</span>\n </button>\n @elseif (onclick)\n <button\n class=\"start-menu-item {{ highlighted ? 'highlighted' : '' }}\"\n onclick=\"{{ onclick }}\"\n >\n <span class=\"start-menu-item-icon\">{{ icon }}</span>\n <span class=\"start-menu-item-label\">{{ label }}</span>\n </button>\n @else\n <button\n class=\"start-menu-item {{ highlighted ? 'highlighted' : '' }}\"\n >\n <span class=\"start-menu-item-icon\">{{ icon }}</span>\n <span class=\"start-menu-item-label\">{{ label }}</span>\n </button>\n @endif",
260
+ "styles": "",
261
+ "shadowMode": false,
262
+ "properties": {
263
+ "icon": {
264
+ "type": "string",
265
+ "default": "📄",
266
+ "reflect": true
267
+ },
268
+ "label": {
269
+ "type": "string",
270
+ "reflect": true
271
+ },
272
+ "onclick": {
273
+ "type": "string",
274
+ "reflect": true
275
+ },
276
+ "url": {
277
+ "type": "string",
278
+ "reflect": true
279
+ },
280
+ "highlighted": {
281
+ "type": "boolean",
282
+ "default": false,
283
+ "reflect": true
284
+ }
285
+ }
286
+ },
287
+ "stacks-taskbar": {
288
+ "template": "<div class=\"taskbar\">\n @if (showStartMenu)\n <button class=\"start-button\" onclick=\"toggleStartMenu()\">\n <div class=\"start-button-flag\">\n <div class=\"flag-red\"></div>\n <div class=\"flag-green\"></div>\n <div class=\"flag-blue\"></div>\n <div class=\"flag-yellow\"></div>\n </div>\n <span>Start</span>\n </button>\n @endif\n\n <div class=\"quick-launch\">\n <slot name=\"quick-launch\" />\n </div>\n\n <div class=\"taskbar-windows\" id=\"taskbar-windows\">\n <slot name=\"taskbar-windows\" />\n </div>\n\n <div class=\"system-tray\">\n <slot name=\"system-tray\">\n <button class=\"tray-icon\" onclick=\"toggleNotificationPopup()\">🔔</button>\n <button class=\"tray-icon\" onclick=\"window.open('https://github.com/stacksjs/stacks', '_blank')\">💻</button>\n <button class=\"tray-icon\" onclick=\"window.open('https://stacksjs.com/discord', '_blank')\">💬</button>\n </slot>\n <div class=\"clock\" id=\"clock\"></div>\n </div>\n </div>",
289
+ "styles": "",
290
+ "shadowMode": false,
291
+ "properties": {
292
+ "showStartMenu": {
293
+ "type": "boolean",
294
+ "default": true,
295
+ "reflect": true
296
+ }
297
+ }
298
+ },
299
+ "stacks-window": {
300
+ "template": "<div id=\"window-{{ id }}\" class=\"window\" style=\"@if(style){{ style }}@else left: {{ left }}; top: {{ top }}; width: {{ width }}; height: {{ height }};@endif\">\n <div class=\"window-titlebar\">\n <div class=\"window-icon\">{{ icon }}</div>\n <div class=\"window-title\">{{ title }}</div>\n <div class=\"window-controls\">\n <button class=\"minimize window-control\" onclick=\"minimizeWindow('{{ id }}')\">_</button>\n <button class=\"maximize window-control\" onclick=\"toggleMaximizeWindow('{{ id }}')\">□</button>\n <button class=\"close window-control\" onclick=\"closeWindow('{{ id }}')\">×</button>\n </div>\n </div>\n <div class=\"window-content\">\n <slot />\n </div>\n </div>",
301
+ "styles": "",
302
+ "shadowMode": false,
303
+ "properties": {
304
+ "id": {
305
+ "type": "string",
306
+ "reflect": true
307
+ },
308
+ "icon": {
309
+ "type": "string",
310
+ "default": "📄",
311
+ "reflect": true
312
+ },
313
+ "title": {
314
+ "type": "string",
315
+ "reflect": true
316
+ },
317
+ "left": {
318
+ "type": "string",
319
+ "default": "100px",
320
+ "reflect": true
321
+ },
322
+ "top": {
323
+ "type": "string",
324
+ "default": "80px",
325
+ "reflect": true
326
+ },
327
+ "width": {
328
+ "type": "string",
329
+ "default": "600px",
330
+ "reflect": true
331
+ },
332
+ "height": {
333
+ "type": "string",
334
+ "default": "500px",
335
+ "reflect": true
336
+ },
337
+ "style": {
338
+ "type": "string",
339
+ "default": "",
340
+ "reflect": true
341
+ }
342
+ }
343
+ }
344
+ };
345
+ const escapeHTML = (value) => String(value ?? '')
346
+ .replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;')
347
+ .replaceAll('"', '&quot;').replaceAll("'", '&#039;');
348
+ const valueAt = (values, path) => path.trim().split('.').reduce((value, part) => value?.[part], values);
349
+
350
+ export function renderComponent(tag, props = {}, slots = {}) {
351
+ const definition = definitions[tag];
352
+ if (!definition) throw new Error('Unknown STX component: ' + tag);
353
+ const values = Object.fromEntries(Object.entries(definition.properties).map(([name, property]) => [name, property.default]));
354
+ Object.assign(values, props);
355
+ let template = definition.template
356
+ .replace(new RegExp("\\{!!\\s*([\\w$.]+)\\s*!!\\}", 'g'), (_match, expression) => String(valueAt(values, expression) ?? ''))
357
+ .replace(new RegExp("\\{\\{\\s*([\\w$.]+)\\s*\\}\\}", 'g'), (_match, expression) => escapeHTML(valueAt(values, expression)))
358
+ .replace(new RegExp("<slot(?:\\s+name=[\"\\']([^\"\\']+)[\"\\'])?\\s*\\/?>(?:<\\/slot>)?", 'gi'), (_match, name) => String(slots[name || 'default'] ?? ''));
359
+ const attributes = Object.entries(definition.properties).flatMap(([name, property]) => {
360
+ if (property.attribute === false || !(name in props)) return [];
361
+ const attribute = property.attribute || name.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase());
362
+ const value = props[name];
363
+ if (value == null || value === false) return [];
364
+ if (value === true) return [attribute];
365
+ const serialized = typeof value === 'object' ? JSON.stringify(value) : value;
366
+ return [attribute + '=\"' + escapeHTML(serialized) + '\"'];
367
+ }).join(' ');
368
+ if (definition.shadowMode) {
369
+ template = '<template shadowrootmode="' + definition.shadowMode + '">' +
370
+ (definition.styles ? '<style>' + definition.styles + '</style>' : '') + template + '</template>' +
371
+ String(slots.default ?? '');
372
+ }
373
+ return '<' + tag + (attributes ? ' ' + attributes : '') + '>' + template + '</' + tag + '>';
374
+ }
375
+
376
+ export const renderContextMenu = (props = {}, slots = {}) => renderComponent('stacks-context-menu', props, slots);
377
+ export const renderContextMenuItem = (props = {}, slots = {}) => renderComponent('stacks-context-menu-item', props, slots);
378
+ export const renderDesktopIcon = (props = {}, slots = {}) => renderComponent('stacks-desktop-icon', props, slots);
379
+ export const renderFeatureButton = (props = {}, slots = {}) => renderComponent('stacks-feature-button', props, slots);
380
+ export const renderInputGroup = (props = {}, slots = {}) => renderComponent('stacks-input-group', props, slots);
381
+ export const renderLoginForm = (props = {}, slots = {}) => renderComponent('stacks-login-form', props, slots);
382
+ export const renderLoginScreen = (props = {}, slots = {}) => renderComponent('stacks-login-screen', props, slots);
383
+ export const renderNotificationPopup = (props = {}, slots = {}) => renderComponent('stacks-notification-popup', props, slots);
384
+ export const renderPackageItem = (props = {}, slots = {}) => renderComponent('stacks-package-item', props, slots);
385
+ export const renderStartMenu = (props = {}, slots = {}) => renderComponent('stacks-start-menu', props, slots);
386
+ export const renderStartMenuItem = (props = {}, slots = {}) => renderComponent('stacks-start-menu-item', props, slots);
387
+ export const renderTaskbar = (props = {}, slots = {}) => renderComponent('stacks-taskbar', props, slots);
388
+ export const renderWindow = (props = {}, slots = {}) => renderComponent('stacks-window', props, slots);
@@ -0,0 +1,27 @@
1
+ export interface ContextMenuItemProps {
2
+ icon?: string
3
+ label?: string
4
+ onclick?: string
5
+ hasSubmenu?: boolean
6
+ }
7
+
8
+ export interface ContextMenuItemEventMap {
9
+
10
+ }
11
+
12
+ export interface ContextMenuItem extends Required<Pick<ContextMenuItemProps, Exclude<keyof ContextMenuItemProps, keyof HTMLElement>>> {}
13
+
14
+ export declare class ContextMenuItem extends HTMLElement {
15
+
16
+ readonly updateComplete: Promise<void>
17
+ requestUpdate(): Promise<void>
18
+ emit<T = unknown>(name: string, detail?: T, options?: CustomEventInit<T>): boolean
19
+ }
20
+
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ "stacks-context-menu-item": ContextMenuItem
24
+ }
25
+ }
26
+
27
+ export default ContextMenuItem
@@ -0,0 +1,85 @@
1
+ import { StxElement, defineComponent } from './runtime.js';
2
+
3
+ /** ContextMenuItem web component generated from ContextMenuItem.stx. */
4
+ export class ContextMenuItem extends StxElement {
5
+
6
+ render(__helpers) {
7
+ const { escape: __escape, raw: __raw, values: __values, entries: __entries } = __helpers;
8
+ const { icon = "", label, onclick, hasSubmenu = false } = this._props();
9
+ let out = "";
10
+ if (hasSubmenu) {
11
+ out += `
12
+ <div class="context-menu-item has-submenu">
13
+ `;
14
+ if (icon) {
15
+ out += `
16
+ <div class="context-menu-item-icon">`;
17
+ out += __escape(icon);
18
+ out += `</div>
19
+ `;
20
+ }
21
+ out += "<div>";
22
+ out += __escape(label);
23
+ out += `</div>
24
+ <div class="context-submenu">
25
+ <slot />
26
+ </div>
27
+ </div>
28
+ `;
29
+ } else {
30
+ out += '<button class="context-menu-item" ';
31
+ if (onclick) {
32
+ out += 'onclick="';
33
+ out += __escape(onclick);
34
+ out += '"';
35
+ }
36
+ out += `>
37
+ `;
38
+ if (icon) {
39
+ out += `
40
+ <div class="context-menu-item-icon">`;
41
+ out += __escape(icon);
42
+ out += `</div>
43
+ `;
44
+ }
45
+ out += "<div>";
46
+ out += __escape(label);
47
+ out += `</div>
48
+ </button>
49
+ `;
50
+ }
51
+ return out;
52
+ }
53
+
54
+ }
55
+
56
+ defineComponent(ContextMenuItem, {
57
+ "tag": "stacks-context-menu-item",
58
+ "template": "@if (hasSubmenu)\n <div class=\"context-menu-item has-submenu\">\n @if (icon)\n <div class=\"context-menu-item-icon\">{{ icon }}</div>\n @endif\n <div>{{ label }}</div>\n <div class=\"context-submenu\">\n <slot />\n </div>\n </div>\n @else\n <button class=\"context-menu-item\" @if (onclick)onclick=\"{{ onclick }}\"@endif>\n @if (icon)\n <div class=\"context-menu-item-icon\">{{ icon }}</div>\n @endif\n <div>{{ label }}</div>\n </button>\n @endif",
59
+ "styles": "",
60
+ "shadowMode": false,
61
+ "progressive": true,
62
+ "properties": {
63
+ "icon": {
64
+ "type": "string",
65
+ "default": "",
66
+ "reflect": true
67
+ },
68
+ "label": {
69
+ "type": "string",
70
+ "reflect": true
71
+ },
72
+ "onclick": {
73
+ "type": "string",
74
+ "reflect": true
75
+ },
76
+ "hasSubmenu": {
77
+ "type": "boolean",
78
+ "default": false,
79
+ "reflect": true
80
+ }
81
+ },
82
+ "eventTypes": [],
83
+ "bindings": []
84
+ });
85
+ export default ContextMenuItem;
@@ -0,0 +1,24 @@
1
+ export interface ContextMenuProps {
2
+ id?: string
3
+ }
4
+
5
+ export interface ContextMenuEventMap {
6
+
7
+ }
8
+
9
+ export interface ContextMenu extends Required<Pick<ContextMenuProps, Exclude<keyof ContextMenuProps, keyof HTMLElement>>> {}
10
+
11
+ export declare class ContextMenu extends HTMLElement {
12
+
13
+ readonly updateComplete: Promise<void>
14
+ requestUpdate(): Promise<void>
15
+ emit<T = unknown>(name: string, detail?: T, options?: CustomEventInit<T>): boolean
16
+ }
17
+
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ "stacks-context-menu": ContextMenu
21
+ }
22
+ }
23
+
24
+ export default ContextMenu
@@ -0,0 +1,35 @@
1
+ import { StxElement, defineComponent } from './runtime.js';
2
+
3
+ /** ContextMenu web component generated from ContextMenu.stx. */
4
+ export class ContextMenu extends StxElement {
5
+
6
+ render(__helpers) {
7
+ const { escape: __escape, raw: __raw, values: __values, entries: __entries } = __helpers;
8
+ const { id } = this._props();
9
+ let out = "";
10
+ out += '<div class="context-menu" id="';
11
+ out += __escape(id);
12
+ out += `" style="display: none;">
13
+ <slot />
14
+ </div>`;
15
+ return out;
16
+ }
17
+
18
+ }
19
+
20
+ defineComponent(ContextMenu, {
21
+ "tag": "stacks-context-menu",
22
+ "template": "<div class=\"context-menu\" id=\"{{ id }}\" style=\"display: none;\">\n <slot />\n </div>",
23
+ "styles": "",
24
+ "shadowMode": false,
25
+ "progressive": true,
26
+ "properties": {
27
+ "id": {
28
+ "type": "string",
29
+ "reflect": true
30
+ }
31
+ },
32
+ "eventTypes": [],
33
+ "bindings": []
34
+ });
35
+ export default ContextMenu;
@@ -0,0 +1,33 @@
1
+ export interface DesktopIconProps {
2
+ id?: string
3
+ icon?: string
4
+ label?: string
5
+ type?: string
6
+ section?: string
7
+ url?: string
8
+ onclick?: string
9
+ left?: string
10
+ top?: string
11
+ style?: string
12
+ }
13
+
14
+ export interface DesktopIconEventMap {
15
+
16
+ }
17
+
18
+ export interface DesktopIcon extends Required<Pick<DesktopIconProps, Exclude<keyof DesktopIconProps, keyof HTMLElement>>> {}
19
+
20
+ export declare class DesktopIcon extends HTMLElement {
21
+
22
+ readonly updateComplete: Promise<void>
23
+ requestUpdate(): Promise<void>
24
+ emit<T = unknown>(name: string, detail?: T, options?: CustomEventInit<T>): boolean
25
+ }
26
+
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ "stacks-desktop-icon": DesktopIcon
30
+ }
31
+ }
32
+
33
+ export default DesktopIcon