@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
@@ -6,128 +6,31 @@ import {
6
6
  loopbackAssetSrc,
7
7
  normalizeProjectPath,
8
8
  projectLocales
9
- } from "./studio-j595e748.js";
9
+ } from "./studio-kjjsjak4.js";
10
10
  import {
11
- activeTab,
12
11
  errorMessage
13
- } from "./studio-r5xbtctf.js";
12
+ } from "./studio-9n4mrmnb.js";
13
+ import {
14
+ activeTab
15
+ } from "./studio-2zkz8evn.js";
16
+ import {
17
+ notify
18
+ } from "./studio-xrapxwwc.js";
14
19
  import {
15
20
  getNodeAtPath,
16
- isJsonObject,
17
- paramNames,
18
21
  projectState
19
- } from "./studio-cjm7fdjf.js";
22
+ } from "./studio-p4ngc046.js";
20
23
  import {
21
- notify
22
- } from "./studio-qpfq7xhm.js";
24
+ isJsonObject,
25
+ paramNames
26
+ } from "./studio-q7v10cg2.js";
23
27
  import {
24
28
  loadedMonaco
25
- } from "./studio-hcxzyk3x.js";
29
+ } from "./studio-eenfkt4e.js";
26
30
  import {
27
31
  getPlatform,
28
32
  hasPlatform
29
- } from "./studio-sas7mt3k.js";
30
-
31
- // src/services/references.ts
32
- function usagesSupported() {
33
- return hasPlatform() && typeof getPlatform().findReferences === "function";
34
- }
35
- function keyOf(query) {
36
- return `${query.path ?? ""}\x00${query.tagName ?? ""}`;
37
- }
38
- var settled = new Map;
39
- var inFlight = new Map;
40
- function peekUsages(query) {
41
- if (!usagesSupported()) {
42
- return { status: "unsupported" };
43
- }
44
- return settled.get(keyOf(query)) ?? (inFlight.has(keyOf(query)) ? { status: "pending" } : null);
45
- }
46
- async function loadUsages(query) {
47
- if (!usagesSupported()) {
48
- return { status: "unsupported" };
49
- }
50
- if (!query.path && !query.tagName) {
51
- return { status: "failed", message: "no target to look for" };
52
- }
53
- const key = keyOf(query);
54
- const done = settled.get(key);
55
- if (done) {
56
- return done;
57
- }
58
- const running = inFlight.get(key);
59
- if (running) {
60
- return running;
61
- }
62
- const pending = (async () => {
63
- try {
64
- const result = await getPlatform().findReferences({
65
- ...query.path === undefined ? {} : { path: query.path },
66
- ...query.tagName === undefined ? {} : { tagName: query.tagName }
67
- });
68
- return { result, status: "ready" };
69
- } catch (error) {
70
- return { message: errorMessage(error), status: "failed" };
71
- } finally {
72
- inFlight.delete(key);
73
- }
74
- })();
75
- inFlight.set(key, pending);
76
- const state = await pending;
77
- settled.set(key, state);
78
- return state;
79
- }
80
- function retryUsages(query) {
81
- settled.delete(keyOf(query));
82
- return loadUsages(query);
83
- }
84
- function invalidateUsages() {
85
- settled.clear();
86
- }
87
- function splitUsages(result) {
88
- let pages = 0;
89
- for (const file of result.files) {
90
- if (file.path.startsWith("pages/")) {
91
- pages += 1;
92
- }
93
- }
94
- return { others: result.files.length - pages, pages };
95
- }
96
- function usageHeadline(result) {
97
- const { others, pages } = splitUsages(result);
98
- if (pages === 0 && others === 0) {
99
- return "Not used yet";
100
- }
101
- const parts = [];
102
- if (pages > 0) {
103
- parts.push(`${pages} page${pages === 1 ? "" : "s"}`);
104
- }
105
- if (others > 0) {
106
- parts.push(`${others} other file${others === 1 ? "" : "s"}`);
107
- }
108
- return `Used on ${parts.join(" and ")}`;
109
- }
110
- function usageWarning(state, verb) {
111
- if (state.status === "unsupported") {
112
- return null;
113
- }
114
- if (state.status === "pending") {
115
- return "Counting references…";
116
- }
117
- if (state.status === "failed") {
118
- return `References could not be counted (${state.message}) — this may break more than it appears to.`;
119
- }
120
- const { files, refsTotal } = state.result;
121
- if (files.length === 0) {
122
- return verb === "delete" ? "Nothing else in this project refers to it." : "Nothing else in this project refers to it, so nothing needs updating.";
123
- }
124
- const where = `${refsTotal} reference${refsTotal === 1 ? "" : "s"} in ${files.length} file${files.length === 1 ? "" : "s"}`;
125
- const floor = state.result.errors.length > 0 ? " (at least — some documents could not be read)" : "";
126
- return verb === "delete" ? `${where}${floor} will break. Those files stay on disk; the references in them stop resolving.` : `${where}${floor} will be updated automatically. Nothing else changes.`;
127
- }
128
- function usageFiles(result) {
129
- return result.files.toSorted((a, b) => b.count - a.count || a.path.localeCompare(b.path));
130
- }
33
+ } from "./studio-9ab8gqsm.js";
131
34
 
