@stacksjs/stx 0.2.118 → 0.2.120
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.
- package/dist/builtins/attrs.d.ts +16 -0
- package/dist/builtins/attrs.js +16 -0
- package/dist/builtins/safe-image.js +2 -9
- package/dist/builtins/stx-image.js +2 -9
- package/dist/builtins/stx-link.js +2 -9
- package/dist/cli.js +1869 -824
- package/dist/client-script-bundler.d.ts +0 -11
- package/dist/client-script-bundler.js +26 -4
- package/dist/client-script.d.ts +24 -0
- package/dist/client-script.js +59 -5
- package/dist/component-registry.d.ts +1 -0
- package/dist/component-renderer.js +13 -5
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-scroll-lock.d.ts +13 -0
- package/dist/composables/use-scroll-lock.js +55 -0
- package/dist/composables/use-timer.d.ts +1 -1
- package/dist/composables/use-timer.js +13 -3
- package/dist/composition-api.d.ts +1 -1
- package/dist/composition-api.js +13 -4
- package/dist/craft-bridge.d.ts +80 -1
- package/dist/craft-bridge.js +80 -1
- package/dist/craft-components.d.ts +77 -3
- package/dist/craft-components.js +138 -9
- package/dist/craft.js +481 -73
- package/dist/dev-server/crosswind.d.ts +15 -1
- package/dist/dev-server/crosswind.js +12 -3
- package/dist/dev-server/serve-app.js +3 -3
- package/dist/document-shell.d.ts +17 -0
- package/dist/document-shell.js +72 -2
- package/dist/expressions.js +14 -7
- package/dist/head.d.ts +8 -0
- package/dist/head.js +11 -8
- package/dist/html-masking.d.ts +12 -0
- package/dist/html-masking.js +50 -15
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/process.js +11 -3
- package/dist/pwa.js +1172 -431
- package/dist/runtime-globals.d.ts +7 -4
- package/dist/runtime-globals.js +10 -2
- package/dist/runtime-injection.js +15 -1
- package/dist/signal-processing.js +19 -28
- package/dist/signals-api.d.ts +2 -0
- package/dist/signals-api.js +9 -0
- package/dist/signals.js +802 -62
- package/dist/ssg.js +1161 -420
- package/dist/state-management.d.ts +1 -1
- package/dist/state-management.js +1 -1
- package/dist/strict-lint.d.ts +1 -1
- package/dist/strict-lint.js +1 -1
- package/dist/stx.d.ts +6 -0
- package/dist/style-scoping.js +10 -0
- package/dist/utils.js +5 -3
- package/dist/variable-extractor.js +14 -22
- package/dist/vue-template.js +3 -2
- package/dist/x-element.d.ts +2 -2
- package/dist/x-element.js +9 -8
- package/package.json +5 -5
- package/stx.d.ts +6 -0
package/dist/craft.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var A=import.meta.require;var kX=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -160,6 +160,12 @@ else if (data.type === 'event' && data.method) {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
// Live component handles, keyed by id, so an event coming back from the host
|
|
164
|
+
// can be routed to the callbacks registered on the right one. Without this
|
|
165
|
+
// the onSelect/onSpaceChange callbacks were stored and never invoked.
|
|
166
|
+
const sidebars = new Map();
|
|
167
|
+
const spacesSidebars = new Map();
|
|
168
|
+
|
|
163
169
|
function createNativeUIFacade() {
|
|
164
170
|
class Sidebar {
|
|
165
171
|
constructor(id) {
|
|
@@ -179,10 +185,42 @@ else if (data.type === 'event' && data.method) {
|
|
|
179
185
|
return this;
|
|
180
186
|
}
|
|
181
187
|
destroy() {
|
|
188
|
+
sidebars.delete(this.id);
|
|
182
189
|
sendNativeUI('destroyComponent', { id: this.id, type: 'sidebar' });
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
|
|
193
|
+
/**
|
|
194
|
+
* An Arc-style sidebar of swipeable spaces.
|
|
195
|
+
*
|
|
196
|
+
* Separate from Sidebar rather than an option on it: a source list selects
|
|
197
|
+
* one row out of many, while a spaces sidebar selects one whole SCENE, and
|
|
198
|
+
* a host that renders the switcher natively (a segmented control in the
|
|
199
|
+
* toolbar, a Touch Bar strip) needs the space list, not the item list.
|
|
200
|
+
*/
|
|
201
|
+
class SpacesSidebar {
|
|
202
|
+
constructor(id) {
|
|
203
|
+
this.id = id;
|
|
204
|
+
this._spaceCallbacks = [];
|
|
205
|
+
}
|
|
206
|
+
setSpaces(spaces) {
|
|
207
|
+
sendNativeUI('setSidebarSpaces', { sidebarId: this.id, spaces });
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
setActiveSpace(spaceId) {
|
|
211
|
+
sendNativeUI('setActiveSpace', { sidebarId: this.id, spaceId });
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
onSpaceChange(callback) {
|
|
215
|
+
this._spaceCallbacks.push(callback);
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
destroy() {
|
|
219
|
+
spacesSidebars.delete(this.id);
|
|
220
|
+
sendNativeUI('destroyComponent', { id: this.id, type: 'spacesSidebar' });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
186
224
|
class FileBrowser {
|
|
187
225
|
constructor(id) {
|
|
188
226
|
this.id = id;
|
|
@@ -219,12 +257,33 @@ else if (data.type === 'event' && data.method) {
|
|
|
219
257
|
}
|
|
220
258
|
}
|
|
221
259
|
|
|
260
|
+
// Host -> page. The host names the component in the payload; we look up the
|
|
261
|
+
// handle and fan out to whatever the page registered on it.
|
|
262
|
+
on('sidebar.select', function(params) {
|
|
263
|
+
const sidebar = sidebars.get(params && params.sidebarId);
|
|
264
|
+
if (sidebar) sidebar._selectCallbacks.forEach(fn => fn(params.itemId));
|
|
265
|
+
});
|
|
266
|
+
on('sidebar.spaceChange', function(params) {
|
|
267
|
+
const sidebar = spacesSidebars.get(params && params.sidebarId);
|
|
268
|
+
if (sidebar) sidebar._spaceCallbacks.forEach(fn => fn(params.spaceId));
|
|
269
|
+
});
|
|
270
|
+
|
|
222
271
|
return {
|
|
223
272
|
createSidebar(options) {
|
|
224
273
|
const opts = options || {};
|
|
225
274
|
const id = opts.id || 'sidebar-' + Date.now() + '-' + Math.random().toString(36).slice(2);
|
|
226
275
|
sendNativeUI('createSidebar', Object.assign({}, opts, { id }));
|
|
227
|
-
|
|
276
|
+
const sidebar = new Sidebar(id);
|
|
277
|
+
sidebars.set(id, sidebar);
|
|
278
|
+
return sidebar;
|
|
279
|
+
},
|
|
280
|
+
createSpacesSidebar(options) {
|
|
281
|
+
const opts = options || {};
|
|
282
|
+
const id = opts.id || 'spaces-' + Date.now() + '-' + Math.random().toString(36).slice(2);
|
|
283
|
+
sendNativeUI('createSpacesSidebar', Object.assign({}, opts, { id }));
|
|
284
|
+
const sidebar = new SpacesSidebar(id);
|
|
285
|
+
spacesSidebars.set(id, sidebar);
|
|
286
|
+
return sidebar;
|
|
228
287
|
},
|
|
229
288
|
createFileBrowser(options) {
|
|
230
289
|
const opts = options || {};
|
|
@@ -373,6 +432,26 @@ else if (data.type === 'event' && data.method) {
|
|
|
373
432
|
platform: () => request('process.platform'),
|
|
374
433
|
},
|
|
375
434
|
|
|
435
|
+
// Gesture stream
|
|
436
|
+
//
|
|
437
|
+
// A webview's wheel events carry no phase information, so a page can only
|
|
438
|
+
// guess where a trackpad swipe begins and ends \u2014 typically with an idle
|
|
439
|
+
// timeout, which mistimes the release and cannot see momentum at all. The
|
|
440
|
+
// host holds the real NSEvent, so it forwards the phases instead:
|
|
441
|
+
//
|
|
442
|
+
// { axis: 'horizontal' | 'vertical',
|
|
443
|
+
// phase: 'begin' | 'change' | 'end',
|
|
444
|
+
// deltaX, deltaY, // points since the last event
|
|
445
|
+
// velocityX, velocityY, // points per second, at 'end'
|
|
446
|
+
// momentum: boolean } // the OS is coasting, not the finger
|
|
447
|
+
//
|
|
448
|
+
// Consumers must stay correct when nothing ever arrives: a host without
|
|
449
|
+
// gesture support simply never emits, so keep the wheel path bound and let
|
|
450
|
+
// a begin phase take over from it.
|
|
451
|
+
gestures: {
|
|
452
|
+
onSwipe: (callback) => on('gesture.swipe', callback),
|
|
453
|
+
},
|
|
454
|
+
|
|
376
455
|
// Native component helpers
|
|
377
456
|
nativeUI,
|
|
378
457
|
components: componentAPI
|
|
@@ -547,6 +626,12 @@ else if (data.type === 'event' && data.method) {
|
|
|
547
626
|
});
|
|
548
627
|
}
|
|
549
628
|
|
|
629
|
+
// Live component handles, keyed by id, so an event coming back from the host
|
|
630
|
+
// can be routed to the callbacks registered on the right one. Without this
|
|
631
|
+
// the onSelect/onSpaceChange callbacks were stored and never invoked.
|
|
632
|
+
const sidebars = new Map();
|
|
633
|
+
const spacesSidebars = new Map();
|
|
634
|
+
|
|
550
635
|
function createNativeUIFacade() {
|
|
551
636
|
class Sidebar {
|
|
552
637
|
constructor(id) {
|
|
@@ -566,10 +651,42 @@ else if (data.type === 'event' && data.method) {
|
|
|
566
651
|
return this;
|
|
567
652
|
}
|
|
568
653
|
destroy() {
|
|
654
|
+
sidebars.delete(this.id);
|
|
569
655
|
sendNativeUI('destroyComponent', { id: this.id, type: 'sidebar' });
|
|
570
656
|
}
|
|
571
657
|
}
|
|
572
658
|
|
|
659
|
+
/**
|
|
660
|
+
* An Arc-style sidebar of swipeable spaces.
|
|
661
|
+
*
|
|
662
|
+
* Separate from Sidebar rather than an option on it: a source list selects
|
|
663
|
+
* one row out of many, while a spaces sidebar selects one whole SCENE, and
|
|
664
|
+
* a host that renders the switcher natively (a segmented control in the
|
|
665
|
+
* toolbar, a Touch Bar strip) needs the space list, not the item list.
|
|
666
|
+
*/
|
|
667
|
+
class SpacesSidebar {
|
|
668
|
+
constructor(id) {
|
|
669
|
+
this.id = id;
|
|
670
|
+
this._spaceCallbacks = [];
|
|
671
|
+
}
|
|
672
|
+
setSpaces(spaces) {
|
|
673
|
+
sendNativeUI('setSidebarSpaces', { sidebarId: this.id, spaces });
|
|
674
|
+
return this;
|
|
675
|
+
}
|
|
676
|
+
setActiveSpace(spaceId) {
|
|
677
|
+
sendNativeUI('setActiveSpace', { sidebarId: this.id, spaceId });
|
|
678
|
+
return this;
|
|
679
|
+
}
|
|
680
|
+
onSpaceChange(callback) {
|
|
681
|
+
this._spaceCallbacks.push(callback);
|
|
682
|
+
return this;
|
|
683
|
+
}
|
|
684
|
+
destroy() {
|
|
685
|
+
spacesSidebars.delete(this.id);
|
|
686
|
+
sendNativeUI('destroyComponent', { id: this.id, type: 'spacesSidebar' });
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
573
690
|
class FileBrowser {
|
|
574
691
|
constructor(id) {
|
|
575
692
|
this.id = id;
|
|
@@ -606,12 +723,33 @@ else if (data.type === 'event' && data.method) {
|
|
|
606
723
|
}
|
|
607
724
|
}
|
|
608
725
|
|
|
726
|
+
// Host -> page. The host names the component in the payload; we look up the
|
|
727
|
+
// handle and fan out to whatever the page registered on it.
|
|
728
|
+
on('sidebar.select', function(params) {
|
|
729
|
+
const sidebar = sidebars.get(params && params.sidebarId);
|
|
730
|
+
if (sidebar) sidebar._selectCallbacks.forEach(fn => fn(params.itemId));
|
|
731
|
+
});
|
|
732
|
+
on('sidebar.spaceChange', function(params) {
|
|
733
|
+
const sidebar = spacesSidebars.get(params && params.sidebarId);
|
|
734
|
+
if (sidebar) sidebar._spaceCallbacks.forEach(fn => fn(params.spaceId));
|
|
735
|
+
});
|
|
736
|
+
|
|
609
737
|
return {
|
|
610
738
|
createSidebar(options) {
|
|
611
739
|
const opts = options || {};
|
|
612
740
|
const id = opts.id || 'sidebar-' + Date.now() + '-' + Math.random().toString(36).slice(2);
|
|
613
741
|
sendNativeUI('createSidebar', Object.assign({}, opts, { id }));
|
|
614
|
-
|
|
742
|
+
const sidebar = new Sidebar(id);
|
|
743
|
+
sidebars.set(id, sidebar);
|
|
744
|
+
return sidebar;
|
|
745
|
+
},
|
|
746
|
+
createSpacesSidebar(options) {
|
|
747
|
+
const opts = options || {};
|
|
748
|
+
const id = opts.id || 'spaces-' + Date.now() + '-' + Math.random().toString(36).slice(2);
|
|
749
|
+
sendNativeUI('createSpacesSidebar', Object.assign({}, opts, { id }));
|
|
750
|
+
const sidebar = new SpacesSidebar(id);
|
|
751
|
+
spacesSidebars.set(id, sidebar);
|
|
752
|
+
return sidebar;
|
|
615
753
|
},
|
|
616
754
|
createFileBrowser(options) {
|
|
617
755
|
const opts = options || {};
|
|
@@ -760,6 +898,26 @@ else if (data.type === 'event' && data.method) {
|
|
|
760
898
|
platform: () => request('process.platform'),
|
|
761
899
|
},
|
|
762
900
|
|
|
901
|
+
// Gesture stream
|
|
902
|
+
//
|
|
903
|
+
// A webview's wheel events carry no phase information, so a page can only
|
|
904
|
+
// guess where a trackpad swipe begins and ends \u2014 typically with an idle
|
|
905
|
+
// timeout, which mistimes the release and cannot see momentum at all. The
|
|
906
|
+
// host holds the real NSEvent, so it forwards the phases instead:
|
|
907
|
+
//
|
|
908
|
+
// { axis: 'horizontal' | 'vertical',
|
|
909
|
+
// phase: 'begin' | 'change' | 'end',
|
|
910
|
+
// deltaX, deltaY, // points since the last event
|
|
911
|
+
// velocityX, velocityY, // points per second, at 'end'
|
|
912
|
+
// momentum: boolean } // the OS is coasting, not the finger
|
|
913
|
+
//
|
|
914
|
+
// Consumers must stay correct when nothing ever arrives: a host without
|
|
915
|
+
// gesture support simply never emits, so keep the wheel path bound and let
|
|
916
|
+
// a begin phase take over from it.
|
|
917
|
+
gestures: {
|
|
918
|
+
onSwipe: (callback) => on('gesture.swipe', callback),
|
|
919
|
+
},
|
|
920
|
+
|
|
763
921
|
// Native component helpers
|
|
764
922
|
nativeUI,
|
|
765
923
|
components: componentAPI
|
|
@@ -773,17 +931,17 @@ else if (data.type === 'event' && data.method) {
|
|
|
773
931
|
}
|
|
774
932
|
})();
|
|
775
933
|
</script>
|
|
776
|
-
`.replace("debug: false,",`debug: ${X},`).replace("timeout: 30000",`timeout: ${$}`)}function
|
|
934
|
+
`.replace("debug: false,",`debug: ${X},`).replace("timeout: 30000",`timeout: ${$}`)}function TX(){return!1}function bX(U,X={}){let $=/@craft(?:\(([\s\S]*?)\))?/g;return U.replace($,(q,J)=>{let Y={};if(J)try{Y=JSON.parse(J.replace(/'/g,'"'))}catch{try{Y=Function(`return ${J}`)()}catch{console.warn(`[stx] Invalid @craft config: ${J}`)}}return h(Y)})}function m(U,X={}){if(U.includes("__craftBridgeInitialized"))return U;let $=h(X);if(U.includes("</head>"))return U.replace("</head>",`${$}
|
|
777
935
|
</head>`);if(U.includes("<body"))return U.replace(/(<body[^>]*>)/,`$1
|
|
778
|
-
${$}`);return $+U}var ZU=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function kX(U,X={}){let $=performance.now(),q={target:X.target||"universal",format:X.format||"zig",optimize:X.optimize??!0,treeShake:X.treeShake??!0,hotReload:X.hotReload??!1,debug:X.debug??!1,sourceMaps:X.sourceMaps??!1,bundle:X.bundle??!0,minify:X.minify??!1,components:X.components||ZU},Y=typeof U==="string"?_U(U):U,J=FU(Y.tree,q),K=HU(J),G=q.treeShake?IU(J,K):J,Q=new Map;if(q.target==="universal"){let L=["macos","windows","linux","ios","android"];for(let O of L){let B=C(G,{...q,target:O});Q.set(O,B)}}else{let L=C(G,q);Q.set(q.target,L)}let W=jU(G,q,Q),_=kU(Y,G,q),w={compilationTime:performance.now()-$,totalComponents:N(Y.tree),nativeComponents:v(G),webComponents:N(Y.tree)-v(G),bundleSize:W.length,treeShakenSize:q.treeShake?MU(J,G):W.length,warnings:[],errors:[]},F;if(q.sourceMaps)F=bU(Y,G);return{code:W,platformCode:Q,dependencies:K,manifest:_,sourceMaps:F,stats:w}}function _U(U){let X={type:"fragment",children:[]},$=U.match(/<body[^>]*>([\s\S]*?)<\/body>/i),q=$?$[1]:U;return l(q,X),{id:p(),hash:a(U),tree:X,scripts:PU(U),styles:DU(U),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:U.includes("{{"),hasEventHandlers:U.includes("onclick")||U.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:U.length}}}function l(U,X){let $=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,q;while((q=$.exec(U))!==null){let[,Y,J,K]=q,G=Y.startsWith("@craft-"),Q={type:G?"component":"element",tag:G?Y.slice(1):Y,props:wU(J),children:[],componentName:G?Y.slice(1):void 0};if(K){let W=K.replace(/<[^>]+>/g,"").trim();if(W)Q.children=Q.children??[],Q.children.push({type:"text",text:W});l(K,Q)}X.children=X.children??[],X.children.push(Q)}}function wU(U){let X={},$=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,q;while((q=$.exec(U))!==null){let[,Y,J]=q;X[Y]=J??!0}return X}function FU(U,X){return s(U,X)}function s(U,X){let $=U.componentName?X.components?.get(U.componentName):void 0,q="craft.View";if($)q=$.zigType;else if(U.type==="text")q="craft.Text";else if(U.tag)q=LU(U.tag);let Y={};if(U.props)for(let[Q,W]of Object.entries(U.props))Y[Q]=BU(W);let J=[];if(U.children)for(let Q of U.children)J.push(s(Q,X));let K=new Map;if(U.props){for(let[Q,W]of Object.entries(U.props))if(Q.startsWith("on")&&typeof W==="string")K.set(Q.slice(2).toLowerCase(),W)}let G=EU(U);return{type:OU(U,$),zigType:q,props:Y,children:J,events:K,styles:G,id:U.hydrationKey,key:U.props?.key}}function LU(U){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[U.toLowerCase()]||"craft.View"}function BU(U){if(typeof U==="string"){if(U.startsWith("{{")&&U.endsWith("}}"))return{type:"binding",path:U.slice(2,-2).trim()};if(U.includes("(")&&U.includes(")"))return{type:"callback",handler:U};return{type:"literal",value:U}}if(typeof U==="number"||typeof U==="boolean")return{type:"literal",value:U};return{type:"literal",value:String(U)}}function OU(U,X){if(X){let q=X.name.toLowerCase();if(q.includes("button"))return"button";if(q.includes("input")||q.includes("text"))return"input";if(q.includes("image")||q.includes("avatar"))return"image";if(q.includes("list")||q.includes("table"))return"list";if(q.includes("scroll"))return"scroll";return"custom"}if(U.type==="text")return"text";let $=U.tag?.toLowerCase();if($==="button")return"button";if($==="input"||$==="textarea")return"input";if($==="img")return"image";if($==="ul"||$==="ol")return"list";return"view"}function EU(U){let X=U.props?.style,$={},q={};if(X){let Y=X.split(";").filter(Boolean);for(let J of Y){let[K,G]=J.split(":").map((Q)=>Q.trim());if(!K||!G)continue;switch(K){case"display":$.display=G;break;case"flex-direction":$.flexDirection=G;break;case"justify-content":$.justifyContent=VU(G);break;case"align-items":$.alignItems=AU(G);break;case"gap":$.gap=Number.parseInt(G,10);break;case"padding":$.padding=Number.parseInt(G,10);break;case"margin":$.margin=Number.parseInt(G,10);break;case"width":$.width=G==="auto"?"auto":Number.parseInt(G,10);break;case"height":$.height=G==="auto"?"auto":Number.parseInt(G,10);break;case"background-color":case"background":q.backgroundColor=G;break;case"border-color":q.borderColor=G;break;case"border-width":q.borderWidth=Number.parseInt(G,10);break;case"border-radius":q.borderRadius=Number.parseInt(G,10);break;case"opacity":q.opacity=Number.parseFloat(G);break}}}return{layout:$,appearance:q}}function VU(U){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[U]||"start"}function AU(U){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[U]||"start"}function HU(U){let X=[],$=new Set;function q(Y,J){let K=Y.id||p();if($.has(K))return;$.add(K);let G={id:K,type:"component",path:Y.zigType,dependencies:J?[J]:[],size:c(Y),isStatic:RU(Y)};X.push(G);for(let Q of Y.children)q(Q,K)}return q(U),X}function c(U){let X=100;return X+=Object.keys(U.props).length*20,X+=U.events.size*50,X}function RU(U){for(let X of Object.values(U.props))if(X.type!=="literal")return!1;return U.events.size===0}function IU(U,X){return U}function MU(U,X){let $=0;function q(Y){$+=c(Y);for(let J of Y.children)q(J)}return q(X),$}function C(U,X){switch(X.format){case"zig":return d(U,X);case"typescript":return zU(U,X);case"json":return JSON.stringify(U,null,X.minify?0:2);default:return d(U,X)}}function d(U,X){let $=[];return $.push("// Auto-generated by stx compiler"),$.push("// Target: "+X.target),$.push(""),$.push('const std = @import("std");'),$.push('const craft = @import("craft");'),$.push(""),$.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),$.push(" return try build(allocator);"),$.push("}"),$.push(""),i(U,$,0),$.join(`
|
|
779
|
-
`)}function i(U,X,$){let q=" ".repeat($);if($===0)X.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let
|
|
780
|
-
`)}function r(U,X){let $=" ".repeat(X),q=[];for(let[G,Q]of Object.entries(U.props))if(Q.type==="literal"){let W=typeof Q.value==="string"?`"${Q.value}"`:String(Q.value);q.push(`${G}: ${W}`)}let
|
|
781
|
-
${$} [${
|
|
782
|
-
${$} `)}]`:"";return`Craft.create("${U.zigType}", ${
|
|
783
|
-
`)}return $.get(X.target)||
|
|
936
|
+
${$}`);return $+U}var wU=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function PX(U,X={}){let $=performance.now(),q={target:X.target||"universal",format:X.format||"zig",optimize:X.optimize??!0,treeShake:X.treeShake??!0,hotReload:X.hotReload??!1,debug:X.debug??!1,sourceMaps:X.sourceMaps??!1,bundle:X.bundle??!0,minify:X.minify??!1,components:X.components||wU},J=typeof U==="string"?LU(U):U,Y=BU(J.tree,q),K=IU(Y),G=q.treeShake?zU(Y,K):Y,Q=new Map;if(q.target==="universal"){let L=["macos","windows","linux","ios","android"];for(let O of L){let B=N(G,{...q,target:O});Q.set(O,B)}}else{let L=N(G,q);Q.set(q.target,L)}let W=TU(G,q,Q),_=bU(J,G,q),w={compilationTime:performance.now()-$,totalComponents:v(J.tree),nativeComponents:u(G),webComponents:v(J.tree)-u(G),bundleSize:W.length,treeShakenSize:q.treeShake?jU(Y,G):W.length,warnings:[],errors:[]},F;if(q.sourceMaps)F=xU(J,G);return{code:W,platformCode:Q,dependencies:K,manifest:_,sourceMaps:F,stats:w}}function LU(U){let X={type:"fragment",children:[]},$=U.match(/<body[^>]*>([\s\S]*?)<\/body>/i),q=$?$[1]:U;return l(q,X),{id:p(),hash:n(U),tree:X,scripts:CU(U),styles:yU(U),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:U.includes("{{"),hasEventHandlers:U.includes("onclick")||U.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:U.length}}}function l(U,X){let $=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,q;while((q=$.exec(U))!==null){let[,J,Y,K]=q,G=J.startsWith("@craft-"),Q={type:G?"component":"element",tag:G?J.slice(1):J,props:FU(Y),children:[],componentName:G?J.slice(1):void 0};if(K){let W=K.replace(/<[^>]+>/g,"").trim();if(W)Q.children=Q.children??[],Q.children.push({type:"text",text:W});l(K,Q)}X.children=X.children??[],X.children.push(Q)}}function FU(U){let X={},$=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,q;while((q=$.exec(U))!==null){let[,J,Y]=q;X[J]=Y??!0}return X}function BU(U,X){return s(U,X)}function s(U,X){let $=U.componentName?X.components?.get(U.componentName):void 0,q="craft.View";if($)q=$.zigType;else if(U.type==="text")q="craft.Text";else if(U.tag)q=OU(U.tag);let J={};if(U.props)for(let[Q,W]of Object.entries(U.props))J[Q]=EU(W);let Y=[];if(U.children)for(let Q of U.children)Y.push(s(Q,X));let K=new Map;if(U.props){for(let[Q,W]of Object.entries(U.props))if(Q.startsWith("on")&&typeof W==="string")K.set(Q.slice(2).toLowerCase(),W)}let G=AU(U);return{type:VU(U,$),zigType:q,props:J,children:Y,events:K,styles:G,id:U.hydrationKey,key:U.props?.key}}function OU(U){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[U.toLowerCase()]||"craft.View"}function EU(U){if(typeof U==="string"){if(U.startsWith("{{")&&U.endsWith("}}"))return{type:"binding",path:U.slice(2,-2).trim()};if(U.includes("(")&&U.includes(")"))return{type:"callback",handler:U};return{type:"literal",value:U}}if(typeof U==="number"||typeof U==="boolean")return{type:"literal",value:U};return{type:"literal",value:String(U)}}function VU(U,X){if(X){let q=X.name.toLowerCase();if(q.includes("button"))return"button";if(q.includes("input")||q.includes("text"))return"input";if(q.includes("image")||q.includes("avatar"))return"image";if(q.includes("list")||q.includes("table"))return"list";if(q.includes("scroll"))return"scroll";return"custom"}if(U.type==="text")return"text";let $=U.tag?.toLowerCase();if($==="button")return"button";if($==="input"||$==="textarea")return"input";if($==="img")return"image";if($==="ul"||$==="ol")return"list";return"view"}function AU(U){let X=U.props?.style,$={},q={};if(X){let J=X.split(";").filter(Boolean);for(let Y of J){let[K,G]=Y.split(":").map((Q)=>Q.trim());if(!K||!G)continue;switch(K){case"display":$.display=G;break;case"flex-direction":$.flexDirection=G;break;case"justify-content":$.justifyContent=HU(G);break;case"align-items":$.alignItems=RU(G);break;case"gap":$.gap=Number.parseInt(G,10);break;case"padding":$.padding=Number.parseInt(G,10);break;case"margin":$.margin=Number.parseInt(G,10);break;case"width":$.width=G==="auto"?"auto":Number.parseInt(G,10);break;case"height":$.height=G==="auto"?"auto":Number.parseInt(G,10);break;case"background-color":case"background":q.backgroundColor=G;break;case"border-color":q.borderColor=G;break;case"border-width":q.borderWidth=Number.parseInt(G,10);break;case"border-radius":q.borderRadius=Number.parseInt(G,10);break;case"opacity":q.opacity=Number.parseFloat(G);break}}}return{layout:$,appearance:q}}function HU(U){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[U]||"start"}function RU(U){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[U]||"start"}function IU(U){let X=[],$=new Set;function q(J,Y){let K=J.id||p();if($.has(K))return;$.add(K);let G={id:K,type:"component",path:J.zigType,dependencies:Y?[Y]:[],size:c(J),isStatic:MU(J)};X.push(G);for(let Q of J.children)q(Q,K)}return q(U),X}function c(U){let X=100;return X+=Object.keys(U.props).length*20,X+=U.events.size*50,X}function MU(U){for(let X of Object.values(U.props))if(X.type!=="literal")return!1;return U.events.size===0}function zU(U,X){return U}function jU(U,X){let $=0;function q(J){$+=c(J);for(let Y of J.children)q(Y)}return q(X),$}function N(U,X){switch(X.format){case"zig":return d(U,X);case"typescript":return kU(U,X);case"json":return JSON.stringify(U,null,X.minify?0:2);default:return d(U,X)}}function d(U,X){let $=[];return $.push("// Auto-generated by stx compiler"),$.push("// Target: "+X.target),$.push(""),$.push('const std = @import("std");'),$.push('const craft = @import("craft");'),$.push(""),$.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),$.push(" return try build(allocator);"),$.push("}"),$.push(""),i(U,$,0),$.join(`
|
|
937
|
+
`)}function i(U,X,$){let q=" ".repeat($);if($===0)X.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let J=`node_${$}`;X.push(`${q} var ${J} = try ${U.zigType}.init(allocator);`);for(let[Y,K]of Object.entries(U.props))if(K.type==="literal"){let G=typeof K.value==="string"?`"${K.value}"`:String(K.value);X.push(`${q} ${J}.set${DU(Y)}(${G});`)}for(let Y=0;Y<U.children.length;Y++){let K=U.children[Y];if(K.type==="text"){let G=K.props.text?.type==="literal"?String(K.props.text.value):"";X.push(`${q} try ${J}.addChild(try craft.Text.init(allocator, "${G}"));`)}else i(K,X,$+1),X.push(`${q} try ${J}.addChild(node_${$+1});`)}if($===0)X.push(` return ${J}.element();`),X.push("}")}function kU(U,X){let $=[];return $.push("// Auto-generated by stx compiler"),$.push("// Target: "+X.target),$.push(""),$.push('import { Craft } from "@stacksjs/craft";'),$.push(""),$.push("export function render(): Craft.Element {"),$.push(" return "+r(U,1)+";"),$.push("}"),$.join(`
|
|
938
|
+
`)}function r(U,X){let $=" ".repeat(X),q=[];for(let[G,Q]of Object.entries(U.props))if(Q.type==="literal"){let W=typeof Q.value==="string"?`"${Q.value}"`:String(Q.value);q.push(`${G}: ${W}`)}let J=q.length>0?`{ ${q.join(", ")} }`:"{}",Y=U.children.map((G)=>G.type==="text"?`"${G.props.text?.type==="literal"?G.props.text.value:""}"`:r(G,X+1)),K=Y.length>0?`,
|
|
939
|
+
${$} [${Y.join(`,
|
|
940
|
+
${$} `)}]`:"";return`Craft.create("${U.zigType}", ${J}${K})`}function TU(U,X,$){if(X.target==="universal"){let q=[];q.push("// Universal entry point"),q.push("");for(let[J,Y]of $)q.push(`// --- ${J.toUpperCase()} ---`),q.push(`#if ${J.toUpperCase()}`),q.push(Y),q.push("#endif"),q.push("");return q.join(`
|
|
941
|
+
`)}return $.get(X.target)||N(U,X)}function bU(U,X,$){let q=[];function J(Y){q.push({name:Y.zigType,hash:n(JSON.stringify(Y.props)),props:Object.keys(Y.props),events:Array.from(Y.events.keys()),slots:[],isNative:Y.zigType.startsWith("craft.")});for(let K of Y.children)J(K)}return J(X),{version:"1.0.0",components:q,entry:U.id,assets:[],styles:U.styles}}function xU(U,X){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var PU=0;function p(){return`id_${++PU}`}function n(U){let X=0;for(let $=0;$<U.length;$++){let q=U.charCodeAt($);X=(X<<5)-X+q,X=X&X}return Math.abs(X).toString(36)}function DU(U){return U.charAt(0).toUpperCase()+U.slice(1)}function CU(U){let X=[],$=/<script[^>]*>([\s\S]*?)<\/script>/gi,q;while((q=$.exec(U))!==null)X.push(q[1]);return X}function yU(U){let X=[],$=/<style[^>]*>([\s\S]*?)<\/style>/gi,q;while((q=$.exec(U))!==null)X.push(q[1]);return X}function v(U){let X=U.type==="component"?1:0;if(U.children)for(let $ of U.children)X+=v($);return X}function u(U){let X=U.zigType.startsWith("craft.")?1:0;for(let $ of U.children)X+=u($);return X}function DX(U){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(X)=>{console.log(`[craft-compiler] File changed: ${X}`)}}}var g={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(U,X)=>{let $=U.checked?"checked":"",q=U.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
784
942
|
<input type="checkbox" class="craft-checkbox" ${$} ${q}>
|
|
785
943
|
<span class="craft-checkbox-label">${X||U.label||""}</span>
|
|
786
|
-
</label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(U,X)=>{let $=U.min??0,q=U.max??100,
|
|
944
|
+
</label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(U,X)=>{let $=U.min??0,q=U.max??100,J=U.step??1,Y=U.value??50,K=U.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${$}" max="${q}" step="${J}" value="${Y}" ${K}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(U,X)=>{let $=U.size||40,q=U.src,J=String(U.alt||""),Y=U.fallback||(J?J.charAt(0).toUpperCase():"?");if(q)return`<img class="craft-avatar" src="${q}" alt="${J}" style="width:${$}px;height:${$}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${$}px;height:${$}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${Y}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(U,X)=>{let $=Number(U.value)||0,q=Number(U.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,$/q*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(U,X)=>{let $=U.size||24;return`<div class="craft-spinner" style="width:${$}px;height:${$}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(U,X)=>{let $=U.open?"open":"",q=U.title||"";return`<dialog class="craft-modal" ${$}>
|
|
787
945
|
<div class="craft-modal-content">
|
|
788
946
|
${q?`<div class="craft-modal-header"><h2>${q}</h2></div>`:""}
|
|
789
947
|
<div class="craft-modal-body">${X}</div>
|
|
@@ -794,7 +952,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
794
952
|
</details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(U,X)=>{let $=U.variant||"info",q=U.title||"";return`<div class="craft-alert craft-alert-${$}" role="alert">
|
|
795
953
|
${q?`<div class="craft-alert-title">${q}</div>`:""}
|
|
796
954
|
<div class="craft-alert-content">${X}</div>
|
|
797
|
-
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(U,X)=>{let $=U.content||"",q=U.position||"top";return`<span class="craft-tooltip" data-tooltip="${$}" data-position="${q}">${X}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections"],render:SU},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:
|
|
955
|
+
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(U,X)=>{let $=U.content||"",q=U.position||"top";return`<span class="craft-tooltip" data-tooltip="${$}" data-position="${q}">${X}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:SU},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:NU},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:vU},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:uU},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(U,X)=>{return`<input type="color" class="craft-color-picker" value="${U.value||"#000000"}">`}},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(U,X)=>{let $=U.value||"",q=U.min||"",J=U.max||"";return`<input type="date" class="craft-date-picker" value="${$}" min="${q}" max="${J}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(U,X)=>{return`<input type="time" class="craft-time-picker" value="${U.value||""}">`}}},a=`
|
|
798
956
|
<style id="craft-component-styles">
|
|
799
957
|
/* Craft Component Base Styles */
|
|
800
958
|
.craft-button {
|
|
@@ -1132,6 +1290,48 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1132
1290
|
background: rgba(255, 255, 255, 0.24);
|
|
1133
1291
|
}
|
|
1134
1292
|
|
|
1293
|
+
/* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
|
|
1294
|
+
a native host, and deliberately not a second swipe implementation. */
|
|
1295
|
+
.craft-sidebar-spaces {
|
|
1296
|
+
position: relative;
|
|
1297
|
+
z-index: 1;
|
|
1298
|
+
flex: 1;
|
|
1299
|
+
min-height: 0;
|
|
1300
|
+
overflow-y: auto;
|
|
1301
|
+
}
|
|
1302
|
+
.craft-sidebar-space-title {
|
|
1303
|
+
padding: 10px 8px 4px;
|
|
1304
|
+
font-size: 13px;
|
|
1305
|
+
font-weight: 600;
|
|
1306
|
+
}
|
|
1307
|
+
.craft-sidebar-space-switcher {
|
|
1308
|
+
position: relative;
|
|
1309
|
+
z-index: 1;
|
|
1310
|
+
display: flex;
|
|
1311
|
+
align-items: center;
|
|
1312
|
+
gap: 1px;
|
|
1313
|
+
padding-top: 6px;
|
|
1314
|
+
}
|
|
1315
|
+
.craft-sidebar-space-tab {
|
|
1316
|
+
display: grid;
|
|
1317
|
+
place-items: center;
|
|
1318
|
+
width: 28px;
|
|
1319
|
+
height: 26px;
|
|
1320
|
+
border: 0;
|
|
1321
|
+
border-radius: 7px;
|
|
1322
|
+
background: transparent;
|
|
1323
|
+
color: inherit;
|
|
1324
|
+
font: inherit;
|
|
1325
|
+
font-size: 11px;
|
|
1326
|
+
font-weight: 700;
|
|
1327
|
+
opacity: 0.4;
|
|
1328
|
+
cursor: default;
|
|
1329
|
+
}
|
|
1330
|
+
.craft-sidebar-space-tab[data-selected="true"] {
|
|
1331
|
+
opacity: 1;
|
|
1332
|
+
background: rgba(255, 255, 255, 0.55);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1135
1335
|
.craft-code-editor {
|
|
1136
1336
|
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
1137
1337
|
font-size: 13px;
|
|
@@ -1170,7 +1370,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1170
1370
|
}
|
|
1171
1371
|
}
|
|
1172
1372
|
</style>
|
|
1173
|
-
`,
|
|
1373
|
+
`,yX=`
|
|
1174
1374
|
<script id="craft-component-runtime">
|
|
1175
1375
|
(function() {
|
|
1176
1376
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -1206,11 +1406,36 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1206
1406
|
var config = parseConfig(sidebar);
|
|
1207
1407
|
if (!config) return;
|
|
1208
1408
|
|
|
1409
|
+
var hasSpaces = !!(config.spaces && config.spaces.length);
|
|
1410
|
+
// Spaces need a host that can swipe between whole scenes. Falling back to
|
|
1411
|
+
// createSidebar would flatten every space into one list, which is worse
|
|
1412
|
+
// than the web rendering already on the page \u2014 so leave that in place.
|
|
1413
|
+
if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
|
|
1414
|
+
|
|
1209
1415
|
try {
|
|
1210
1416
|
var nativeConfig = Object.assign({}, config);
|
|
1211
1417
|
delete nativeConfig.sections;
|
|
1212
|
-
|
|
1213
|
-
|
|
1418
|
+
delete nativeConfig.spaces;
|
|
1419
|
+
|
|
1420
|
+
var nativeSidebar = hasSpaces
|
|
1421
|
+
? nativeUI.createSpacesSidebar(nativeConfig)
|
|
1422
|
+
: nativeUI.createSidebar(nativeConfig);
|
|
1423
|
+
|
|
1424
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
|
|
1425
|
+
nativeSidebar.setSpaces(config.spaces);
|
|
1426
|
+
}
|
|
1427
|
+
if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
|
|
1428
|
+
nativeSidebar.setActiveSpace(config.selectedSpace);
|
|
1429
|
+
}
|
|
1430
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
|
|
1431
|
+
nativeSidebar.onSpaceChange(function(spaceId) {
|
|
1432
|
+
sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
|
|
1433
|
+
bubbles: true,
|
|
1434
|
+
detail: { spaceId: spaceId, sidebarId: config.id }
|
|
1435
|
+
}));
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
if (nativeSidebar && !hasSpaces && config.sections) {
|
|
1214
1439
|
config.sections.forEach(function(section) {
|
|
1215
1440
|
if (nativeSidebar.addSection) nativeSidebar.addSection(section);
|
|
1216
1441
|
});
|
|
@@ -1249,7 +1474,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1249
1474
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1250
1475
|
})();
|
|
1251
1476
|
</script>
|
|
1252
|
-
`;function o(U,X={}){let{classPrefix:$="craft"}=X;if(!U.includes("craft-component-styles"))if(U.includes("</head>"))U=U.replace("</head>"
|
|
1477
|
+
`;function o(U,X={}){let{classPrefix:$="craft"}=X;if(!U.includes("craft-component-styles"))if(U.includes("</head>"))U=U.replace("</head>",`${`
|
|
1253
1478
|
<style id="craft-component-styles">
|
|
1254
1479
|
/* Craft Component Base Styles */
|
|
1255
1480
|
.craft-button {
|
|
@@ -1587,6 +1812,48 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1587
1812
|
background: rgba(255, 255, 255, 0.24);
|
|
1588
1813
|
}
|
|
1589
1814
|
|
|
1815
|
+
/* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
|
|
1816
|
+
a native host, and deliberately not a second swipe implementation. */
|
|
1817
|
+
.craft-sidebar-spaces {
|
|
1818
|
+
position: relative;
|
|
1819
|
+
z-index: 1;
|
|
1820
|
+
flex: 1;
|
|
1821
|
+
min-height: 0;
|
|
1822
|
+
overflow-y: auto;
|
|
1823
|
+
}
|
|
1824
|
+
.craft-sidebar-space-title {
|
|
1825
|
+
padding: 10px 8px 4px;
|
|
1826
|
+
font-size: 13px;
|
|
1827
|
+
font-weight: 600;
|
|
1828
|
+
}
|
|
1829
|
+
.craft-sidebar-space-switcher {
|
|
1830
|
+
position: relative;
|
|
1831
|
+
z-index: 1;
|
|
1832
|
+
display: flex;
|
|
1833
|
+
align-items: center;
|
|
1834
|
+
gap: 1px;
|
|
1835
|
+
padding-top: 6px;
|
|
1836
|
+
}
|
|
1837
|
+
.craft-sidebar-space-tab {
|
|
1838
|
+
display: grid;
|
|
1839
|
+
place-items: center;
|
|
1840
|
+
width: 28px;
|
|
1841
|
+
height: 26px;
|
|
1842
|
+
border: 0;
|
|
1843
|
+
border-radius: 7px;
|
|
1844
|
+
background: transparent;
|
|
1845
|
+
color: inherit;
|
|
1846
|
+
font: inherit;
|
|
1847
|
+
font-size: 11px;
|
|
1848
|
+
font-weight: 700;
|
|
1849
|
+
opacity: 0.4;
|
|
1850
|
+
cursor: default;
|
|
1851
|
+
}
|
|
1852
|
+
.craft-sidebar-space-tab[data-selected="true"] {
|
|
1853
|
+
opacity: 1;
|
|
1854
|
+
background: rgba(255, 255, 255, 0.55);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1590
1857
|
.craft-code-editor {
|
|
1591
1858
|
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
1592
1859
|
font-size: 13px;
|
|
@@ -1625,8 +1892,8 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1625
1892
|
}
|
|
1626
1893
|
}
|
|
1627
1894
|
</style>
|
|
1628
|
-
|
|
1629
|
-
</head>`);else if(U.includes("<style>"))U=U.replace("<style>"
|
|
1895
|
+
`}
|
|
1896
|
+
</head>`);else if(U.includes("<style>"))U=U.replace("<style>",`${`
|
|
1630
1897
|
<style id="craft-component-styles">
|
|
1631
1898
|
/* Craft Component Base Styles */
|
|
1632
1899
|
.craft-button {
|
|
@@ -1964,6 +2231,48 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
1964
2231
|
background: rgba(255, 255, 255, 0.24);
|
|
1965
2232
|
}
|
|
1966
2233
|
|
|
2234
|
+
/* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
|
|
2235
|
+
a native host, and deliberately not a second swipe implementation. */
|
|
2236
|
+
.craft-sidebar-spaces {
|
|
2237
|
+
position: relative;
|
|
2238
|
+
z-index: 1;
|
|
2239
|
+
flex: 1;
|
|
2240
|
+
min-height: 0;
|
|
2241
|
+
overflow-y: auto;
|
|
2242
|
+
}
|
|
2243
|
+
.craft-sidebar-space-title {
|
|
2244
|
+
padding: 10px 8px 4px;
|
|
2245
|
+
font-size: 13px;
|
|
2246
|
+
font-weight: 600;
|
|
2247
|
+
}
|
|
2248
|
+
.craft-sidebar-space-switcher {
|
|
2249
|
+
position: relative;
|
|
2250
|
+
z-index: 1;
|
|
2251
|
+
display: flex;
|
|
2252
|
+
align-items: center;
|
|
2253
|
+
gap: 1px;
|
|
2254
|
+
padding-top: 6px;
|
|
2255
|
+
}
|
|
2256
|
+
.craft-sidebar-space-tab {
|
|
2257
|
+
display: grid;
|
|
2258
|
+
place-items: center;
|
|
2259
|
+
width: 28px;
|
|
2260
|
+
height: 26px;
|
|
2261
|
+
border: 0;
|
|
2262
|
+
border-radius: 7px;
|
|
2263
|
+
background: transparent;
|
|
2264
|
+
color: inherit;
|
|
2265
|
+
font: inherit;
|
|
2266
|
+
font-size: 11px;
|
|
2267
|
+
font-weight: 700;
|
|
2268
|
+
opacity: 0.4;
|
|
2269
|
+
cursor: default;
|
|
2270
|
+
}
|
|
2271
|
+
.craft-sidebar-space-tab[data-selected="true"] {
|
|
2272
|
+
opacity: 1;
|
|
2273
|
+
background: rgba(255, 255, 255, 0.55);
|
|
2274
|
+
}
|
|
2275
|
+
|
|
1967
2276
|
.craft-code-editor {
|
|
1968
2277
|
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
1969
2278
|
font-size: 13px;
|
|
@@ -2002,7 +2311,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2002
2311
|
}
|
|
2003
2312
|
}
|
|
2004
2313
|
</style>
|
|
2005
|
-
|
|
2314
|
+
`}
|
|
2006
2315
|
<style>`);else U=`
|
|
2007
2316
|
<style id="craft-component-styles">
|
|
2008
2317
|
/* Craft Component Base Styles */
|
|
@@ -2341,6 +2650,48 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2341
2650
|
background: rgba(255, 255, 255, 0.24);
|
|
2342
2651
|
}
|
|
2343
2652
|
|
|
2653
|
+
/* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
|
|
2654
|
+
a native host, and deliberately not a second swipe implementation. */
|
|
2655
|
+
.craft-sidebar-spaces {
|
|
2656
|
+
position: relative;
|
|
2657
|
+
z-index: 1;
|
|
2658
|
+
flex: 1;
|
|
2659
|
+
min-height: 0;
|
|
2660
|
+
overflow-y: auto;
|
|
2661
|
+
}
|
|
2662
|
+
.craft-sidebar-space-title {
|
|
2663
|
+
padding: 10px 8px 4px;
|
|
2664
|
+
font-size: 13px;
|
|
2665
|
+
font-weight: 600;
|
|
2666
|
+
}
|
|
2667
|
+
.craft-sidebar-space-switcher {
|
|
2668
|
+
position: relative;
|
|
2669
|
+
z-index: 1;
|
|
2670
|
+
display: flex;
|
|
2671
|
+
align-items: center;
|
|
2672
|
+
gap: 1px;
|
|
2673
|
+
padding-top: 6px;
|
|
2674
|
+
}
|
|
2675
|
+
.craft-sidebar-space-tab {
|
|
2676
|
+
display: grid;
|
|
2677
|
+
place-items: center;
|
|
2678
|
+
width: 28px;
|
|
2679
|
+
height: 26px;
|
|
2680
|
+
border: 0;
|
|
2681
|
+
border-radius: 7px;
|
|
2682
|
+
background: transparent;
|
|
2683
|
+
color: inherit;
|
|
2684
|
+
font: inherit;
|
|
2685
|
+
font-size: 11px;
|
|
2686
|
+
font-weight: 700;
|
|
2687
|
+
opacity: 0.4;
|
|
2688
|
+
cursor: default;
|
|
2689
|
+
}
|
|
2690
|
+
.craft-sidebar-space-tab[data-selected="true"] {
|
|
2691
|
+
opacity: 1;
|
|
2692
|
+
background: rgba(255, 255, 255, 0.55);
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2344
2695
|
.craft-code-editor {
|
|
2345
2696
|
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
2346
2697
|
font-size: 13px;
|
|
@@ -2379,7 +2730,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2379
2730
|
}
|
|
2380
2731
|
}
|
|
2381
2732
|
</style>
|
|
2382
|
-
`+U;if(!U.includes("craft-component-runtime"))if(U.includes("</body>"))U=U.replace("</body>"
|
|
2733
|
+
`+U;if(!U.includes("craft-component-runtime"))if(U.includes("</body>"))U=U.replace("</body>",`${`
|
|
2383
2734
|
<script id="craft-component-runtime">
|
|
2384
2735
|
(function() {
|
|
2385
2736
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -2415,11 +2766,36 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2415
2766
|
var config = parseConfig(sidebar);
|
|
2416
2767
|
if (!config) return;
|
|
2417
2768
|
|
|
2769
|
+
var hasSpaces = !!(config.spaces && config.spaces.length);
|
|
2770
|
+
// Spaces need a host that can swipe between whole scenes. Falling back to
|
|
2771
|
+
// createSidebar would flatten every space into one list, which is worse
|
|
2772
|
+
// than the web rendering already on the page \u2014 so leave that in place.
|
|
2773
|
+
if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
|
|
2774
|
+
|
|
2418
2775
|
try {
|
|
2419
2776
|
var nativeConfig = Object.assign({}, config);
|
|
2420
2777
|
delete nativeConfig.sections;
|
|
2421
|
-
|
|
2422
|
-
|
|
2778
|
+
delete nativeConfig.spaces;
|
|
2779
|
+
|
|
2780
|
+
var nativeSidebar = hasSpaces
|
|
2781
|
+
? nativeUI.createSpacesSidebar(nativeConfig)
|
|
2782
|
+
: nativeUI.createSidebar(nativeConfig);
|
|
2783
|
+
|
|
2784
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
|
|
2785
|
+
nativeSidebar.setSpaces(config.spaces);
|
|
2786
|
+
}
|
|
2787
|
+
if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
|
|
2788
|
+
nativeSidebar.setActiveSpace(config.selectedSpace);
|
|
2789
|
+
}
|
|
2790
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
|
|
2791
|
+
nativeSidebar.onSpaceChange(function(spaceId) {
|
|
2792
|
+
sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
|
|
2793
|
+
bubbles: true,
|
|
2794
|
+
detail: { spaceId: spaceId, sidebarId: config.id }
|
|
2795
|
+
}));
|
|
2796
|
+
});
|
|
2797
|
+
}
|
|
2798
|
+
if (nativeSidebar && !hasSpaces && config.sections) {
|
|
2423
2799
|
config.sections.forEach(function(section) {
|
|
2424
2800
|
if (nativeSidebar.addSection) nativeSidebar.addSection(section);
|
|
2425
2801
|
});
|
|
@@ -2458,7 +2834,7 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2458
2834
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
2459
2835
|
})();
|
|
2460
2836
|
</script>
|
|
2461
|
-
|
|
2837
|
+
`}
|
|
2462
2838
|
</body>`);else U+=`
|
|
2463
2839
|
<script id="craft-component-runtime">
|
|
2464
2840
|
(function() {
|
|
@@ -2495,11 +2871,36 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2495
2871
|
var config = parseConfig(sidebar);
|
|
2496
2872
|
if (!config) return;
|
|
2497
2873
|
|
|
2874
|
+
var hasSpaces = !!(config.spaces && config.spaces.length);
|
|
2875
|
+
// Spaces need a host that can swipe between whole scenes. Falling back to
|
|
2876
|
+
// createSidebar would flatten every space into one list, which is worse
|
|
2877
|
+
// than the web rendering already on the page \u2014 so leave that in place.
|
|
2878
|
+
if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
|
|
2879
|
+
|
|
2498
2880
|
try {
|
|
2499
2881
|
var nativeConfig = Object.assign({}, config);
|
|
2500
2882
|
delete nativeConfig.sections;
|
|
2501
|
-
|
|
2502
|
-
|
|
2883
|
+
delete nativeConfig.spaces;
|
|
2884
|
+
|
|
2885
|
+
var nativeSidebar = hasSpaces
|
|
2886
|
+
? nativeUI.createSpacesSidebar(nativeConfig)
|
|
2887
|
+
: nativeUI.createSidebar(nativeConfig);
|
|
2888
|
+
|
|
2889
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
|
|
2890
|
+
nativeSidebar.setSpaces(config.spaces);
|
|
2891
|
+
}
|
|
2892
|
+
if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
|
|
2893
|
+
nativeSidebar.setActiveSpace(config.selectedSpace);
|
|
2894
|
+
}
|
|
2895
|
+
if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
|
|
2896
|
+
nativeSidebar.onSpaceChange(function(spaceId) {
|
|
2897
|
+
sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
|
|
2898
|
+
bubbles: true,
|
|
2899
|
+
detail: { spaceId: spaceId, sidebarId: config.id }
|
|
2900
|
+
}));
|
|
2901
|
+
});
|
|
2902
|
+
}
|
|
2903
|
+
if (nativeSidebar && !hasSpaces && config.sections) {
|
|
2503
2904
|
config.sections.forEach(function(section) {
|
|
2504
2905
|
if (nativeSidebar.addSection) nativeSidebar.addSection(section);
|
|
2505
2906
|
});
|
|
@@ -2538,42 +2939,49 @@ ${$} `)}]`:"";return`Craft.create("${U.zigType}", ${Y}${K})`}function jU(U,X,
|
|
|
2538
2939
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
2539
2940
|
})();
|
|
2540
2941
|
</script>
|
|
2541
|
-
`;return U=U.replace(/<@craft-sidebar\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(q,Y
|
|
2542
|
-
${
|
|
2543
|
-
${
|
|
2942
|
+
`;return U=U.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(q,J,Y)=>{return D("sidebar",J,Y.trim(),X,$)}),U=U.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(q,J)=>{return D("sidebar",J,"",X,$)}),U=U.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(q,J,Y)=>{return D(J,Y,"",X,$)}),U=U.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(q,J,Y,K)=>{return D(J,Y,K.trim(),X,$)}),U}function D(U,X,$,q,J){let Y=q.components?.[U]||g[U];if(!Y)return console.warn(`[stx] Unknown Craft component: @craft-${U}`),`<div class="${J}-unknown" data-component="${U}">${$}</div>`;let K=C(X),G=[Y.fallbackClasses||`${J}-${U}`];if(K.class)G.push(K.class),delete K.class;if(Y.render)return K.__fallbackClasses=G.join(" "),Y.render(K,$);let Q=cU(K,Y,G);if(["input","hr","br","img"].includes(Y.fallbackTag))return`<${Y.fallbackTag} ${Q}>`;return`<${Y.fallbackTag} ${Q}>${$}</${Y.fallbackTag}>`}function C(U){let X={},$=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,q;while((q=$.exec(U))!==null){let[J,Y,K,G]=q,Q=K??G;if(J.startsWith(":"))X[Y]=Q;else if(J.startsWith("@"))X[`on${Y.charAt(0).toUpperCase()}${Y.slice(1)}`]=Q;else if(Q===void 0)X[Y]=!0;else X[Y]=Q}return X}function SU(U,X){let $=M(String(U.id||`craft-sidebar-${lU(X||JSON.stringify(U))}`)),q=hU(U.spaces)||fU(X),J=q.length?[]:dU(U.sections)||t(X),Y=String(U.selectedSpace||q[0]?.id||""),K=q.find((O)=>O.id===Y)||q[0],G=String(U.selectedItem||U.selected||(q.length?K?.sections[0]?.items[0]?.id:J[0]?.items[0]?.id)||""),Q={id:$,variant:String(U.variant||"desktop"),material:String(U.material||"sidebar"),backgroundEffect:String(U.backgroundEffect||"shimmer"),allowsVibrancy:U.allowsVibrancy!==!1&&U.allowsVibrancy!=="false",materialOpacity:Number(U.materialOpacity??0.68),materialDarkOpacity:U.materialDarkOpacity===void 0?void 0:Number(U.materialDarkOpacity),minWidth:U.minWidth===void 0?240:Number(U.minWidth),maxWidth:U.maxWidth===void 0?340:Number(U.maxWidth),canCollapse:U.canCollapse!==!1&&U.canCollapse!=="false",searchPlaceholder:U.searchPlaceholder?String(U.searchPlaceholder):void 0,selectedItem:G,sections:J,spaces:q,selectedSpace:Y||void 0},W=String(U.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),_=Number(U.width||U.sidebarWidth||286),w=U.native===!1||U.native==="false"?"false":"true",F=Q.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${R(Q.searchPlaceholder)}"></div>`:"",L;if(q.length)L=mU(q,Y,G);else if(J.length)L=J.map((O)=>e(O,G)).join("");else L=X;return`<aside class="${E(W)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${E($)}" data-native="${w}" style="--craft-sidebar-width:${_}px">
|
|
2943
|
+
${F}
|
|
2944
|
+
${L}
|
|
2544
2945
|
</aside>
|
|
2545
|
-
<script type="application/json" data-craft-sidebar-config="${
|
|
2546
|
-
${
|
|
2946
|
+
<script type="application/json" data-craft-sidebar-config="${E($)}">${sU(Q)}</script>`}function NU(U,X){let $=M(String(U.id||U.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${E($)}">
|
|
2947
|
+
${U.label?`<div class="craft-sidebar-space-title">${R(String(U.label))}</div>`:""}
|
|
2948
|
+
${X}
|
|
2949
|
+
</section>`}function vU(U,X){let $=String(U.header||U.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${E(String(U.id||"section"))}">
|
|
2950
|
+
${$?`<div class="craft-sidebar-section-title">${R($)}</div>`:""}
|
|
2547
2951
|
${X}
|
|
2548
|
-
</section>`}function
|
|
2549
|
-
|
|
2550
|
-
${
|
|
2551
|
-
</section>`
|
|
2552
|
-
|
|
2553
|
-
<
|
|
2554
|
-
${U.
|
|
2555
|
-
</
|
|
2952
|
+
</section>`}function uU(U,X){let $={id:String(U.id||M(String(U.label||X||"item"))),label:String(U.label||X||""),icon:U.icon?String(U.icon):void 0,badge:U.badge?String(U.badge):void 0,tintColor:U.tintColor?String(U.tintColor):void 0};return UU($,String(U.selected||"")==="true")}function t(U){let X=[],$=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,q;while((q=$.exec(U))!==null){let J=C(q[1]||""),Y=q[2]||"",K=String(J.id||M(String(J.header||J.title||`section-${X.length+1}`))),G=String(J.header||J.title||K),Q=gU(Y);X.push({id:K,header:G,title:G,items:Q})}return X}function gU(U){let X=[],$=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,q;while((q=$.exec(U))!==null){let J=C(q[1]||""),Y=String(J.label||(q[2]||"").replace(/<[^>]*>/g,"").trim()),K=String(J.id||M(Y||`item-${X.length+1}`));X.push({id:K,label:Y,icon:J.icon?String(J.icon):void 0,badge:J.badge?String(J.badge):void 0,tintColor:J.tintColor?String(J.tintColor):void 0})}return X}function fU(U){let X=[],$=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,q;while((q=$.exec(U))!==null){let J=C(q[1]||""),Y=q[2]||"",K=String(J.label||J.title||`Space ${X.length+1}`);X.push({id:String(J.id||M(K)),label:K,icon:J.icon?String(J.icon):void 0,tint:J.tint?String(J.tint):void 0,sections:t(Y)})}return X}function hU(U){if(!U)return;if(Array.isArray(U))return U;if(typeof U!=="string")return;try{let X=JSON.parse(U);return Array.isArray(X)?X:void 0}catch{return}}function mU(U,X,$){let q=U.map((Y)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${E(Y.id)}" data-selected="${Y.id===X?"true":"false"}" title="${E(Y.label||Y.id)}">${Y.icon?`<span class="craft-sidebar-item-icon" data-icon="${E(Y.icon)}"></span>`:R((Y.label||Y.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${U.map((Y)=>`<section class="craft-sidebar-space" data-space-id="${E(Y.id)}" data-selected="${Y.id===X?"true":"false"}">
|
|
2953
|
+
${Y.label?`<div class="craft-sidebar-space-title">${R(Y.label)}</div>`:""}
|
|
2954
|
+
${Y.sections.map((K)=>e(K,$)).join("")}
|
|
2955
|
+
</section>`).join("")}</div>
|
|
2956
|
+
<div class="craft-sidebar-space-switcher">${q}</div>`}function dU(U){if(!U)return;if(Array.isArray(U))return U;if(typeof U!=="string")return;try{let X=JSON.parse(U);return Array.isArray(X)?X:void 0}catch{return}}function e(U,X){let $=U.header||U.title||U.id;return`<section class="craft-sidebar-section" data-section-id="${E(U.id)}">
|
|
2957
|
+
<div class="craft-sidebar-section-title">${R($)}</div>
|
|
2958
|
+
${U.items.map((q)=>UU(q,q.id===X)).join("")}
|
|
2959
|
+
</section>`}function UU(U,X){let $=U.tintColor?` style="--craft-sidebar-icon-color:${E(U.tintColor)}"`:"";return`<button class="craft-sidebar-item" type="button" data-item-id="${E(U.id)}" data-selected="${X?"true":"false"}">
|
|
2960
|
+
${U.icon?`<span class="craft-sidebar-item-icon" data-icon="${E(U.icon)}"${$}></span>`:""}
|
|
2961
|
+
<span class="craft-sidebar-item-label">${R(U.label)}</span>
|
|
2962
|
+
${U.badge?`<span class="craft-sidebar-item-badge">${R(U.badge)}</span>`:""}
|
|
2963
|
+
</button>`}function M(U){return U.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function lU(U){let X=5381;for(let $=0;$<U.length;$++)X=X*33^U.charCodeAt($);return(X>>>0).toString(36)}function R(U){return U.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(U){return R(U).replace(/`/g,"`")}function sU(U){return JSON.stringify(U).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function cU(U,X,$){let q=[];q.push(`class="${$.join(" ")}"`),q.push(`data-craft="${X.nativeType}"`);for(let[J,Y]of Object.entries(U))if(Y===!0)q.push(J);else if(Y!==!1&&Y!==void 0&&Y!==null){let K=String(Y).replace(/"/g,""");q.push(`${J}="${K}"`)}return q.join(" ")}function SX(U,X){g[U]=X}function NX(){return{...g}}var z=new Map,j=new Map;function iU(U,X){let $=X?.id||YX(U),q=JX(U),J=z.get($);if(J&&J.hash===q)return J;let Y=rU(U),K=UX(U),G=XX(U),Q=tU(Y),{staticParts:W,dynamicParts:_}=eU(Y),w=$X(U),F={id:$,hash:q,tree:Y,scripts:K,styles:G,staticParts:W,dynamicParts:_,dependencies:w,metadata:Q};return z.set($,F),F}async function uX(U,X={},$={}){let q=performance.now();if($.cache){let G=`${U.id}:${JSON.stringify(X)}`,Q=j.get(G);if(Q&&Date.now()-Q.timestamp<($.cacheTTL||60000))return{html:Q.html,styles:U.styles.join(`
|
|
2556
2964
|
`),scripts:U.scripts.join(`
|
|
2557
|
-
`),metadata:{renderTime:0,cacheHit:!0,totalSize:Q.html.length,componentCount:U.metadata.componentCount}}}let
|
|
2965
|
+
`),metadata:{renderTime:0,cacheHit:!0,totalSize:Q.html.length,componentCount:U.metadata.componentCount}}}let J;if($.streaming)J=await nU(U.tree,X);else J=k(U.tree,X);let Y;if($.hydrate){let G=oU(J,U,X);J=G.html,Y=G.data}if($.minify)J=qX(J);if($.cache){let G=`${U.id}:${JSON.stringify(X)}`;j.set(G,{html:J,timestamp:Date.now()})}let K=performance.now()-q;return{html:J,styles:U.styles.join(`
|
|
2558
2966
|
`),scripts:U.scripts.join(`
|
|
2559
|
-
`),hydrationData:
|
|
2967
|
+
`),hydrationData:Y,metadata:{renderTime:K,cacheHit:!1,totalSize:J.length,componentCount:U.metadata.componentCount}}}function gX(U,X){let $=[],q=[],J=[],Y=new Map,K=[];return T(U.tree,(G,Q)=>{if(G.type==="component"&&G.componentName){if(KU(G.componentName))$.push(G.componentName)}if(G.type==="element"&&G.tag){let W=QX(G);if(W)K.push(W);if(G.props){for(let[_,w]of Object.entries(G.props))if(_.startsWith("on")&&typeof w==="string"){let F=`handler_${Y.size}`;Y.set(F,w)}}}if(G.isStatic&&G.type==="element")q.push(qU(G));else if(!G.isStatic&&G.type!=="text")J.push(G.tag||G.componentName||"unknown")}),{nativeComponents:$,staticHTML:q,dynamicParts:J,eventHandlers:Y,nativeWidgets:K}}function fX(U,X={}){let $=iU(U),q=aU($,X),J=new Map,Y=[];return T($.tree,(K)=>{if(K.type==="component"&&K.componentName){if(KU(K.componentName)){Y.push(K.componentName);let G=`<!--craft:${K.componentName}:${K.hydrationKey||"default"}-->`;J.set(K.hydrationKey||K.componentName,G)}}}),{staticHTML:q,dynamicPlaceholders:J,craftComponents:Y}}function rU(U){let X={type:"fragment",children:[]},$=X,q=[X],J=U,Y=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(J.length>0){let K=J.match(/^<(@?[\w-]+)([^>]*)>/);if(K){let[W,_,w]=K,F=pU(w),L=_.startsWith("@craft-"),O=L?_:_.toLowerCase(),B={type:L?"component":"element",tag:O,props:F,children:[],componentName:L?O.slice(1):void 0,isStatic:!XU(w),hydrationKey:KX()};if($.children=$.children||[],$.children.push(B),!Y.has(O)&&!w.endsWith("/"))q.push(B),$=B;J=J.slice(W.length);continue}let G=J.match(/^<\/(@?[\w-]+)>/);if(G){let[W,_]=G,F=_.startsWith("@craft-")?_:_.toLowerCase();while(q.length>1){let L=q.pop();if($=q[q.length-1],L.tag===F)break}J=J.slice(W.length);continue}let Q=J.match(/^[^<]+/);if(Q){let W=Q[0];if(W.trim()){let _={type:"text",text:W,isStatic:!XU(W)};$.children=$.children||[],$.children.push(_)}J=J.slice(W.length);continue}J=J.slice(1)}return X}function pU(U){let X={},$=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,q;while((q=$.exec(U))!==null){let[,J,Y,K,G]=q,Q=Y??K??G??!0;X[J]=Q}return X}function T(U,X,$=[]){if(X(U,$),U.children)U.children.forEach((q,J)=>{T(q,X,[...$,`${J}`])})}function k(U,X){switch(U.type){case"text":return JU(U.text||"",X);case"element":case"component":{let $=U.tag||"div",q=YU(U.props||{},X),J=(U.children||[]).map((Y)=>k(Y,X)).join("");if(!U.children||U.children.length===0){if(["input","br","hr","img","meta","link"].includes($))return`<${$}${q} />`}return`<${$}${q}>${J}</${$}>`}case"fragment":return(U.children||[]).map(($)=>k($,X)).join("");case"slot":return`<!--slot:${U.slotName||"default"}-->`;default:return""}}function qU(U){if(U.type==="text")return U.text||"";let X=U.tag||"div",$=YU(U.props||{},{});return`<${X}${$}></${X}>`}function YU(U,X){let $=[];for(let[q,J]of Object.entries(U))if(J===!0)$.push(` ${q}`);else if(J!==!1&&J!==null&&J!==void 0){let Y=JU(String(J),X);$.push(` ${q}="${GU(Y)}"`)}return $.join("")}async function nU(U,X){return k(U,X)}function aU(U,X){let $=[];return T(U.tree,(q)=>{if(q.isStatic)$.push(k(q,X))}),$.join("")}function oU(U,X,$){let q={templateId:X.id,context:$,dynamicParts:Array.from(X.dynamicParts.entries())},J=`
|
|
2560
2968
|
<script data-craft-hydration>
|
|
2561
2969
|
window.__CRAFT_HYDRATION__ = ${JSON.stringify(q)};
|
|
2562
|
-
</script>`;return{html:U+
|
|
2563
|
-
</head>`)}let K=U.name||
|
|
2970
|
+
</script>`;return{html:U+J,data:q}}function tU(U){let X=!1,$=!1,q=!1,J=!1,Y=0,K=0;function G(Q,W){if(K=Math.max(K,W),Q.type==="slot")X=!0;if(Q.type==="component")Y++;if(!Q.isStatic)$=!0;if(Q.props)for(let _ of Object.keys(Q.props)){if(_.startsWith("on"))q=!0;if(_==="@async"||_==="data-async")J=!0}if(Q.children)Q.children.forEach((_)=>G(_,W+1))}return G(U,0),{hasSlots:X,hasDynamicContent:$,hasEventHandlers:q,hasAsyncContent:J,componentCount:Y,maxDepth:K,estimatedSize:JSON.stringify(U).length}}function eU(U){let X=new Map,$=new Map;return T(U,(q,J)=>{let Y=J.join(".");if(q.isStatic)X.set(Y,qU(q));else $.set(Y,q.tag||q.componentName||"dynamic")}),{staticParts:X,dynamicParts:$}}function UX(U){let X=[],$=/<script[^>]*>([\s\S]*?)<\/script>/gi,q;while((q=$.exec(U))!==null)X.push(q[1]);return X}function XX(U){let X=[],$=/<style[^>]*>([\s\S]*?)<\/style>/gi,q;while((q=$.exec(U))!==null)X.push(q[1]);return X}function $X(U){let X=[],$=/@include\s*\(\s*['"]([^'"]+)['"]/g,q;while((q=$.exec(U))!==null)X.push(q[1]);let J=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((q=J.exec(U))!==null)X.push(q[1]);let Y=/<@craft-[\w-]+/g;while((q=Y.exec(U))!==null)X.push(q[0].slice(2));return[...new Set(X)]}function XU(U){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(U)}function JU(U,X){let $=U.replace(/\{\{\s*(.+?)\s*\}\}/g,(q,J)=>{try{let Y=$U(J.trim(),X);return GU(String(Y??""))}catch{return""}});return $=$.replace(/\{!!\s*(.+?)\s*!!\}/g,(q,J)=>{try{let Y=$U(J.trim(),X);return String(Y??"")}catch{return""}}),$}function $U(U,X){if(/^[\w.]+$/.test(U)){let $=U.split("."),q=X;for(let J of $)if(q&&typeof q==="object"&&J in q)q=q[J];else return;return q}try{return Function(...Object.keys(X),`return ${U}`)(...Object.values(X))}catch{return}}function GU(U){return U.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qX(U){return U.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function YX(U){let X=0;for(let $=0;$<U.length;$++){let q=U.charCodeAt($);X=(X<<5)-X+q,X=X&X}return`tpl_${Math.abs(X).toString(36)}`}function JX(U){let X=0;for(let $=0;$<U.length;$++){let q=U.charCodeAt($);X=(X<<5)-X+q,X=X&X}return Math.abs(X).toString(36)}var GX=0;function KX(){return`h_${++GX}`}function KU(U){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(U)}function QX(U){let X=U.tag?.toLowerCase(),$=U.props?.type,q={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},J=$?`${X}:${$}`:X,Y=q[J||""]||q[X||""];if(Y)return{htmlSelector:J||X||"",nativeComponent:Y.component,confidence:Y.confidence,reason:Y.reason};return null}function WX(){z.clear()}function ZX(){j.clear()}function hX(){WX(),ZX()}function mX(){return{templateCacheSize:z.size,renderCacheSize:j.size,totalEntries:z.size+j.size}}import{existsSync as WU,mkdirSync as V,copyFileSync as b,chmodSync as I}from"fs";import{join as Z,basename as _X}from"path";import{spawn as S,execSync as wX}from"child_process";import{tmpdir as ZU,homedir as QU,platform as LX}from"os";async function oX(U){let X=Date.now();try{if(!await Bun.file(U.input).exists())return{success:!1,target:U.target||y(),format:U.format||"app",error:`Input file not found: ${U.input}`};let $=U.target||y(),q=U.format||HX($),J=U.output||Z(process.cwd(),"dist","native");if(!WU(J))V(J,{recursive:!0});let Y=await Bun.file(U.input).text();if(Y=m(Y,{debug:U.verbose}),Y=o(Y),!Y.includes("craft-component-styles")){if(Y.includes("</head>"))Y=Y.replace("</head>",`${a}
|
|
2971
|
+
</head>`)}let K=U.name||_X(U.input,".stx"),G=U.version||"1.0.0",Q=U.craftPath||await AX();if(!Q)return{success:!1,target:$,format:q,error:"Craft binary not found. Please install Craft or specify craftPath."};if(U.verbose)console.log(`\uD83D\uDCE6 Building native app for ${$}...`),console.log(` Input: ${U.input}`),console.log(` Output: ${J}`),console.log(` Craft: ${Q}`);let W;switch($){case"macos":W=await FX(Y,K,G,J,q,U,Q);break;case"windows":W=await BX(Y,K,G,J,q,U,Q);break;case"linux":W=await OX(Y,K,G,J,q,U,Q);break;case"ios":W=await EX(Y,K,G,J,U,Q);break;case"android":W=await VX(Y,K,G,J,U,Q);break;default:W={success:!1,target:$,format:q,error:`Unsupported target: ${$}`}}return W.duration=Date.now()-X,W}catch($){return{success:!1,target:U.target||y(),format:U.format||"app",error:$.message,duration:Date.now()-X}}}async function FX(U,X,$,q,J,Y,K){let G=Y.bundleId||`com.stx.${X.toLowerCase().replace(/[^a-z0-9]/g,"")}`,Q=Z(q,`${X}.app`),W=Z(Q,"Contents"),_=Z(W,"MacOS"),w=Z(W,"Resources");V(_,{recursive:!0}),V(w,{recursive:!0});let F=Z(w,"index.html");await Bun.write(F,U);let L="";if(Y.sidebar?.enabled&&Y.sidebar?.config)L=Z(w,"sidebar-config.json"),await Bun.write(L,JSON.stringify(Y.sidebar.config));let O=Y.sidebar?.enabled?`--native-sidebar --sidebar-width ${Y.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",B=`#!/bin/bash
|
|
2564
2972
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2565
2973
|
RESOURCES="$DIR/../Resources"
|
|
2566
2974
|
"${K}" --html "$(cat "$RESOURCES/index.html")" \\
|
|
2567
|
-
--title "${
|
|
2568
|
-
--width ${
|
|
2569
|
-
--height ${
|
|
2570
|
-
${
|
|
2571
|
-
${
|
|
2572
|
-
${
|
|
2573
|
-
${
|
|
2975
|
+
--title "${Y.window?.title||X}" \\
|
|
2976
|
+
--width ${Y.window?.width||1200} \\
|
|
2977
|
+
--height ${Y.window?.height||800} \\
|
|
2978
|
+
${Y.systemTray?"--system-tray":""} \\
|
|
2979
|
+
${Y.devTools?"--dev-tools":""} \\
|
|
2980
|
+
${Y.window?.frameless?"--frameless":""} \\
|
|
2981
|
+
${Y.window?.alwaysOnTop?"--always-on-top":""} \\
|
|
2574
2982
|
${O}
|
|
2575
|
-
`,
|
|
2576
|
-
exec "${K}" "$@"`;await Bun.write(
|
|
2983
|
+
`,H=Z(_,X);await Bun.write(H,B),I(H,493);let x=Z(_,"craft");try{b(K,x),I(x,493)}catch{let P=`#!/bin/bash
|
|
2984
|
+
exec "${K}" "$@"`;await Bun.write(x,P),I(x,493)}let _U=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2577
2985
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
2578
2986
|
<plist version="1.0">
|
|
2579
2987
|
<dict>
|
|
@@ -2600,50 +3008,50 @@ exec "${K}" "$@"`;await Bun.write(T,x),R(T,493)}let WU=`<?xml version="1.0" enco
|
|
|
2600
3008
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
|
2601
3009
|
<true/>
|
|
2602
3010
|
<key>LSUIElement</key>
|
|
2603
|
-
<${
|
|
3011
|
+
<${Y.systemTray?"true":"false"}/>
|
|
2604
3012
|
</dict>
|
|
2605
|
-
</plist>`;if(await Bun.write(Z(W,"Info.plist"),
|
|
3013
|
+
</plist>`;if(await Bun.write(Z(W,"Info.plist"),_U),Y.icon&&await Bun.file(Y.icon).exists())b(Y.icon,Z(w,"AppIcon.icns"));if(J==="dmg"){let P=Z(q,`${X}-${$}.dmg`),f=await RX(Q,P,X);if(!f.success)return{success:!1,target:"macos",format:"dmg",error:f.error};return{success:!0,target:"macos",format:"dmg",outputPath:P}}return{success:!0,target:"macos",format:"app",outputPath:Q}}async function BX(U,X,$,q,J,Y,K){let G=Z(q,X);V(G,{recursive:!0});let Q=Z(G,"index.html");await Bun.write(Q,U);let W=`@echo off
|
|
2606
3014
|
set DIR=%~dp0
|
|
2607
3015
|
"${K}" --html-file "%DIR%index.html" ^
|
|
2608
|
-
--title "${
|
|
2609
|
-
--width ${
|
|
2610
|
-
--height ${
|
|
2611
|
-
${
|
|
2612
|
-
${
|
|
2613
|
-
`;if(await Bun.write(Z(G,`${X}.bat`),W),
|
|
3016
|
+
--title "${Y.window?.title||X}" ^
|
|
3017
|
+
--width ${Y.window?.width||1200} ^
|
|
3018
|
+
--height ${Y.window?.height||800} ^
|
|
3019
|
+
${Y.systemTray?"--system-tray":""} ^
|
|
3020
|
+
${Y.devTools?"--dev-tools":""}
|
|
3021
|
+
`;if(await Bun.write(Z(G,`${X}.bat`),W),J==="zip"){let _=Z(q,`${X}-${$}-windows.zip`),w=await IX(G,_);if(!w.success)return{success:!1,target:"windows",format:"zip",error:w.error};return{success:!0,target:"windows",format:"zip",outputPath:_}}return{success:!0,target:"windows",format:"app",outputPath:G}}async function OX(U,X,$,q,J,Y,K){let G=Z(q,X);V(G,{recursive:!0});let Q=Z(G,"index.html");await Bun.write(Q,U);let W=`#!/bin/bash
|
|
2614
3022
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2615
3023
|
"${K}" --html-file "$DIR/index.html" \\
|
|
2616
|
-
--title "${
|
|
2617
|
-
--width ${
|
|
2618
|
-
--height ${
|
|
2619
|
-
${
|
|
2620
|
-
${
|
|
2621
|
-
`,_=Z(G,X.toLowerCase());await Bun.write(_,W),
|
|
3024
|
+
--title "${Y.window?.title||X}" \\
|
|
3025
|
+
--width ${Y.window?.width||1200} \\
|
|
3026
|
+
--height ${Y.window?.height||800} \\
|
|
3027
|
+
${Y.systemTray?"--system-tray":""} \\
|
|
3028
|
+
${Y.devTools?"--dev-tools":""}
|
|
3029
|
+
`,_=Z(G,X.toLowerCase());await Bun.write(_,W),I(_,493);let w=`[Desktop Entry]
|
|
2622
3030
|
Type=Application
|
|
2623
3031
|
Name=${X}
|
|
2624
3032
|
Exec=${_}
|
|
2625
3033
|
Terminal=false
|
|
2626
3034
|
Categories=Utility;
|
|
2627
|
-
`;if(await Bun.write(Z(G,`${X.toLowerCase()}.desktop`),w),
|
|
2628
|
-
`)[0];if($&&await Bun.file($).exists())return $}catch{}return null}function
|
|
2629
|
-
exec /usr/share/${$.toLowerCase()}/${$.toLowerCase()} "$@"`;
|
|
3035
|
+
`;if(await Bun.write(Z(G,`${X.toLowerCase()}.desktop`),w),J==="deb"){let F=Z(q,`${X.toLowerCase()}_${$}_amd64.deb`),L=await MX(G,F,X,$,Y);if(!L.success)return{success:!1,target:"linux",format:"deb",error:L.error};return{success:!0,target:"linux",format:"deb",outputPath:F}}if(J==="appimage"){let F=Z(q,`${X}-${$}-x86_64.AppImage`),L=await zX(G,F,X,Y);if(!L.success)return{success:!1,target:"linux",format:"appimage",error:L.error};return{success:!0,target:"linux",format:"appimage",outputPath:F}}return{success:!0,target:"linux",format:"app",outputPath:G}}async function EX(U,X,$,q,J,Y){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${X}' to create an iOS project.`}}async function VX(U,X,$,q,J,Y){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${X}' to create an Android project.`}}async function AX(){let U=[Z(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft-minimal"),Z(process.cwd(),"../craft/packages/zig/zig-out/bin/craft-minimal"),Z(QU(),"Code/craft/packages/zig/zig-out/bin/craft-minimal"),"/usr/local/bin/craft","/usr/bin/craft",Z(QU(),".local/bin/craft"),Z(process.env.LOCALAPPDATA||"","craft","craft.exe"),Z(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let X of U)if(await Bun.file(X).exists())return X;try{let $=wX("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
|
|
3036
|
+
`)[0];if($&&await Bun.file($).exists())return $}catch{}return null}function y(){switch(LX()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function HX(U){switch(U){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function RX(U,X,$){return new Promise((q)=>{let J=S("hdiutil",["create","-volname",$,"-srcfolder",U,"-ov","-format","UDZO",X]);J.on("close",(Y)=>{if(Y===0)q({success:!0});else q({success:!1,error:`hdiutil exited with code ${Y}`})}),J.on("error",(Y)=>{q({success:!1,error:Y.message})})})}async function IX(U,X){return new Promise(($)=>{let q=S("zip",["-r",X,"."],{cwd:U});q.on("close",(J)=>{if(J===0)$({success:!0});else $({success:!1,error:`zip exited with code ${J}`})}),q.on("error",(J)=>{$({success:!1,error:J.message})})})}async function MX(U,X,$,q,J){return new Promise((Y)=>{try{let K=Z(ZU(),`stx-deb-${Date.now()}`),G=Z(K,"DEBIAN"),Q=Z(K,"usr","bin"),W=Z(K,"usr","share","applications"),_=Z(K,"usr","share",$.toLowerCase());V(G,{recursive:!0}),V(Q,{recursive:!0}),V(W,{recursive:!0}),V(_,{recursive:!0});let w=A("fs").readdirSync(U);for(let B of w)b(Z(U,B),Z(_,B));let F=`#!/bin/bash
|
|
3037
|
+
exec /usr/share/${$.toLowerCase()}/${$.toLowerCase()} "$@"`;A("fs").writeFileSync(Z(Q,$.toLowerCase()),F),I(Z(Q,$.toLowerCase()),493);let L=`Package: ${$.toLowerCase()}
|
|
2630
3038
|
Version: ${q}
|
|
2631
3039
|
Section: utils
|
|
2632
3040
|
Priority: optional
|
|
2633
3041
|
Architecture: amd64
|
|
2634
3042
|
Depends: libgtk-3-0, libwebkit2gtk-4.0-37
|
|
2635
|
-
Maintainer: ${
|
|
2636
|
-
Description: ${
|
|
2637
|
-
`;
|
|
3043
|
+
Maintainer: ${J.author||"Unknown"}
|
|
3044
|
+
Description: ${J.description||$}
|
|
3045
|
+
`;A("fs").writeFileSync(Z(G,"control"),L);let O=S("dpkg-deb",["--build",K,X]);O.on("close",(B)=>{if(A("fs").rmSync(K,{recursive:!0,force:!0}),B===0)Y({success:!0});else Y({success:!1,error:`dpkg-deb exited with code ${B}`})}),O.on("error",(B)=>{A("fs").rmSync(K,{recursive:!0,force:!0}),Y({success:!1,error:B.message})})}catch(K){Y({success:!1,error:K.message})}})}async function zX(U,X,$,q){return new Promise((J)=>{try{let Y=Z(ZU(),`stx-appimage-${Date.now()}`),K=Z(Y,`${$}.AppDir`),G=Z(K,"usr"),Q=Z(G,"bin"),W=Z(G,"share");V(Q,{recursive:!0}),V(W,{recursive:!0});let _=Z(W,$.toLowerCase());V(_,{recursive:!0});let w=A("fs").readdirSync(U);for(let H of w)b(Z(U,H),Z(_,H));let F=`#!/bin/bash
|
|
2638
3046
|
SELF=$(readlink -f "$0")
|
|
2639
3047
|
HERE=\${SELF%/*}
|
|
2640
3048
|
export PATH="\${HERE}/usr/bin:\${PATH}"
|
|
2641
3049
|
exec "\${HERE}/usr/share/${$.toLowerCase()}/${$.toLowerCase()}" "$@"
|
|
2642
|
-
`;
|
|
3050
|
+
`;A("fs").writeFileSync(Z(K,"AppRun"),F),I(Z(K,"AppRun"),493);let L=`[Desktop Entry]
|
|
2643
3051
|
Type=Application
|
|
2644
3052
|
Name=${$}
|
|
2645
3053
|
Exec=${$.toLowerCase()}
|
|
2646
3054
|
Terminal=false
|
|
2647
3055
|
Categories=Utility;
|
|
2648
3056
|
Icon=${$.toLowerCase()}
|
|
2649
|
-
`;
|
|
3057
|
+
`;A("fs").writeFileSync(Z(K,`${$.toLowerCase()}.desktop`),L);let O=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(A("fs").writeFileSync(Z(K,`${$.toLowerCase()}.png`),O),q.icon&&WU(q.icon))b(q.icon,Z(K,`${$.toLowerCase()}.png`));let B=S("appimagetool",[K,X],{env:{...process.env,ARCH:"x86_64"}});B.on("close",(H)=>{if(A("fs").rmSync(Y,{recursive:!0,force:!0}),H===0)I(X,493),J({success:!0});else J({success:!1,error:`appimagetool exited with code ${H}. Install from https://appimage.github.io/appimagetool/`})}),B.on("error",(H)=>{A("fs").rmSync(Y,{recursive:!0,force:!0}),J({success:!1,error:`appimagetool not found: ${H.message}`})})}catch(Y){J({success:!1,error:Y.message})}})}function tX(){return[y()]}function eX(U){switch(U){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}export{uX as renderSSR,SX as registerCraftComponent,bX as processCraftDirective,o as processCraftComponents,fX as prerenderForCraft,TX as isCraftEnvironment,m as injectCraftBridge,mX as getSSRCacheStats,NX as getCraftComponents,tX as getAvailableTargets,eX as getAvailableFormats,gX as generateCraftOptimizations,h as generateCraftBridgeScript,DX as createHotReloadServer,PX as compileToNative,iU as compileTemplate,WX as clearTemplateCache,ZX as clearRenderCache,hX as clearAllCaches,oX as buildNative,wU as NATIVE_COMPONENTS,a as CRAFT_COMPONENT_STYLES,yX as CRAFT_COMPONENT_RUNTIME,g as CRAFT_COMPONENTS,kX as CRAFT_BRIDGE_SCRIPT};
|