@jxsuite/studio 3.0.0 → 4.0.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.
Files changed (173) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/Overlay.dev-723bv0df.js +23 -0
  3. package/dist/chunks/{cf-settings-zj2cj1ar.js → cf-settings-45fgyx8y.js} +6 -5
  4. package/dist/chunks/{components-z6cnkyy1.js → components-zmx10t62.js} +6 -5
  5. package/dist/chunks/content-source-t88vb2dr.js +49 -0
  6. package/dist/chunks/{convert-to-repeater-6vvx96n2.js → convert-to-repeater-dhw1nrz9.js} +27 -19
  7. package/dist/chunks/entry-commands-6z6bhxg0.js +46 -0
  8. package/dist/chunks/{extension-sections-kwzvpemr.js → extension-sections-3ydgjbdy.js} +32 -24
  9. package/dist/chunks/file-ops-rskmhxyq.js +48 -0
  10. package/dist/chunks/files-0cratsr0.js +92 -0
  11. package/dist/chunks/{format-host-8fr3545e.js → format-host-tgcmfs4p.js} +3 -3
  12. package/dist/chunks/fs-events-hrrg328g.js +21 -0
  13. package/dist/chunks/{git-panel-g01d93vc.js → git-panel-0yywyk76.js} +21 -16
  14. package/dist/chunks/{jx-validate-jj9rnt4n.js → jx-validate-8q2g05x1.js} +6 -4
  15. package/dist/chunks/layers-panel-z3tqe5cd.js +67 -0
  16. package/dist/chunks/layers-q75tj2mf.js +45 -0
  17. package/dist/chunks/lit-html-j055mkh8.js +22 -0
  18. package/dist/chunks/monaco-buffer-dqw0xxpx.js +25 -0
  19. package/dist/chunks/{monaco-setup-a5wkmbgh.js → monaco-setup-rws7k4br.js} +4 -4
  20. package/dist/chunks/notify-yjm79n4s.js +30 -0
  21. package/dist/chunks/parse-24d0gay3.js +19 -0
  22. package/dist/chunks/platform-ba1j1gbh.js +16 -0
  23. package/dist/chunks/publish-panel-54jvhskq.js +28 -0
  24. package/dist/chunks/quick-search-cgfmjwq5.js +65 -0
  25. package/dist/chunks/references-3qx8fkyp.js +29 -0
  26. package/dist/chunks/right-panel-cqp8bc4v.js +46 -0
  27. package/dist/chunks/sp-overlay.dev-yztmtrs1.js +18 -0
  28. package/dist/chunks/sp-popover.dev-n2etmqdp.js +9 -0
  29. package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +15 -0
  30. package/dist/chunks/sp-tooltip.dev-xcvpnqr0.js +15 -0
  31. package/dist/chunks/{sp-tray.dev-64v4pxw8.js → sp-tray.dev-tkbscm06.js} +5 -5
  32. package/dist/chunks/{studio-8ezdegcx.js → studio-1hbqnt19.js} +36 -32
  33. package/dist/chunks/{studio-r5xbtctf.js → studio-2zkz8evn.js} +446 -2451
  34. package/dist/chunks/{studio-pkp61mh8.js → studio-4pqqxbrt.js} +23 -15
  35. package/dist/chunks/{studio-kvfx9z2c.js → studio-4rzyrtjz.js} +70 -31
  36. package/dist/chunks/{studio-3dkcd4c5.js → studio-5q69gfag.js} +60 -56
  37. package/dist/chunks/{studio-rh1cnamv.js → studio-5rywrkxz.js} +563 -133
  38. package/dist/chunks/{studio-6kv3apa9.js → studio-68n67094.js} +25 -9
  39. package/dist/chunks/{studio-0rqqhrdy.js → studio-7nte2hj4.js} +2 -2
  40. package/dist/chunks/{studio-xntfdy1x.js → studio-8swrjbny.js} +31 -18
  41. package/dist/chunks/studio-92ab2jqe.js +282 -0
  42. package/dist/chunks/{studio-sas7mt3k.js → studio-9ab8gqsm.js} +2 -2
  43. package/dist/chunks/{studio-ry1vz5sv.js → studio-9c4k4vhv.js} +15 -13
  44. package/dist/chunks/studio-9n4mrmnb.js +184 -0
  45. package/dist/chunks/{studio-tr20m8g8.js → studio-9r6j5ev1.js} +37 -2
  46. package/dist/chunks/{studio-2x9zbxmx.js → studio-ahjfdy6e.js} +9 -7
  47. package/dist/chunks/{studio-s519zc99.js → studio-bgxt93ga.js} +3 -3
  48. package/dist/chunks/{studio-dc8s8heb.js → studio-cb12yz9w.js} +8528 -8780
  49. package/dist/chunks/studio-cft9r4r7.js +119 -0
  50. package/dist/chunks/{studio-hcxzyk3x.js → studio-eenfkt4e.js} +6 -6
  51. package/dist/chunks/studio-eesa1myv.js +498 -0
  52. package/dist/chunks/{studio-ay8wcr2b.js → studio-eqq1w638.js} +7 -9
  53. package/dist/chunks/{studio-7p35254k.js → studio-ex8zyp98.js} +30 -26
  54. package/dist/chunks/studio-gv8vvshc.js +118 -0
  55. package/dist/chunks/studio-hbtp0eh1.js +1315 -0
  56. package/dist/chunks/{studio-a0yp7syn.js → studio-htsf0w6m.js} +29 -114
  57. package/dist/chunks/{studio-j595e748.js → studio-kjjsjak4.js} +139 -63
  58. package/dist/chunks/{studio-5x5774ak.js → studio-kryvsw6j.js} +3 -3
  59. package/dist/chunks/{studio-kfpek536.js → studio-kyh9avvv.js} +2 -2
  60. package/dist/chunks/{studio-g5gdqnyd.js → studio-kyk2v92a.js} +14 -14
  61. package/dist/chunks/{studio-twsafr1e.js → studio-m3hwn7y1.js} +3 -3
  62. package/dist/chunks/{studio-tzx3xmvx.js → studio-mmv72a27.js} +8 -8
  63. package/dist/chunks/{studio-vhk5fmfv.js → studio-n8b9wqwy.js} +5 -5
  64. package/dist/chunks/{studio-cjm7fdjf.js → studio-p4ngc046.js} +8 -104
  65. package/dist/chunks/{studio-p5dja96s.js → studio-p8j86wag.js} +2 -2
  66. package/dist/chunks/{studio-6z5eyjwn.js → studio-pdfjntbk.js} +66 -129
  67. package/dist/chunks/studio-q43a5y9h.js +394 -0
  68. package/dist/chunks/studio-q7v10cg2.js +106 -0
  69. package/dist/chunks/{studio-2w11grav.js → studio-qq6jym04.js} +3 -3
  70. package/dist/chunks/studio-r1r7afxx.js +1066 -0
  71. package/dist/chunks/{studio-3fk1ac9z.js → studio-rdx8jcxy.js} +4 -4
  72. package/dist/chunks/{studio-4mqb9a0j.js → studio-rn9ta2mz.js} +4 -4
  73. package/dist/chunks/studio-sf7zjgv1.js +91 -0
  74. package/dist/chunks/studio-t7qb9db8.js +665 -0
  75. package/dist/chunks/studio-tmc5emrw.js +8 -0
  76. package/dist/chunks/{studio-wdt9y92a.js → studio-txwkm6p9.js} +2 -2
  77. package/dist/chunks/{studio-k4jvjcfx.js → studio-v38hmvx1.js} +7 -7
  78. package/dist/chunks/{studio-7ejemhej.js → studio-vadzgkrz.js} +6 -6
  79. package/dist/chunks/studio-wcy8trfx.js +263 -0
  80. package/dist/chunks/{studio-5efrtn1m.js → studio-wx5609xd.js} +21 -17
  81. package/dist/chunks/{studio-qpfq7xhm.js → studio-xrapxwwc.js} +22 -285
  82. package/dist/chunks/{studio-hj2se583.js → studio-yxrkyv8a.js} +41 -31
  83. package/dist/chunks/{studio-xm3dbxvn.js → studio-zczps70q.js} +2 -2
  84. package/dist/chunks/workspace-xpres40v.js +89 -0
  85. package/dist/iframe-entry.js +108 -24
  86. package/dist/studio.js +2362 -1695
  87. package/package.json +16 -15
  88. package/src/browse/library-pane.ts +57 -3
  89. package/src/canvas/canvas-render.ts +23 -1
  90. package/src/canvas/iframe-patch.ts +47 -21
  91. package/src/canvas/iframe-render.ts +22 -6
  92. package/src/commands/app-commands.ts +4 -0
  93. package/src/commands/command-args.ts +29 -0
  94. package/src/commands/context.ts +15 -1
  95. package/src/commands/defaults.ts +29 -1
  96. package/src/commands/levels.ts +16 -0
  97. package/src/commands/live-context.ts +3 -0
  98. package/src/content/collection-match.ts +267 -0
  99. package/src/content/entry-commands.ts +38 -29
  100. package/src/content/entry-fields.ts +6 -0
  101. package/src/editor/shortcuts.ts +5 -0
  102. package/src/files/file-ops.ts +10 -42
  103. package/src/files/files.ts +485 -59
  104. package/src/files/fs-events.ts +9 -0
  105. package/src/files/gitignore.ts +432 -0
  106. package/src/files/serialize-document.ts +60 -0
  107. package/src/format/convert-file.ts +511 -0
  108. package/src/format/format-choices.ts +199 -0
  109. package/src/grid/grid-view.ts +16 -2
  110. package/src/media/media-open.ts +58 -0
  111. package/src/media/media-pane.ts +310 -0
  112. package/src/new-project/import-tab.ts +332 -160
  113. package/src/new-project/new-project-modal.ts +27 -34
  114. package/src/packages/ensure-deps.ts +14 -7
  115. package/src/packages/jxsuite-update.ts +11 -11
  116. package/src/page-params.ts +10 -46
  117. package/src/panels/activity-bar.ts +45 -16
  118. package/src/panels/ai-chat/attached-context.ts +6 -1
  119. package/src/panels/ai-chat/chat-view.ts +255 -13
  120. package/src/panels/ai-chat/composer.ts +21 -97
  121. package/src/panels/ai-panel.ts +116 -2
  122. package/src/panels/navigator-panels.ts +7 -6
  123. package/src/panels/settings-menu.ts +799 -0
  124. package/src/panels/toolbar.ts +135 -15
  125. package/src/platforms/cloud.ts +20 -0
  126. package/src/platforms/devserver.ts +67 -33
  127. package/src/preview/preview-overlay.ts +226 -0
  128. package/src/services/ai-ask.ts +247 -0
  129. package/src/services/ai-import-tools.ts +494 -0
  130. package/src/services/ai-project-tools.ts +20 -26
  131. package/src/services/ai-system-prompt.ts +88 -2
  132. package/src/services/ai-turn-signal.ts +70 -0
  133. package/src/services/connection.ts +74 -0
  134. package/src/services/context-manager.ts +89 -0
  135. package/src/services/document-assistant.ts +45 -4
  136. package/src/services/import-client.ts +33 -6
  137. package/src/services/import-run.ts +158 -0
  138. package/src/services/import-seed.ts +120 -0
  139. package/src/services/jx-validate.ts +58 -6
  140. package/src/services/project-adoption.ts +71 -0
  141. package/src/services/references.ts +0 -0
  142. package/src/services/settings/definitions.ts +17 -0
  143. package/src/services/tool-executor.ts +34 -2
  144. package/src/settings/contexts-section.ts +45 -3
  145. package/src/settings/dependencies-editor.ts +43 -23
  146. package/src/settings/general-settings.ts +30 -12
  147. package/src/settings/preferences-dialog.ts +18 -41
  148. package/src/settings/preferences-sections.ts +57 -0
  149. package/src/settings/settings-document.ts +65 -9
  150. package/src/studio.ts +33 -6
  151. package/src/tabs/transact.ts +42 -19
  152. package/src/types.ts +103 -5
  153. package/src/ui/ai-model-picker.ts +162 -0
  154. package/src/ui/choice-field.ts +72 -0
  155. package/src/ui/layers.ts +83 -5
  156. package/src/utils/studio-utils.ts +22 -52
  157. package/styles/forced-colors.css +7 -0
  158. package/styles/overlays.css +256 -0
  159. package/styles/panels.css +13 -1
  160. package/styles/shell.css +111 -0
  161. package/dist/chunks/Overlay.dev-d2ajy6sj.js +0 -23
  162. package/dist/chunks/content-source-7fy9qrm0.js +0 -40
  163. package/dist/chunks/files-xcybanxe.js +0 -70
  164. package/dist/chunks/layers-panel-27essgkc.js +0 -60
  165. package/dist/chunks/publish-panel-09sy2bab.js +0 -22
  166. package/dist/chunks/quick-search-sefb61v8.js +0 -55
  167. package/dist/chunks/right-panel-9r32jd5j.js +0 -39
  168. package/dist/chunks/sp-overlay.dev-s18hymn9.js +0 -18
  169. package/dist/chunks/sp-popover.dev-dj9x7e7a.js +0 -9
  170. package/dist/chunks/sp-progress-circle.dev-0zxcyz3r.js +0 -15
  171. package/dist/chunks/sp-tooltip.dev-5c6d1kjz.js +0 -15
  172. package/dist/chunks/studio-c31yb4t6.js +0 -55
  173. package/src/canvas/site-style-css.ts +0 -117