132
35
  // src/files/media-upload.ts
133
36
  var IMAGE_EXTENSIONS = new Set([
@@ -303,6 +206,13 @@ async function codeService(action, payload) {
303
206
  }
304
207
  return platform.codeService(action, payload);
305
208
  }
209
+ async function locateDocument(name) {
210
+ const platform = getPlatform();
211
+ if (!platform.locateFile) {
212
+ return null;
213
+ }
214
+ return platform.locateFile(name);
215
+ }
306
216
  var pluginSchemaCache = new Map;
307
217
  async function fetchPluginSchema(def, state) {
308
218
  const importedPath = def.$prototype ? projectState?.projectConfig?.imports?.[def.$prototype] : null;
@@ -393,6 +303,11 @@ function baseName(path) {
393
303
  const slash = normalized.lastIndexOf("/");
394
304
  return slash === -1 ? normalized : normalized.slice(slash + 1);
395
305
  }
306
+ function dirName(path) {
307
+ const normalized = normalizeProjectPath(path);
308
+ const slash = normalized.lastIndexOf("/");
309
+ return slash === -1 ? "." : normalized.slice(0, slash);
310
+ }
396
311
  function contentSections() {
397
312
  const content = projectState?.projectConfig?.content;
398
313
  return content ?? null;
@@ -442,7 +357,7 @@ function previewFileSrc(path) {
442
357
  return loopbackAssetSrc(mediaSiteUrl(normalized));
443
358
  }
444
359
 
445
- export { usagesSupported, peekUsages, loadUsages, retryUsages, invalidateUsages, usageHeadline, usageWarning, usageFiles, IMAGE_EXTENSIONS, MEDIA_EXTENSIONS, uploadAccept, extensionOf, isImage, isMediaFile, mediaKind, setMediaChangedHandler, uploadAssets, baseName, mediaSiteUrl, authoredRefTargets, previewFileSrc, codeService, pluginSchemaCache, fetchPluginSchema, setLintMarkers, getFunctionArgs };
360
+ export { IMAGE_EXTENSIONS, MEDIA_EXTENSIONS, uploadAccept, extensionOf, isImage, isMediaFile, mediaKind, setMediaChangedHandler, uploadAssets, baseName, dirName, mediaSiteUrl, authoredRefTargets, previewFileSrc, codeService, locateDocument, pluginSchemaCache, fetchPluginSchema, setLintMarkers, getFunctionArgs };
446
361
 
447
- //# debugId=453431DCD360BB2764756E2164756E21
448
- //# sourceMappingURL=studio-a0yp7syn.js.map
362
+ //# debugId=380CBD6692440DE664756E2164756E21
363
+ //# sourceMappingURL=studio-htsf0w6m.js.map
@@ -1,24 +1,28 @@
1
+ import {
2
+ distributePageIntoLayout,
3
+ getEffectiveElements,
4
+ getEffectiveHead,
5
+ getEffectiveImports,
6
+ getEffectiveLayoutPath,
7
+ getEffectiveLocales,
8
+ getEffectiveMedia,
9
+ resolveLayoutDoc,
10
+ setLayoutSelection,
11
+ shell
12
+ } from "./studio-hbtp0eh1.js";
1
13
  import {
2
14
  PRIMARY_PANE,
3
15
  activeTab,
4
- allCanvasSurfaces,
5
16
  argsSchema,
6
17
  booleanArg,
7
18
  booleanProperty,
8
19
  boundedNumberArg,
9
20
  cloneSelection,
10
21
  collabState,
11
- distributePageIntoLayout,
12
22
  emptyContext,
13
23
  enumArg,
14
24
  enumProperty,
15
25
  focusPane,
16
- getEffectiveElements,
17
- getEffectiveHead,
18
- getEffectiveImports,
19
- getEffectiveLayoutPath,
20
- getEffectiveLocales,
21
- getEffectiveMedia,
22
26
  isTabActive,
23
27
  localeDirection,
24
28
  mutateInsertNode,
@@ -30,31 +34,42 @@ import {
30
34
  paneById,
31
35
  primarySelection,
32
36
  resolveI18n,
33
- resolveLayoutDoc,
34
- setLayoutSelection,
35
- shell,
36
- stageContaining,
37
37
  stringArg,
38
38
  stringProperty,
39
- surfaceForPane,
40
39
  toggleSelected,
41
40
  transact,
42
41
  transactDoc,
43
- view,
44
42
  workspace
45
- } from "./studio-r5xbtctf.js";
43
+ } from "./studio-2zkz8evn.js";
44
+ import {
45
+ allCanvasSurfaces,
46
+ stageContaining,
47
+ surfaceForPane,
48
+ view
49
+ } from "./studio-wcy8trfx.js";
50
+ import {
51
+ computed,
52
+ effect,
53
+ effectScope,
54
+ isRef as isRef2,
55
+ notify,
56
+ onEffectCleanup,
57
+ reactive,
58
+ ref,
59
+ toRaw
60
+ } from "./studio-xrapxwwc.js";
46
61
  import {
47
62
  classMap,
48
63
  ifDefined,
49
64
  styleMap
50
- } from "./studio-twsafr1e.js";
65
+ } from "./studio-m3hwn7y1.js";
51
66
  import {
52
67
  ref as ref2
53
- } from "./studio-kvfx9z2c.js";
68
+ } from "./studio-4rzyrtjz.js";
54
69
  import {
55
70
  html,
56
71
  nothing
57
- } from "./studio-5x5774ak.js";
72
+ } from "./studio-kryvsw6j.js";
58
73
  import {
59
74
  _defineProperty,
60
75
  combine,
@@ -66,15 +81,23 @@ import {
66
81
  buildComponentInstance,
67
82
  componentRegistry,
68
83
  computeRelativePath
69
- } from "./studio-s519zc99.js";
84
+ } from "./studio-bgxt93ga.js";
70
85
  import {
71
- bodyReturnsValue,
72
86
  childIndex,
73
87
  childList,
74
- displayTagName,
75
88
  getNodeAtPath,
76
- hasStructuredBody,
77
89
  isAncestor,
90
+ leftPanel,
91
+ parentElementPath,
92
+ pathsEqual,
93
+ projectState,
94
+ renderOnly,
95
+ stripEventHandlers
96
+ } from "./studio-p4ngc046.js";
97
+ import {
98
+ bodyReturnsValue,
99
+ displayTagName,
100
+ hasStructuredBody,
78
101
  isExpressionDef,
79
102
  isFunctionDef,
80
103
  isJsonObject,
@@ -86,33 +109,16 @@ import {
86
109
  isServerFnDef,
87
110
  isTagExpression,
88
111
  isTemplateString,
89
- leftPanel,
90
- paramNames,
91
- parentElementPath,
92
- pathsEqual,
93
- projectState,
94
- renderOnly,
95
- stripEventHandlers
96
- } from "./studio-cjm7fdjf.js";
97
- import {
98
- computed,
99
- effect,
100
- effectScope,
101
- isRef as isRef2,
102
- notify,
103
- onEffectCleanup,
104
- reactive,
105
- ref,
106
- toRaw
107
- } from "./studio-qpfq7xhm.js";
112
+ paramNames
113
+ } from "./studio-q7v10cg2.js";
108
114
  import {
109
115
  formatByName,
110
116
  loadExtensions
111
- } from "./studio-hcxzyk3x.js";
117
+ } from "./studio-eenfkt4e.js";
112
118
  import {
113
119
  getPlatform,
114
120
  hasPlatform
115
- } from "./studio-sas7mt3k.js";
121
+ } from "./studio-9ab8gqsm.js";
116
122
  import {
117
123
  bundleUrl
118
124
  } from "./studio-53n8bp04.js";
