@iwsdk/vite-plugin-dev 1.1.0-rc.1 → 1.1.0

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/README.md CHANGED
@@ -79,9 +79,10 @@ iwsdkDev({
79
79
  // Wait for the managed browser command bridge after launch or recovery.
80
80
  bridgeReadyTimeoutMs: 5000, // default
81
81
 
82
- // Public UIKitML is scanned automatically. Retain bundled families needed
83
- // only by remote or otherwise dynamic UIKitML (or use 'all').
84
- bundle: { fonts: ['roboto'] },
82
+ // Public UIKitML is scanned automatically. Retain bundled families and
83
+ // Lucide icons needed only by remote or otherwise dynamic UIKitML (or use
84
+ // 'all').
85
+ bundle: { fonts: ['roboto'], icons: ['Settings'] },
85
86
 
86
87
  // Enable verbose logging
87
88
  verbose: false, // default
@@ -10,6 +10,18 @@ export declare const BUNDLED_FONT_MODULES: Record<UIKitMLBundledFontName, {
10
10
  exportName: string;
11
11
  }>;
12
12
  export declare function resolveBundledFontNames(publicDirectory: string | undefined, configured: ProductionBundleOptions['fonts']): Promise<ReadonlySet<UIKitMLBundledFontName>>;
13
+ /**
14
+ * Lucide icons to keep in a production build: those used by static public
15
+ * UIKitML plus `bundle.icons`, or `'all'` when that set cannot be known.
16
+ */
17
+ export declare function resolveBundledLucideIcons(publicDirectory: string | undefined, configured: ProductionBundleOptions['icons']): Promise<ReadonlySet<string> | 'all'>;
18
+ /**
19
+ * UIKitML's kits module builds its Lucide component set by iterating
20
+ * `import * as Lucide`, which keeps all ~1,600 icons in every production
21
+ * bundle. Replace that namespace with just the retained icons. Returns null
22
+ * for any other module.
23
+ */
24
+ export declare function rewriteUIKitMLLucideKit(code: string, id: string, icons: ReadonlySet<string> | 'all'): string | null;
13
25
  export declare function createDisabledBundledFontsModule(): string;
14
26
  /**
15
27
  * three r185's DRACOLoader and KTX2Loader default to the decoders next to the
@@ -25,6 +25,8 @@ export interface EditorWorkspaceSnapshot {
25
25
  selectedNodeIds: string[];
26
26
  soloNodeId: string | null;
27
27
  statusStrip: string;
28
+ tabAudioAvailable: boolean;
29
+ tabAudioMuted: boolean;
28
30
  transformMode: 'translate' | 'rotate' | 'scale';
29
31
  transformSnapEnabled: boolean;
30
32
  transformSnapRotationDeg: number;
@@ -55,6 +57,7 @@ export interface EditorWorkspaceController {
55
57
  }): void;
56
58
  selectBuiltin?(target: string): void;
57
59
  selectRoot?(): void;
60
+ setTabAudioMuted?(muted: boolean): void;
58
61
  setTransformMode?(mode: 'translate' | 'rotate' | 'scale'): void;
59
62
  setTransformSnap?(mode: 'translate' | 'rotate' | 'scale', value: number): void;
60
63
  setTransformSpace?(space: 'local' | 'world'): void;
@@ -498,6 +498,52 @@ const Undo2 = [
498
498
  ]
499
499
  ];
500
500
 
501
+ /**
502
+ * @license lucide v0.468.0 - ISC
503
+ *
504
+ * This source code is licensed under the ISC license.
505
+ * See the LICENSE file in the root directory of this source tree.
506
+ */
507
+
508
+
509
+ const Volume2 = [
510
+ "svg",
511
+ defaultAttributes,
512
+ [
513
+ [
514
+ "path",
515
+ {
516
+ d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"
517
+ }
518
+ ],
519
+ ["path", { d: "M16 9a5 5 0 0 1 0 6" }],
520
+ ["path", { d: "M19.364 18.364a9 9 0 0 0 0-12.728" }]
521
+ ]
522
+ ];
523
+
524
+ /**
525
+ * @license lucide v0.468.0 - ISC
526
+ *
527
+ * This source code is licensed under the ISC license.
528
+ * See the LICENSE file in the root directory of this source tree.
529
+ */
530
+
531
+
532
+ const VolumeX = [
533
+ "svg",
534
+ defaultAttributes,
535
+ [
536
+ [
537
+ "path",
538
+ {
539
+ d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"
540
+ }
541
+ ],
542
+ ["line", { x1: "22", x2: "16", y1: "9", y2: "15" }],
543
+ ["line", { x1: "16", x2: "22", y1: "9", y2: "15" }]
544
+ ]
545
+ ];
546
+
501
547
  var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,p=c.__;function s(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,y(D,n)}function y(n,u,i){var o=s(t++,2);if(o.t=n,!o.__c&&(o.__=[D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=false,i=o.__c.props!==n;if(o.__c.__H.__.some(function(n){if(n.__N){u=true;var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c){var f=c.call(this,n,t,r);return u?f||i:f}return !u||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function h(n,u){var i=s(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i));}function T(n,r){var u=s(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[];}catch(r){t.__h=[],c.__e(r,n.__v);}}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0);})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return !n.__||B(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B(n){var t=r;n.__c=n.__(),r=t;}function C(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
502
548
 
503
549
  const ENTITY_REFERENCE_MIME = 'application/x-iwsdk-entity-reference';
@@ -520,6 +566,8 @@ const DEFAULT_SNAPSHOT = {
520
566
  selectedNodeIds: [],
521
567
  soloNodeId: null,
522
568
  statusStrip: 'Scene loading...',
569
+ tabAudioAvailable: false,
570
+ tabAudioMuted: false,
523
571
  transformMode: 'translate',
524
572
  transformSnapEnabled: false,
525
573
  transformSnapRotationDeg: 15,
@@ -553,6 +601,8 @@ const ICONS = {
553
601
  Rotate3D: Rotate3d,
554
602
  Scale3D: Scale3d,
555
603
  Undo2,
604
+ Volume2,
605
+ VolumeX,
556
606
  };
557
607
  function mountEditorWorkspace(root, controller, initial = {}) {
558
608
  const state = d$2({ ...DEFAULT_SNAPSHOT, ...initial });
@@ -581,7 +631,11 @@ function useSignalValue(state) {
581
631
  return value;
582
632
  }
583
633
  function WorkspaceViewSwitcher({ controller, snapshot, }) {
584
- return (u$1("div", { class: "workspace-view-switcher", "aria-label": "Workspace view", children: [['runtime', 'editor'].map((view) => (u$1("button", { "data-active": snapshot.view === view || undefined, "data-workspace-view-button": view, onClick: () => controller.setView?.(view), children: view === 'runtime' ? 'Runtime' : 'Editor' }, view))), u$1("button", { type: "button", class: "workspace-icon-button workspace-reload-button", "data-workspace-reload-button": true, title: "Reload page", "aria-label": "Reload page", onClick: () => controller.reloadPage?.(), children: u$1(Icon, { name: "RefreshCw" }) }), u$1("button", { type: "button", class: "workspace-icon-button", "data-workspace-open-browser-button": true, title: "Open runtime in default browser", "aria-label": "Open runtime in default browser", onClick: () => controller.openRuntimeInBrowser?.(), children: u$1(Icon, { name: "ExternalLink" }) })] }));
634
+ return (u$1("div", { class: "workspace-view-switcher", "aria-label": "Workspace view", children: [['runtime', 'editor'].map((view) => (u$1("button", { "data-active": snapshot.view === view || undefined, "data-workspace-view-button": view, onClick: () => controller.setView?.(view), children: view === 'runtime' ? 'Runtime' : 'Editor' }, view))), u$1("button", { type: "button", class: "workspace-icon-button workspace-reload-button", "data-workspace-reload-button": true, title: "Reload page", "aria-label": "Reload page", onClick: () => controller.reloadPage?.(), children: u$1(Icon, { name: "RefreshCw" }) }), u$1("button", { type: "button", class: "workspace-icon-button", "data-workspace-open-browser-button": true, title: "Open runtime in default browser", "aria-label": "Open runtime in default browser", onClick: () => controller.openRuntimeInBrowser?.(), children: u$1(Icon, { name: "ExternalLink" }) }), snapshot.tabAudioAvailable ? (u$1(TabAudioButton, { muted: snapshot.tabAudioMuted, onToggle: (muted) => controller.setTabAudioMuted?.(muted) })) : null] }));
635
+ }
636
+ function TabAudioButton({ muted, onToggle, }) {
637
+ const label = muted ? 'Unmute tab audio' : 'Mute tab audio';
638
+ return (u$1("button", { type: "button", class: "workspace-icon-button", "data-active": muted || undefined, "data-workspace-mute-button": true, title: label, "aria-label": label, onClick: () => onToggle(!muted), children: u$1(Icon, { name: muted ? 'VolumeX' : 'Volume2' }) }));
585
639
  }
586
640
  function EditorViewport({ controller, snapshot, }) {
587
641
  return (u$1("section", { class: "editor-viewport", children: [u$1(EditorToolbar, { snapshot: snapshot, controller: controller }), u$1("div", { id: "scene-viewport", children: [u$1("div", { id: "orientation-gizmo", "aria-label": "Interactive orientation gizmo" }), u$1("div", { class: "editor-slot viewport-overlay-slot", "data-editor-slot": "viewport.overlay" })] }), u$1("section", { id: "editor-bottom-panel", class: "editor-bottom-panel", "aria-label": "Scene diagnostics", children: [u$1("div", { class: "bottom-panel-tabs", role: "tablist", children: [u$1("button", { "data-bottom-tab": "assets", "data-active": true, children: "Assets" }), u$1("button", { "data-bottom-tab": "console", children: "Console" }), u$1("button", { "data-bottom-tab": "validation", children: "Validation" })] }), u$1(AssetBrowser, { snapshot: snapshot, controller: controller }), u$1("div", { id: "bottom-panel-content", class: "bottom-panel-content" })] }), u$1("div", { id: "editor-status-strip", "aria-live": "polite", "data-state": snapshot.dirty ? 'dirty' : 'saved', children: snapshot.statusStrip })] }));