@@ -1,60 +0,0 @@
1
- import {
2
- OUTLINE_ROW_HEIGHT,
3
- OUTLINE_ROW_MAX_ITEMS,
4
- afterTreeRender,
5
- applyRowSelection,
6
- applyTreeRovingTabindex,
7
- clearHoverActions,
8
- indentWidth,
9
- onTreeHover,
10
- onTreeKeydown,
11
- outlineLabel,
12
- outlineRowPath,
13
- registerLayersPanel,
14
- renderLayersTemplate,
15
- renderRowCommands,
16
- startLayerTitleEdit
17
- } from "./studio-hj2se583.js";
18
- import"./studio-xntfdy1x.js";
19
- import"./studio-6z5eyjwn.js";
20
- import"./studio-0rqqhrdy.js";
21
- import"./studio-p5dja96s.js";
22
- import"./studio-3dkcd4c5.js";
23
- import"./studio-c31yb4t6.js";
24
- import"./studio-bw5dz6km.js";
25
- import"./studio-a0yp7syn.js";
26
- import"./studio-j595e748.js";
27
- import"./studio-r5xbtctf.js";
28
- import"./studio-twsafr1e.js";
29
- import"./studio-kvfx9z2c.js";
30
- import"./studio-5x5774ak.js";
31
- import"./studio-g1wdche0.js";
32
- import"./studio-s519zc99.js";
33
- import"./studio-cjm7fdjf.js";
34
- import"./studio-qpfq7xhm.js";
35
- import"./studio-hcxzyk3x.js";
36
- import"./studio-sas7mt3k.js";
37
- import"./studio-5ehhackm.js";
38
- import"./studio-t5wqwzdh.js";
39
- import"./studio-53n8bp04.js";
40
- import"./studio-a0tswy0w.js";
41
- export {
42
- OUTLINE_ROW_HEIGHT,
43
- OUTLINE_ROW_MAX_ITEMS,
44
- afterTreeRender,
45
- applyRowSelection,
46
- applyTreeRovingTabindex,
47
- clearHoverActions,
48
- indentWidth,
49
- onTreeHover,
50
- onTreeKeydown,
51
- outlineLabel,
52
- outlineRowPath,
53
- registerLayersPanel,
54
- renderLayersTemplate,
55
- renderRowCommands,
56
- startLayerTitleEdit
57
- };
58
-
59
- //# debugId=69EB0FE4C6D6ECEC64756E2164756E21
60
- //# sourceMappingURL=layers-panel-27essgkc.js.map
@@ -1,22 +0,0 @@
1
- import {
2
- openPublishPanel,
3
- seedPublishConnected
4
- } from "./studio-k4jvjcfx.js";
5
- import"./studio-kfpek536.js";
6
- import"./studio-2x9zbxmx.js";
7
- import"./studio-r5xbtctf.js";
8
- import"./studio-kvfx9z2c.js";
9
- import"./studio-5x5774ak.js";
10
- import"./studio-cjm7fdjf.js";
11
- import"./studio-qpfq7xhm.js";
12
- import"./studio-hcxzyk3x.js";
13
- import"./studio-sas7mt3k.js";
14
- import"./studio-5ehhackm.js";
15
- import"./studio-a0tswy0w.js";
16
- export {
17
- openPublishPanel,
18
- seedPublishConnected
19
- };
20
-
21
- //# debugId=FD24D88F217DC7F064756E2164756E21
22
- //# sourceMappingURL=publish-panel-09sy2bab.js.map
@@ -1,55 +0,0 @@
1
- import {
2
- PALETTE_MODES,
3
- closeQuickSearch,
4
- fuzzyScore,
5
- getRecentCommands,
6
- initQuickSearch,
7
- isQuickSearchOpen,
8
- modeSpec,
9
- openQuickSearch,
10
- paletteArgs,
11
- rankBy,
12
- resolvePaletteMode
13
- } from "./studio-g5gdqnyd.js";
14
- import"./studio-rh1cnamv.js";
15
- import"./studio-p5dja96s.js";
16
- import"./studio-7p35254k.js";
17
- import"./studio-8jpzqk5s.js";
18
- import"./studio-pkp61mh8.js";
19
- import"./studio-c31yb4t6.js";
20
- import"./studio-dc8s8heb.js";
21
- import"./studio-2w11grav.js";
22
- import"./studio-bw5dz6km.js";
23
- import"./studio-a0yp7syn.js";
24
- import"./studio-ry1vz5sv.js";
25
- import"./studio-2x9zbxmx.js";
26
- import"./studio-j595e748.js";
27
- import"./studio-r5xbtctf.js";
28
- import"./studio-twsafr1e.js";
29
- import"./studio-kvfx9z2c.js";
30
- import"./studio-5x5774ak.js";
31
- import"./studio-g1wdche0.js";
32
- import"./studio-s519zc99.js";
33
- import"./studio-cjm7fdjf.js";
34
- import"./studio-qpfq7xhm.js";
35
- import"./studio-hcxzyk3x.js";
36
- import"./studio-sas7mt3k.js";
37
- import"./studio-5ehhackm.js";
38
- import"./studio-53n8bp04.js";
39
- import"./studio-a0tswy0w.js";
40
- export {
41
- PALETTE_MODES,
42
- closeQuickSearch,
43
- fuzzyScore,
44
- getRecentCommands,
45
- initQuickSearch,
46
- isQuickSearchOpen,
47
- modeSpec,
48
- openQuickSearch,
49
- paletteArgs,
50
- rankBy,
51
- resolvePaletteMode
52
- };
53
-
54
- //# debugId=7CAA986BAE1AEFC564756E2164756E21
55
- //# sourceMappingURL=quick-search-sefb61v8.js.map
@@ -1,39 +0,0 @@
1
- import {
2
- inspectorTab,
3
- mount,
4
- render,
5
- setInspectorTab,
6
- unmount
7
- } from "./studio-8ezdegcx.js";
8
- import"./studio-xntfdy1x.js";
9
- import"./studio-6z5eyjwn.js";
10
- import"./studio-0rqqhrdy.js";
11
- import"./studio-8jpzqk5s.js";
12
- import"./studio-3dkcd4c5.js";
13
- import"./studio-c31yb4t6.js";
14
- import"./studio-a0yp7syn.js";
15
- import"./studio-j595e748.js";
16
- import"./studio-r5xbtctf.js";
17
- import"./studio-twsafr1e.js";
18
- import"./studio-kvfx9z2c.js";
19
- import"./studio-5x5774ak.js";
20
- import"./studio-g1wdche0.js";
21
- import"./studio-s519zc99.js";
22
- import"./studio-cjm7fdjf.js";
23
- import"./studio-qpfq7xhm.js";
24
- import"./studio-hcxzyk3x.js";
25
- import"./studio-sas7mt3k.js";
26
- import"./studio-5ehhackm.js";
27
- import"./studio-t5wqwzdh.js";
28
- import"./studio-53n8bp04.js";
29
- import"./studio-a0tswy0w.js";
30
- export {
31
- inspectorTab,
32
- mount,
33
- render,
34
- setInspectorTab,
35
- unmount
36
- };
37
-
38
- //# debugId=5E1F64346C2204B264756E2164756E21
39
- //# sourceMappingURL=right-panel-9r32jd5j.js.map
@@ -1,18 +0,0 @@
1
- import"./studio-wdt9y92a.js";
2
- import"./studio-tzx3xmvx.js";
3
- import"./studio-ahnzd9rg.js";
4
- import"./studio-ay8wcr2b.js";
5
- import"./studio-z6nw2ek2.js";
6
- import"./studio-8q517dfr.js";
7
- import"./studio-18j3bmcz.js";
8
- import"./studio-xm3dbxvn.js";
9
- import"./studio-0rqqhrdy.js";
10
- import"./studio-c31yb4t6.js";
11
- import"./studio-2w11grav.js";
12
- import"./studio-twsafr1e.js";
13
- import"./studio-kvfx9z2c.js";
14
- import"./studio-5x5774ak.js";
15
- import"./studio-a0tswy0w.js";
16
-
17
- //# debugId=18A0F7485A8C139064756E2164756E21
18
- //# sourceMappingURL=sp-overlay.dev-s18hymn9.js.map
@@ -1,9 +0,0 @@
1
- import"./studio-3fk1ac9z.js";
2
- import"./studio-18j3bmcz.js";
3
- import"./studio-xm3dbxvn.js";
4
- import"./studio-0rqqhrdy.js";
5
- import"./studio-5x5774ak.js";
6
- import"./studio-a0tswy0w.js";
7
-
8
- //# debugId=AC57102E0028EBFD64756E2164756E21
9
- //# sourceMappingURL=sp-popover.dev-dj9x7e7a.js.map
@@ -1,15 +0,0 @@
1
- import"./studio-vhk5fmfv.js";
2
- import"./studio-ahnzd9rg.js";
3
- import"./studio-ay8wcr2b.js";
4
- import"./studio-18j3bmcz.js";
5
- import"./studio-xm3dbxvn.js";
6
- import"./studio-0rqqhrdy.js";
7
- import"./studio-c31yb4t6.js";
8
- import"./studio-2w11grav.js";
9
- import"./studio-twsafr1e.js";
10
- import"./studio-kvfx9z2c.js";
11
- import"./studio-5x5774ak.js";
12
- import"./studio-a0tswy0w.js";
13
-
14
- //# debugId=6CCEFD43C09F3F2A64756E2164756E21
15
- //# sourceMappingURL=sp-progress-circle.dev-0zxcyz3r.js.map
@@ -1,15 +0,0 @@
1
- import"./studio-7ejemhej.js";
2
- import"./studio-ay8wcr2b.js";
3
- import"./studio-8q517dfr.js";
4
- import"./studio-18j3bmcz.js";
5
- import"./studio-xm3dbxvn.js";
6
- import"./studio-0rqqhrdy.js";
7
- import"./studio-c31yb4t6.js";
8
- import"./studio-2w11grav.js";
9
- import"./studio-twsafr1e.js";
10
- import"./studio-kvfx9z2c.js";
11
- import"./studio-5x5774ak.js";
12
- import"./studio-a0tswy0w.js";
13
-
14
- //# debugId=6CCEFD43C09F3F2A64756E2164756E21
15
- //# sourceMappingURL=sp-tooltip.dev-5c6d1kjz.js.map
@@ -1,55 +0,0 @@
1
- import {
2
- Directive,
3
- PartType,
4
- directive,
5
- isSingleExpression,
6
- setCommittedValue
7
- } from "./studio-kvfx9z2c.js";
8
- import {
9
- noChange,
10
- nothing
11
- } from "./studio-5x5774ak.js";
12
-
13
- // ../../node_modules/lit-html/development/directives/live.js
14
- class LiveDirective extends Directive {
15
- constructor(partInfo) {
16
- super(partInfo);
17
- if (!(partInfo.type === PartType.PROPERTY || partInfo.type === PartType.ATTRIBUTE || partInfo.type === PartType.BOOLEAN_ATTRIBUTE)) {
18
- throw new Error("The `live` directive is not allowed on child or event bindings");
19
- }
20
- if (!isSingleExpression(partInfo)) {
21
- throw new Error("`live` bindings can only contain a single expression");
22
- }
23
- }
24
- render(value) {
25
- return value;
26
- }
27
- update(part, [value]) {
28
- if (value === noChange || value === nothing) {
29
- return value;
30
- }
31
- const element = part.element;
32
- const name = part.name;
33
- if (part.type === PartType.PROPERTY) {
34
- if (value === element[name]) {
35
- return noChange;
36
- }
37
- } else if (part.type === PartType.BOOLEAN_ATTRIBUTE) {
38
- if (!!value === element.hasAttribute(name)) {
39
- return noChange;
40
- }
41
- } else if (part.type === PartType.ATTRIBUTE) {
42
- if (element.getAttribute(name) === String(value)) {
43
- return noChange;
44
- }
45
- }
46
- setCommittedValue(part);
47
- return value;
48
- }
49
- }
50
- var live = directive(LiveDirective);
51
-
52
- export { live };
53
-
54
- //# debugId=D34FC2E2E606E1C064756E2164756E21
55
- //# sourceMappingURL=studio-c31yb4t6.js.map
@@ -1,117 +0,0 @@
1
- /// <reference lib="dom" />
2
- /**
3
- * Site-style stylesheet builder — pure functions extracted for testability.
4
- *
5
- * The canvas iframe injects the project's `style` as a real stylesheet instead of inline properties
6
- * on the root element: inline custom properties would defeat the forced-scheme override selectors
7
- * (`:root[data-color-scheme]`, spec §9.5), and object-valued `@--name` blocks used to be dropped
8
- * entirely. Scheme-query blocks dual-emit through the runtime's schemeSelectors so the canvas
9
- * honors both the OS preference and the preview toggle.
10
- */
11
-
12
- import { pureSchemeOf, resolveAtQuery, schemeSelectors, camelToKebab } from "@jxsuite/runtime";
13
-
14
- /** Id of the injected site-style tag (replace-in-place, never accumulate). */
15
- export const SITE_STYLE_ID = "jx-site-style";
16
-
17
- /** Serialize scalar declarations, kebab-casing property names and transposing values. */
18
- function toDecls(props: Record<string, unknown>, transpose: (value: string) => string): string {
19
- return Object.entries(props)
20
- .map(([key, value]) => `${camelToKebab(key)}: ${transpose(String(value))}`)
21
- .join("; ");
22
- }
23
-
24
- /**
25
- * Build the site-style sheet text: custom properties on `:root`, plain properties on `body`,
26
- * conditional `@`-blocks resolved against `mediaQueries` (scheme queries dual-emitted per the
27
- * forced-scheme contract), and `color-scheme: light dark` declared when a scheme query exists.
28
- *
29
- * @param {Record<string, unknown>} siteStyle
30
- * @param {Record<string, string>} mediaQueries
31
- * @param {(value: string) => string} transpose - Unit transposer (canvas vh→cqh etc.)
32
- * @returns {string}
33
- */
34
- export function buildSiteStyleCSS(
35
- siteStyle: Record<string, unknown>,
36
- mediaQueries: Record<string, string>,
37
- transpose: (value: string) => string,
38
- ): string {
39
- const rules: string[] = [];
40
- const rootProps: Record<string, unknown> = {};
41
- const bodyProps: Record<string, unknown> = {};
42
- const condBlocks: [string, Record<string, unknown>][] = [];
43
-
44
- for (const [key, value] of Object.entries(siteStyle)) {
45
- if (value !== null && typeof value === "object" && !Array.isArray(value)) {
46
- if (key.startsWith("@")) {
47
- condBlocks.push([key, value as Record<string, unknown>]);
48
- }
49
- // Non-@ objects (nested element selectors) are page-content styling — the resolved doc's
50
- // Own style pass covers those; the site sheet handles tokens + conditional overrides.
51
- continue;
52
- }
53
- if (key.startsWith(":") || key.startsWith(".") || key.startsWith("[") || key.startsWith("@")) {
54
- continue;
55
- }
56
- if (key.startsWith("--")) {
57
- rootProps[key] = value;
58
- } else {
59
- bodyProps[key] = value;
60
- }
61
- }
62
-
63
- const rootCSS = toDecls(rootProps, transpose);
64
- if (rootCSS) {
65
- rules.push(`:root { ${rootCSS} }`);
66
- }
67
- const bodyCSS = toDecls(bodyProps, transpose);
68
- if (bodyCSS) {
69
- rules.push(`body { ${bodyCSS} }`);
70
- }
71
-
72
- for (const [atKey, block] of condBlocks) {
73
- const query = resolveAtQuery(atKey, mediaQueries);
74
- if (query === null) {
75
- continue;
76
- }
77
- const scheme = pureSchemeOf(query);
78
- const emit = (selector: string, props: string) => {
79
- if (!props) {
80
- return;
81
- }
82
- if (scheme) {
83
- const { auto, forced } = schemeSelectors(selector, scheme);
84
- rules.push(`@media ${query} { ${auto} { ${props} } }`, `${forced} { ${props} }`);
85
- } else {
86
- rules.push(`@media ${query} { ${selector} { ${props} } }`);
87
- }
88
- };
89
- const condRoot: Record<string, unknown> = {};
90
- const condBody: Record<string, unknown> = {};
91
- const condSubs: [string, Record<string, unknown>][] = [];
92
- for (const [k, v] of Object.entries(block)) {
93
- if (v !== null && typeof v === "object" && !Array.isArray(v)) {
94
- if (!k.startsWith("@")) {
95
- condSubs.push([k, v as Record<string, unknown>]);
96
- }
97
- continue;
98
- }
99
- if (k.startsWith("--")) {
100
- condRoot[k] = v;
101
- } else {
102
- condBody[k] = v;
103
- }
104
- }
105
- emit(":root", toDecls(condRoot, transpose));
106
- emit("body", toDecls(condBody, transpose));
107
- for (const [sel, sub] of condSubs) {
108
- emit(sel, toDecls(sub, transpose));
109
- }
110
- }
111
-
112
- if (Object.values(mediaQueries).some((q) => pureSchemeOf(q) !== null)) {
113
- rules.push(":root { color-scheme: light dark }");
114
- }
115
-
116
- return rules.join("\n");
117
- }