@@ -195,23 +201,18 @@ function tabOfContainer(container) {
195
201
  return tabOfPane(paneOfContainer(container));
196
202
  }
197
203
 
198
- // src/page-params.ts
204
+ // ../site/src/routes.ts
199
205
  var PARAM_SEGMENT = /\[\.\.\.(\w+)\]|\[(\w+)\]/g;
200
- function dynamicRouteParams(documentPath) {
201
- if (!documentPath) {
202
- return [];
203
- }
204
- const params = [];
205
- for (const match of documentPath.matchAll(PARAM_SEGMENT)) {
206
- params.push(match[1] ?? match[2]);
207
- }
208
- return params;
206
+ function pageRelativePath(documentPath) {
207
+ return documentPath.split("\\").join("/").replace(/^\.\//, "").replace(/^\//, "").replace(/^pages\//, "");
209
208
  }
210
- function documentUrlPattern(documentPath) {
211
- if (!documentPath) {
212
- return "/";
209
+ function fileToRoute(relativePath) {
210
+ let urlPath = pageRelativePath(relativePath);
211
+ const lastSegment = urlPath.slice(urlPath.lastIndexOf("/") + 1);
212
+ const dot = lastSegment.lastIndexOf(".");
213
+ if (dot > 0) {
214
+ urlPath = urlPath.slice(0, urlPath.length - (lastSegment.length - dot));
213
215
  }
214
- let urlPath = documentPath.replace(/^\.\//, "").replace(/^pages\//, "").replace(/\.[^/.]+$/, "");
215
216
  if (urlPath.endsWith("/index")) {
216
217
  urlPath = urlPath.slice(0, -6) || "/";
217
218
  } else if (urlPath === "index") {
@@ -220,8 +221,35 @@ function documentUrlPattern(documentPath) {
220
221
  if (!urlPath.startsWith("/")) {
221
222
  urlPath = `/${urlPath}`;
222
223
  }
223
- return urlPath.replaceAll(PARAM_SEGMENT, (_match, spread, named) => spread ? "*" : `:${named}`);
224
+ const params = [];
225
+ let isDynamic = false;
226
+ let isCatchAll = false;
227
+ const urlPattern = urlPath.replaceAll(PARAM_SEGMENT, (_match, spread, named) => {
228
+ isDynamic = true;
229
+ if (spread) {
230
+ isCatchAll = true;
231
+ params.push(spread);
232
+ return "*";
233
+ }
234
+ params.push(named);
235
+ return `:${named}`;
236
+ });
237
+ return { isCatchAll, isDynamic, params, urlPattern };
224
238
  }
239
+ function documentUrlPattern(documentPath) {
240
+ if (!documentPath) {
241
+ return "/";
242
+ }
243
+ return fileToRoute(documentPath).urlPattern;
244
+ }
245
+ function dynamicRouteParams(documentPath) {
246
+ if (!documentPath) {
247
+ return [];
248
+ }
249
+ return fileToRoute(documentPath).params;
250
+ }
251
+
252
+ // src/page-params.ts
225
253
  function pagePathsDef(doc) {
226
254
  const fromDoc = doc.document?.$paths;
227
255
  const fromFrontmatter = doc.frontmatter?.$paths;
@@ -3222,6 +3250,32 @@ function evaluateTemplate(str, state) {
3222
3250
  const fn = new Function("state", "$map", "item", "index", `return \`${str}\``);
3223
3251
  return fn(state, $map, $map?.item, $map?.index);
3224
3252
  }
3253
+ function isSingleExpression(str) {
3254
+ if (!str.startsWith("${") || !str.endsWith("}")) {
3255
+ return false;
3256
+ }
3257
+ let depth = 0;
3258
+ for (let i = 1;i < str.length; i += 1) {
3259
+ const c = str[i];
3260
+ if (c === "{") {
3261
+ depth += 1;
3262
+ } else if (c === "}") {
3263
+ depth -= 1;
3264
+ if (depth === 0) {
3265
+ return i === str.length - 1;
3266
+ }
3267
+ }
3268
+ }
3269
+ return false;
3270
+ }
3271
+ function evaluateAttrTemplate(str, state) {
3272
+ if (!isSingleExpression(str)) {
3273
+ return evaluateTemplate(str, state);
3274
+ }
3275
+ const $map = state?.$map;
3276
+ const fn = new Function("state", "$map", "item", "index", `return (${str.slice(2, -1)})`);
3277
+ return fn(state, $map, $map?.item, $map?.index);
3278
+ }
3225
3279
  var _moduleCache = new Map;
3226
3280
  async function resolveFunction(def, state, key, base) {
3227
3281
  if (def.body && def.$src) {
@@ -3608,16 +3662,33 @@ function applyStyle(el, styleDef, mediaQueries = {}, state = {}) {
3608
3662
  elementStyleTags.set(el, tag);
3609
3663
  }
3610
3664
  var elementStyleTags = new WeakMap;
3665
+ var ENUMERATED_ATTRS = new Set(["contenteditable", "draggable", "spellcheck"]);
3666
+ function booleanAttrValue(name, value) {
3667
+ const lower = name.toLowerCase();
3668
+ if (lower.startsWith("aria-") || ENUMERATED_ATTRS.has(lower)) {
3669
+ return String(value);
3670
+ }
3671
+ return value ? "" : null;
3672
+ }
3611
3673
  function applyAttributes(el, attrs, state) {
3612
3674
  for (const [k, v] of Object.entries(attrs)) {
3613
3675
  const attr = canvasAttrName(el, k);
3614
3676
  const write = (resolved) => {
3677
+ if (typeof resolved === "boolean") {
3678
+ const text = booleanAttrValue(attr, resolved);
3679
+ if (text === null) {
3680
+ el.removeAttribute(attr);
3681
+ } else {
3682
+ el.setAttribute(attr, text);
3683
+ }
3684
+ return;
3685
+ }
3615
3686
  el.setAttribute(attr, canvasAssetValue(el.tagName, k, String(resolved ?? "")));
3616
3687
  };
3617
3688
  if (isRefObj(v)) {
3618
3689
  effect(() => write(resolveRef(v.$ref, state)));
3619
3690
  } else if (isTemplateString(v)) {
3620
- effect(() => write(evaluateTemplate(v, state)));
3691
+ effect(() => write(evaluateAttrTemplate(v, state)));
3621
3692
  } else {
3622
3693
  write(v);
3623
3694
  }
@@ -7853,7 +7924,7 @@ function openPageAction(label = "Open a page…") {
7853
7924
  return {
7854
7925
  label,
7855
7926
  run: () => {
7856
- import("./quick-search-sefb61v8.js").then((m) => {
7927
+ import("./quick-search-cgfmjwq5.js").then((m) => {
7857
7928
  m.openQuickSearch();
7858
7929
  });
7859
7930
  }
@@ -7917,6 +7988,7 @@ var PLACEMENTS = [
7917
7988
  "blockbar",
7918
7989
  "blockbar/format",
7919
7990
  "outline/row",
7991
+ "settings/menu",
7920
7992
  "palette",
7921
7993
  "never"
7922
7994
  ];
@@ -7943,6 +8015,10 @@ var PLACEMENT_MATRIX = {
7943
8015
  note: "the bar's inline-format cluster — a range inside the selection is still the selection"
7944
8016
  },
7945
8017
  "outline/row": { admits: ["selection"], note: "row actions act on the row's node" },
8018
+ "settings/menu": {
8019
+ admits: ["application", "project"],
8020
+ note: "the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it " + "may host two levels for the reason commandbar/overflow does: a menu prints each row's own " + "name, chord and gate, and draws a divider where the level changes. The rail's PINNED " + "groups stay single-level, in PANEL_PLACEMENT_MATRIX"
8021
+ },
7946
8022
  palette: {
7947
8023
  admits: ["application", "project", "document", "selection"],
7948
8024
  note: "the level-agnostic surface; it groups rows by level"
@@ -8123,7 +8199,7 @@ function railPanelSet() {
8123
8199
  return RAIL_GROUP_LEVELS.flatMap(({ level }) => railable.filter((panel) => panel.level === level));
8124
8200
  }
8125
8201
 
8126
- export { KEY_SCOPES, CATEGORIES, checkRecordPlacements, intlHelpersClause, PURE_METHOD_OPS, BLESSED_OPERATORS, BLESSED_GLOBALS, isMutating, evaluateExpression, rectOf, loopbackAssetSrc, getPreviewNavigateHandler, activeCanvasSurface, tabOfPane, derivationOfPane, surfacesShowingTab, canvasModeOfTab, canvasModeOfPane, activeMediaOfPane, paneOfContainer, tabOfContainer, dynamicRouteParams, documentUrlPattern, pagePathsDef, invalidateParamValues, loadParamValues, isComponentDoc, componentPropEntries, PUBLIC_DIR, normalizeProjectPath, encodeProjectPath, contentMountFor, resolveAssetRef, projectLocales, assetContextFor, previewAssetSrc, hostAssetDeclarations, SPAN_FULL_RENDER, SPAN_MOUNT_CANVAS, SPAN_PATCH_BATCH, canvasPerf, recordEscalation, timeSpan, timeSpanAsync, mediaDisplayName, defaultDef, parentCursorToIframe, serializeJxPath, elements_meta_default, getInlineActions, isInlineElement, isEditing, bubbleInlinePath, stageZoom, canvasPanelTemplate, observeCenterUntilStable, applyTransform, applyEditZoom, setEditZoom, requestEditZoom, fitToScreen, getFit, setFit, markExplicitZoom, setUserZoom, fitOnCanvasEntry, resetZoom, panToElement, canvasBaseViewsFor, canvasBaseViewOf, previewStateOf, setCanvasView, registerCanvasViewCommands, updateActivePanelHeaders, setDragGhost, moveDragGhost, clearDragGhost, disableNativeDragPreview, attachInstruction, extractInstruction, hasElement, enableElement, disableElement, removePackageElements, removeElementRef, setSkipServerFunctions, runScoped, setCanvasAssetResolver, buildScope, renderNode, pureSchemeOf, renderComponentPreview, registerLayersDnD, registerComponentsDnD, registerElementsDnD, applyDropInstruction, sawIframeDragOver, allowAutoRequestsOnNextRender, requestCanvasEval, flushCanvasEdits, liveDragHostAt, beginDragSession, currentDragSession, hostDragGeometry, canvasIdleBlockers, canvasPointAt, revealCanvasPath, adoptCanvasPreviewMode, postDragMessage, endDragSession, clearDropIndicator, setNativeDragEnterHandler, setInsertZoneClickHandler, setFileDropHandler, setCanvasSlashHandler, setCanvasContextMenuHandler, setStylebookHitHandler, isCaretActive, setToolbarRefresh, setCanvasPointerDownHandler, setIframePatchEscalation, postPatchToHosts, dragHostTab, releaseCanvasHosts, mountIframeCanvas, mountStylebookCanvas, postColorSchemeToLiveHosts, postLocaleToLiveHosts, postSiteStyleToLiveHosts, postStyleUpdateToStylebookHosts, panToStylebookTag, getEditSnapshot, setKeymapSource, postApplyFormat, postOpenSlash, commitActiveEditSession, getEditBarAnchorRect, clickAnythingTo, staleSelectionMessage, openPageAction, renderEmptyState, panelContext, registerPanel, getPanel, listPanels, isPanelVisible, railGroups, railPanelSet };
8202
+ export { LEVELS, KEY_SCOPES, CATEGORIES, checkRecordPlacements, intlHelpersClause, PURE_METHOD_OPS, BLESSED_OPERATORS, BLESSED_GLOBALS, isMutating, evaluateExpression, rectOf, loopbackAssetSrc, getPreviewNavigateHandler, activeCanvasSurface, tabOfPane, derivationOfPane, surfacesShowingTab, canvasModeOfTab, canvasModeOfPane, activeMediaOfPane, paneOfContainer, tabOfContainer, documentUrlPattern, dynamicRouteParams, pagePathsDef, invalidateParamValues, loadParamValues, isComponentDoc, componentPropEntries, PUBLIC_DIR, normalizeProjectPath, encodeProjectPath, contentMountFor, resolveAssetRef, projectLocales, assetContextFor, previewAssetSrc, hostAssetDeclarations, SPAN_FULL_RENDER, SPAN_MOUNT_CANVAS, SPAN_PATCH_BATCH, canvasPerf, recordEscalation, timeSpan, timeSpanAsync, mediaDisplayName, defaultDef, parentCursorToIframe, serializeJxPath, elements_meta_default, getInlineActions, isInlineElement, isEditing, bubbleInlinePath, stageZoom, canvasPanelTemplate, observeCenterUntilStable, applyTransform, applyEditZoom, setEditZoom, requestEditZoom, fitToScreen, getFit, setFit, markExplicitZoom, setUserZoom, fitOnCanvasEntry, resetZoom, panToElement, canvasBaseViewsFor, canvasBaseViewOf, previewStateOf, setCanvasView, registerCanvasViewCommands, updateActivePanelHeaders, setDragGhost, moveDragGhost, clearDragGhost, disableNativeDragPreview, attachInstruction, extractInstruction, hasElement, enableElement, disableElement, removePackageElements, removeElementRef, setSkipServerFunctions, runScoped, setCanvasAssetResolver, buildScope, renderNode, pureSchemeOf, renderComponentPreview, registerLayersDnD, registerComponentsDnD, registerElementsDnD, applyDropInstruction, sawIframeDragOver, allowAutoRequestsOnNextRender, requestCanvasEval, flushCanvasEdits, liveDragHostAt, beginDragSession, currentDragSession, hostDragGeometry, canvasIdleBlockers, canvasPointAt, revealCanvasPath, adoptCanvasPreviewMode, postDragMessage, endDragSession, clearDropIndicator, setNativeDragEnterHandler, setInsertZoneClickHandler, setFileDropHandler, setCanvasSlashHandler, setCanvasContextMenuHandler, setStylebookHitHandler, isCaretActive, setToolbarRefresh, setCanvasPointerDownHandler, setIframePatchEscalation, postPatchToHosts, dragHostTab, releaseCanvasHosts, mountIframeCanvas, mountStylebookCanvas, postColorSchemeToLiveHosts, postLocaleToLiveHosts, postSiteStyleToLiveHosts, postStyleUpdateToStylebookHosts, panToStylebookTag, getEditSnapshot, setKeymapSource, postApplyFormat, postOpenSlash, commitActiveEditSession, getEditBarAnchorRect, clickAnythingTo, staleSelectionMessage, openPageAction, renderEmptyState, panelContext, registerPanel, getPanel, listPanels, isPanelVisible, railGroups, railPanelSet };
8127
8203
 
8128
- //# debugId=A13D4D75476DBAED64756E2164756E21
8129
- //# sourceMappingURL=studio-j595e748.js.map
8204
+ //# debugId=124567CCB82F091564756E2164756E21
8205
+ //# sourceMappingURL=studio-kjjsjak4.js.map
@@ -863,7 +863,7 @@ if (ENABLE_EXTRA_SECURITY_HOOKS) {
863
863
  }
864
864
  }
865
865
 
866
- export { html, noChange, nothing, _$LH, render };
866
+ export { html, svg, mathml, noChange, nothing, _$LH, render };
867
867
 
868
- //# debugId=1DBF1933B28907E764756E2164756E21
869
- //# sourceMappingURL=studio-5x5774ak.js.map
868
+ //# debugId=1C0B1A035614AD0F64756E2164756E21
869
+ //# sourceMappingURL=studio-kryvsw6j.js.map
@@ -3,7 +3,7 @@ import {
3
3
  clearSettings,
4
4
  readStoredSetting,
5
5
  setSetting
6
- } from "./studio-qpfq7xhm.js";
6
+ } from "./studio-92ab2jqe.js";
7
7
 
8
8
  // src/services/cf-settings.ts
9
9
  function getCfToken() {
@@ -25,4 +25,4 @@ function clearCfConnection() {
25
25
  export { getCfToken, setCfToken, getCfAccountId, setCfAccountId, clearCfConnection };
26
26
 
27
27
  //# debugId=A4A3DDFE5D44524164756E2164756E21
28
- //# sourceMappingURL=studio-kfpek536.js.map
28
+ //# sourceMappingURL=studio-kyh9avvv.js.map
@@ -3,39 +3,39 @@ import {
3
3
  getRecentProjects,
4
4
  openFileInTab,
5
5
  trackRecentFile
6
- } from "./studio-rh1cnamv.js";
7
- import {
8
- live
9
- } from "./studio-c31yb4t6.js";
6
+ } from "./studio-5rywrkxz.js";
10
7
  import {
11
8
  activeRegistry,
12
- activeTab,
13
9
  getLayerSlot
14
- } from "./studio-r5xbtctf.js";
10
+ } from "./studio-t7qb9db8.js";
11
+ import {
12
+ activeTab
13
+ } from "./studio-2zkz8evn.js";
15
14
  import {
16
15
  classMap
17
- } from "./studio-twsafr1e.js";
16
+ } from "./studio-m3hwn7y1.js";
18
17
  import {
18
+ live,
19
19
  ref
20
- } from "./studio-kvfx9z2c.js";
20
+ } from "./studio-4rzyrtjz.js";
21
21
  import {
22
22
  html,
23
23
  nothing,
24
24
  render
25
- } from "./studio-5x5774ak.js";
25
+ } from "./studio-kryvsw6j.js";
26
26
  import {
27
27
  flattenTree,
28
28
  nodeLabel,
29
29
  projectState
30
- } from "./studio-cjm7fdjf.js";
30
+ } from "./studio-p4ngc046.js";
31
31
  import {
32
32
  documentExtensions,
33
33
  formatByExtension,
34
34
  loadFormats
35
- } from "./studio-hcxzyk3x.js";
35
+ } from "./studio-eenfkt4e.js";
36
36
  import {
37
37
  getPlatform
38
- } from "./studio-sas7mt3k.js";
38
+ } from "./studio-9ab8gqsm.js";
39
39
 
40
40
  // src/panels/quick-search.ts
41
41
  var PALETTE_MODES = [
@@ -655,5 +655,5 @@ function renderOverlay() {
655
655
 
656
656
  export { PALETTE_MODES, modeSpec, resolvePaletteMode, fuzzyScore, rankBy, paletteArgs, getRecentCommands, initQuickSearch, openQuickSearch, closeQuickSearch, isQuickSearchOpen };
657
657
 
658
- //# debugId=D01DE0145FC9DB1664756E2164756E21
659
- //# sourceMappingURL=studio-g5gdqnyd.js.map
658
+ //# debugId=0B1AF04E34989B3E64756E2164756E21
659
+ //# sourceMappingURL=studio-kyk2v92a.js.map
@@ -2,11 +2,11 @@ import {
2
2
  Directive,
3
3
  PartType,
4
4
  directive
5
- } from "./studio-kvfx9z2c.js";
5
+ } from "./studio-4rzyrtjz.js";
6
6
  import {
7
7
  noChange,
8
8
  nothing
9
- } from "./studio-5x5774ak.js";
9
+ } from "./studio-kryvsw6j.js";
10
10
 
11
11
  // ../../node_modules/lit-html/development/directives/if-defined.js
12
12
  var ifDefined = (value) => value ?? nothing;
@@ -117,4 +117,4 @@ var classMap = directive(ClassMapDirective);
117
117
  export { ifDefined, styleMap, classMap };
118
118
 
119
119
  //# debugId=A0F1689B5230596A64756E2164756E21
120
- //# sourceMappingURL=studio-twsafr1e.js.map
120
+ //# sourceMappingURL=studio-m3hwn7y1.js.map
@@ -12,18 +12,18 @@ import {
12
12
  queryAssignedElements,
13
13
  queryAssignedNodes,
14
14
  state
15
- } from "./studio-xm3dbxvn.js";
15
+ } from "./studio-zczps70q.js";
16
16
  import {
17
17
  css
18
- } from "./studio-0rqqhrdy.js";
18
+ } from "./studio-7nte2hj4.js";
19
19
  import {
20
20
  ifDefined,
21
21
  styleMap
22
- } from "./studio-twsafr1e.js";
22
+ } from "./studio-m3hwn7y1.js";
23
23
  import {
24
24
  html,
25
25
  nothing
26
- } from "./studio-5x5774ak.js";
26
+ } from "./studio-kryvsw6j.js";
27
27
  import {
28
28
  __require,
29
29
  __toESM
@@ -385,7 +385,7 @@ class AbstractOverlay extends SpectrumElement {
385
385
  document.dispatchEvent(overlayUpdateEvent);
386
386
  }
387
387
  static async open(triggerOrContent, interactionOrOptions, content, optionsV1) {
388
- await import("./sp-overlay.dev-s18hymn9.js");
388
+ await import("./sp-overlay.dev-yztmtrs1.js");
389
389
  const v2 = arguments.length === 2;
390
390
  const overlayContent = content || triggerOrContent;
391
391
  const overlay = new this;
@@ -3379,12 +3379,12 @@ class InteractionController {
3379
3379
  return;
3380
3380
  }
3381
3381
  customElements.whenDefined("sp-overlay").then(async () => {
3382
- const { Overlay } = await import("./Overlay.dev-d2ajy6sj.js");
3382
+ const { Overlay } = await import("./Overlay.dev-723bv0df.js");
3383
3383
  this.overlay = new Overlay;
3384
3384
  this.overlay.open = true;
3385
3385
  this.target[lastInteractionType] = this.type;
3386
3386
  });
3387
- import("./sp-overlay.dev-s18hymn9.js");
3387
+ import("./sp-overlay.dev-yztmtrs1.js");
3388
3388
  }
3389
3389
  get overlay() {
3390
3390
  return this._overlay;
@@ -4341,4 +4341,4 @@ var Overlay = _Overlay;
4341
4341
  export { FocusVisiblePolyfillMixin, Focusable, LikeAnchor, MutationController, ObserveSlotPresence, ObserveSlotText, isIPhone, isIOS, isWebKit, isAndroid, randomID, conditionAttributeWithoutId, conditionAttributeWithId, elementResolverUpdatedSymbol, ElementResolutionController, LONGPRESS_INSTRUCTIONS, SlottableRequestEvent, Overlay };
4342
4342
 
4343
4343
  //# debugId=B4C0094FFD6AEF9A64756E2164756E21
4344
- //# sourceMappingURL=studio-tzx3xmvx.js.map
4344
+ //# sourceMappingURL=studio-mmv72a27.js.map