@jxsuite/studio 2.4.3 → 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 (208) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/Overlay.dev-723bv0df.js +23 -0
  3. package/dist/chunks/cf-settings-45fgyx8y.js +21 -0
  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-k10dvcc7.js → convert-to-repeater-dhw1nrz9.js} +27 -18
  7. package/dist/chunks/entry-commands-6z6bhxg0.js +46 -0
  8. package/dist/chunks/{extension-sections-0ada0xcw.js → extension-sections-3ydgjbdy.js} +32 -23
  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-wewba4nq.js → format-host-tgcmfs4p.js} +3 -3
  12. package/dist/chunks/fs-events-hrrg328g.js +21 -0
  13. package/dist/chunks/{git-panel-2dh1aw50.js → git-panel-0yywyk76.js} +21 -15
  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-f5yyvqxv.js → studio-1hbqnt19.js} +37 -31
  33. package/dist/chunks/studio-2zkz8evn.js +3163 -0
  34. package/dist/chunks/{studio-0b6fs05q.js → studio-4pqqxbrt.js} +23 -15
  35. package/dist/chunks/{studio-kvfx9z2c.js → studio-4rzyrtjz.js} +70 -31
  36. package/dist/chunks/{studio-ef8t53vc.js → studio-5q69gfag.js} +60 -56
  37. package/dist/chunks/{studio-v2c5pmjj.js → studio-5rywrkxz.js} +565 -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-hyn3vhwr.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-28xc8ws4.js → studio-9c4k4vhv.js} +14 -10
  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-aweyr4v1.js → studio-ahjfdy6e.js} +9 -7
  47. package/dist/chunks/{studio-s519zc99.js → studio-bgxt93ga.js} +3 -3
  48. package/dist/chunks/{studio-26sv44br.js → studio-cb12yz9w.js} +8543 -8784
  49. package/dist/chunks/studio-cft9r4r7.js +119 -0
  50. package/dist/chunks/{studio-rqemfhz6.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-ke244pam.js → studio-ex8zyp98.js} +51 -25
  54. package/dist/chunks/studio-gv8vvshc.js +118 -0
  55. package/dist/chunks/studio-hbtp0eh1.js +1315 -0
  56. package/dist/chunks/{studio-cz2j1c0g.js → studio-htsf0w6m.js} +75 -123
  57. package/dist/chunks/{studio-pyrw8h0w.js → studio-kjjsjak4.js} +528 -212
  58. package/dist/chunks/{studio-5x5774ak.js → studio-kryvsw6j.js} +3 -3
  59. package/dist/chunks/studio-kyh9avvv.js +28 -0
  60. package/dist/chunks/{studio-jnakhg87.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-sccge2wf.js → studio-p8j86wag.js} +2 -2
  66. package/dist/chunks/{studio-v1va0vhd.js → studio-pdfjntbk.js} +75 -139
  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-dgj7gq44.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-hb7c46jy.js → studio-wx5609xd.js} +21 -15
  81. package/dist/chunks/studio-xrapxwwc.js +1539 -0
  82. package/dist/chunks/{studio-ws6ef6js.js → studio-yxrkyv8a.js} +41 -29
  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 +450 -48
  86. package/dist/studio.js +2455 -1761
  87. package/package.json +16 -15
  88. package/src/browse/library-layouts.ts +3 -3
  89. package/src/browse/library-pane.ts +59 -5
  90. package/src/browse/library-preview.ts +19 -3
  91. package/src/canvas/asset-refs.ts +119 -0
  92. package/src/canvas/asset-resolve.ts +256 -0
  93. package/src/canvas/canvas-live-render.ts +23 -15
  94. package/src/canvas/canvas-render.ts +23 -1
  95. package/src/canvas/iframe-entry.ts +1 -0
  96. package/src/canvas/iframe-host.ts +4 -0
  97. package/src/canvas/iframe-patch.ts +47 -21
  98. package/src/canvas/iframe-protocol.ts +9 -0
  99. package/src/canvas/iframe-render.ts +50 -16
  100. package/src/commands/app-commands.ts +4 -0
  101. package/src/commands/command-args.ts +29 -0
  102. package/src/commands/context.ts +15 -1
  103. package/src/commands/defaults.ts +29 -1
  104. package/src/commands/levels.ts +16 -0
  105. package/src/commands/live-context.ts +3 -0
  106. package/src/content/collection-match.ts +267 -0
  107. package/src/content/entry-commands.ts +38 -29
  108. package/src/content/entry-fields.ts +6 -0
  109. package/src/editor/file-drop-action.ts +2 -1
  110. package/src/editor/shortcuts.ts +5 -0
  111. package/src/files/file-ops.ts +10 -42
  112. package/src/files/files.ts +487 -61
  113. package/src/files/fs-events.ts +9 -0
  114. package/src/files/gitignore.ts +432 -0
  115. package/src/files/media-paths.ts +37 -14
  116. package/src/files/media-upload.ts +47 -6
  117. package/src/files/serialize-document.ts +60 -0
  118. package/src/format/convert-file.ts +511 -0
  119. package/src/format/format-choices.ts +199 -0
  120. package/src/grid/grid-idle.ts +45 -0
  121. package/src/grid/grid-view.ts +35 -0
  122. package/src/grid/schema-columns.ts +2 -1
  123. package/src/grid/sources/content-source.ts +24 -3
  124. package/src/media/media-open.ts +58 -0
  125. package/src/media/media-pane.ts +310 -0
  126. package/src/new-project/import-tab.ts +333 -160
  127. package/src/new-project/new-project-modal.ts +27 -34
  128. package/src/packages/ensure-deps.ts +14 -7
  129. package/src/packages/jxsuite-update.ts +11 -11
  130. package/src/page-params.ts +10 -46
  131. package/src/panels/activity-bar.ts +45 -16
  132. package/src/panels/ai-chat/attached-context.ts +6 -1
  133. package/src/panels/ai-chat/chat-view.ts +255 -13
  134. package/src/panels/ai-chat/composer.ts +21 -80
  135. package/src/panels/ai-panel.ts +116 -2
  136. package/src/panels/frontmatter-fields.ts +6 -2
  137. package/src/panels/navigator-panels.ts +7 -6
  138. package/src/panels/properties-panel.ts +8 -2
  139. package/src/panels/seo-modal.ts +5 -6
  140. package/src/panels/settings-menu.ts +799 -0
  141. package/src/panels/signals-panel.ts +2 -1
  142. package/src/panels/toolbar.ts +135 -15
  143. package/src/platforms/cloud.ts +34 -3
  144. package/src/platforms/devserver.ts +72 -34
  145. package/src/preview/preview-overlay.ts +226 -0
  146. package/src/services/ai-ask.ts +247 -0
  147. package/src/services/ai-import-tools.ts +494 -0
  148. package/src/services/ai-models.ts +101 -11
  149. package/src/services/ai-project-tools.ts +20 -26
  150. package/src/services/ai-settings.ts +69 -71
  151. package/src/services/ai-system-prompt.ts +88 -2
  152. package/src/services/ai-turn-signal.ts +70 -0
  153. package/src/services/cf-settings.ts +19 -37
  154. package/src/services/connection.ts +74 -0
  155. package/src/services/context-manager.ts +89 -0
  156. package/src/services/document-assistant.ts +49 -7
  157. package/src/services/idle.ts +6 -1
  158. package/src/services/import-client.ts +33 -6
  159. package/src/services/import-run.ts +158 -0
  160. package/src/services/import-seed.ts +120 -0
  161. package/src/services/jx-validate.ts +58 -6
  162. package/src/services/project-adoption.ts +71 -0
  163. package/src/services/references.ts +0 -0
  164. package/src/services/settings/definitions.ts +181 -0
  165. package/src/services/settings/kernel.ts +335 -0
  166. package/src/services/settings/write-queue.ts +116 -0
  167. package/src/services/tool-executor.ts +34 -2
  168. package/src/settings/contexts-section.ts +45 -3
  169. package/src/settings/dependencies-editor.ts +43 -23
  170. package/src/settings/general-settings.ts +30 -12
  171. package/src/settings/preferences-accounts.ts +6 -19
  172. package/src/settings/preferences-dialog.ts +18 -41
  173. package/src/settings/preferences-keymap.ts +8 -18
  174. package/src/settings/preferences-sections.ts +57 -0
  175. package/src/settings/schema-field-ui.ts +2 -2
  176. package/src/settings/settings-document.ts +65 -9
  177. package/src/shell.ts +6 -14
  178. package/src/studio.ts +65 -7
  179. package/src/tabs/transact.ts +42 -19
  180. package/src/types.ts +164 -8
  181. package/src/ui/ai-credentials-form.ts +52 -27
  182. package/src/ui/ai-model-picker.ts +162 -0
  183. package/src/ui/choice-field.ts +72 -0
  184. package/src/ui/layers.ts +83 -5
  185. package/src/ui/media-picker.ts +6 -11
  186. package/src/utils/studio-utils.ts +43 -31
  187. package/styles/forced-colors.css +7 -0
  188. package/styles/overlays.css +256 -0
  189. package/styles/panels.css +13 -1
  190. package/styles/shell.css +111 -0
  191. package/dist/chunks/Overlay.dev-d2ajy6sj.js +0 -23
  192. package/dist/chunks/cf-settings-g5fbf2zp.js +0 -17
  193. package/dist/chunks/content-source-k9724vcv.js +0 -39
  194. package/dist/chunks/files-yew27sn9.js +0 -69
  195. package/dist/chunks/layers-panel-qnsghwwd.js +0 -59
  196. package/dist/chunks/publish-panel-a0pdft5w.js +0 -21
  197. package/dist/chunks/quick-search-9avyc4pc.js +0 -54
  198. package/dist/chunks/right-panel-kcnhtc5j.js +0 -38
  199. package/dist/chunks/sp-overlay.dev-s18hymn9.js +0 -18
  200. package/dist/chunks/sp-popover.dev-dj9x7e7a.js +0 -9
  201. package/dist/chunks/sp-progress-circle.dev-0zxcyz3r.js +0 -15
  202. package/dist/chunks/sp-tooltip.dev-5c6d1kjz.js +0 -15
  203. package/dist/chunks/studio-a7pzveq1.js +0 -110
  204. package/dist/chunks/studio-c31yb4t6.js +0 -55
  205. package/dist/chunks/studio-ra7ar50f.js +0 -6682
  206. package/src/canvas/content-assets.ts +0 -263
  207. package/src/canvas/site-style-css.ts +0 -121
  208. package/src/services/settings-store.ts +0 -99
@@ -1,6 +1,13 @@
1
1
  import {
2
2
  LitElement
3
- } from "./studio-0rqqhrdy.js";
3
+ } from "./studio-7nte2hj4.js";
4
+ import {
5
+ invalidateMediaMeta,
6
+ mediaMetaSummary,
7
+ peekMediaMeta,
8
+ recordImageSize,
9
+ seedMediaMeta
10
+ } from "./studio-gv8vvshc.js";
4
11
  import {
5
12
  applyCatalogPick,
6
13
  chipSummary,
@@ -19,31 +26,28 @@ import {
19
26
  renderOperandEditor,
20
27
  resolveContextPointer,
21
28
  slotMode
22
- } from "./studio-ef8t53vc.js";
23
- import {
24
- live
25
- } from "./studio-c31yb4t6.js";
29
+ } from "./studio-5q69gfag.js";
26
30
  import {
27
31
  IMAGE_EXTENSIONS,
28
32
  MEDIA_EXTENSIONS,
29
- UPLOAD_ACCEPT,
30
- baseName,
31
33
  codeService,
32
34
  extensionOf,
33
35
  fetchPluginSchema,
34
36
  getFunctionArgs,
35
- loadUsages,
36
- mediaKind,
37
37
  mediaSiteUrl,
38
- normalizeProjectPath,
39
- peekUsages,
40
38
  pluginSchemaCache,
41
- retryUsages,
39
+ previewFileSrc,
42
40
  setLintMarkers,
43
- uploadAssets,
41
+ uploadAccept,
42
+ uploadAssets
43
+ } from "./studio-htsf0w6m.js";
44
+ import {
45
+ loadUsages,
46
+ peekUsages,
47
+ retryUsages,
44
48
  usageFiles,
45
49
  usageHeadline
46
- } from "./studio-cz2j1c0g.js";
50
+ } from "./studio-cft9r4r7.js";
47
51
  import {
48
52
  attachInstruction,
49
53
  canvasModeOfTab,
@@ -54,7 +58,6 @@ import {
54
58
  evaluateExpression,
55
59
  extractInstruction,
56
60
  isMutating,
57
- loopbackAssetSrc,
58
61
  openPageAction,
59
62
  previewAssetSrc,
60
63
  pureSchemeOf,
@@ -64,40 +67,41 @@ import {
64
67
  requestCanvasEval,
65
68
  staleSelectionMessage,
66
69
  tabOfPane
67
- } from "./studio-pyrw8h0w.js";
70
+ } from "./studio-kjjsjak4.js";
71
+ import {
72
+ getEffectiveLayoutPath,
73
+ getEffectiveLocales,
74
+ getEffectiveMedia,
75
+ getEffectiveStyle,
76
+ monacoTheme,
77
+ setBottomTab,
78
+ shell
79
+ } from "./studio-hbtp0eh1.js";
68
80
  import {
69
- BUFFER_COMMIT,
70
81
  NAVIGATOR_STATEMENTS_REGION,
82
+ activeRegistry,
83
+ getLayerSlot,
84
+ popoverLayerFor
85
+ } from "./studio-t7qb9db8.js";
86
+ import {
71
87
  abbreviateValue,
72
88
  activePane,
73
- activeRegistry,
74
89
  activeTab,
75
90
  argsSchema,
76
91
  attrLabel,
77
92
  booleanArg,
78
93
  booleanProperty,
79
- bufferIsLive,
80
- bufferMovedOn,
81
- bufferWrites,
82
94
  camelToKebab,
83
95
  camelToLabel,
84
- cancelBufferWrites,
85
- commitBufferWrites,
86
96
  detachTab,
87
- effect,
88
97
  enumArg,
89
98
  enumProperty,
90
99
  friendlyNameToVar,
91
- getEffectiveLayoutPath,
92
- getEffectiveLocales,
93
- getEffectiveMedia,
94
- getEffectiveStyle,
95
- getLayerSlot,
96
100
  inferInputType,
97
101
  insertIntoPane,
102
+ isMediaFormat,
98
103
  kebabToLabel,
99
104
  localeLabel,
100
- monacoTheme,
101
105
  mutateAddDef,
102
106
  mutateRemoveDef,
103
107
  mutateRenameDef,
@@ -106,76 +110,87 @@ import {
106
110
  mutateUpdateProp,
107
111
  mutateUpdateProperty,
108
112
  mutateUpdateStyle,
109
- notify,
110
113
  optionalStringArg,
111
114
  paneById,
112
115
  parseCemType,
113
116
  pathArg,
114
117
  pathProperty,
115
- popoverLayerFor,
116
118
  primarySelection,
117
119
  promoteTab,
118
- setBottomTab,
119
- shallowRef,
120
- shell,
121
120
  sidePane,
122
121
  stringArg,
123
122
  stringProperty,
124
123
  tabIsLive,
125
- toRaw,
126
124
  transactDoc,
127
125
  translationPathFor,
128
126
  unifyValues,
129
127
  varDisplayName,
130
- view,
131
128
  workspace
132
- } from "./studio-ra7ar50f.js";
129
+ } from "./studio-2zkz8evn.js";
130
+ import {
131
+ BUFFER_COMMIT,
132
+ bufferIsLive,
133
+ bufferMovedOn,
134
+ bufferWrites,
135
+ cancelBufferWrites,
136
+ commitBufferWrites,
137
+ view
138
+ } from "./studio-wcy8trfx.js";
139
+ import {
140
+ effect,
141
+ notify,
142
+ shallowRef,
143
+ toRaw
144
+ } from "./studio-xrapxwwc.js";
133
145
  import {
134
146
  classMap,
135
147
  ifDefined
136
- } from "./studio-twsafr1e.js";
148
+ } from "./studio-m3hwn7y1.js";
137
149
  import {
138
150
  Directive,
139
151
  directive,
152
+ live,
140
153
  ref,
141
154
  setCommittedValue
142
- } from "./studio-kvfx9z2c.js";
155
+ } from "./studio-4rzyrtjz.js";
143
156
  import {
144
157
  html,
145
158
  nothing,
146
159
  render
147
- } from "./studio-5x5774ak.js";
160
+ } from "./studio-kryvsw6j.js";
148
161
  import {
149
162
  combine
150
163
  } from "./studio-g1wdche0.js";
151
164
  import {
152
165
  componentRegistry
153
- } from "./studio-s519zc99.js";
166
+ } from "./studio-bgxt93ga.js";
154
167
  import {
155
168
  LIVE_PREVIEW,
156
169
  cancelStyleDebounce,
157
170
  debouncedStyleCommit,
158
- displayTagName,
159
- getEventBinding,
160
171
  getNodeAtPath,
161
- isExpressionDef,
162
- isJsonObject,
163
- isRef,
164
- isTagExpression,
165
172
  parentElementPath,
166
173
  projectState,
167
174
  renderOnly,
168
175
  updateUi
169
- } from "./studio-cjm7fdjf.js";
176
+ } from "./studio-p4ngc046.js";
177
+ import {
178
+ displayTagName,
179
+ getEventBinding,
180
+ isExpressionDef,
181
+ isJsonObject,
182
+ isRef,
183
+ isTagExpression
184
+ } from "./studio-q7v10cg2.js";
170
185
  import {
171
186
  getExtensions,
172
187
  loadExtensions,
173
188
  loadMonaco,
174
189
  mountStillWanted
175
- } from "./studio-rqemfhz6.js";
190
+ } from "./studio-eenfkt4e.js";
176
191
  import {
177
192
  getPlatform
178
- } from "./studio-sas7mt3k.js";
193
+ } from "./studio-9ab8gqsm.js";
179
194
  import {
180
195
  __require
181
196
  } from "./studio-a0tswy0w.js";
@@ -695,81 +710,6 @@ function derivationCommands(deps) {
695
710
  ];
696
711
  }
697
712
 
698
- // src/files/media-meta.ts
699
- var settled = new Map;
700
- var inFlight = new Map;
701
- var measured = new Map;
702
- function metaFrom(path, entry) {
703
- const name = baseName(path);
704
- const dims = measured.get(path);
705
- return {
706
- bytes: typeof entry?.size === "number" ? entry.size : null,
707
- ext: extensionOf(name),
708
- height: dims?.height ?? null,
709
- kind: mediaKind({ name }),
710
- modified: entry?.modified ?? null,
711
- name,
712
- path,
713
- width: dims?.width ?? null
714
- };
715
- }
716
- function peekMediaMeta(path) {
717
- return settled.get(normalizeProjectPath(path)) ?? null;
718
- }
719
- function seedMediaMeta(entries) {
720
- for (const entry of entries) {
721
- if (entry.type !== "file") {
722
- continue;
723
- }
724
- const path = normalizeProjectPath(entry.path);
725
- if (!settled.has(path)) {
726
- settled.set(path, metaFrom(path, entry));
727
- }
728
- }
729
- }
730
- function recordImageSize(path, width, height) {
731
- if (!(width > 0 && height > 0)) {
732
- return false;
733
- }
734
- const key = normalizeProjectPath(path);
735
- const known = measured.get(key);
736
- if (known && known.width === width && known.height === height) {
737
- return false;
738
- }
739
- measured.set(key, { height, width });
740
- const meta = settled.get(key);
741
- if (meta) {
742
- settled.set(key, { ...meta, height, width });
743
- }
744
- return true;
745
- }
746
- function invalidateMediaMeta() {
747
- settled.clear();
748
- measured.clear();
749
- }
750
- function formatBytes(bytes) {
751
- if (bytes < 1024) {
752
- return `${bytes} B`;
753
- }
754
- if (bytes < 1024 * 1024) {
755
- return `${Math.round(bytes / 1024)} KB`;
756
- }
757
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
758
- }
759
- function mediaMetaSummary(meta) {
760
- if (!meta) {
761
- return "";
762
- }
763
- const parts = [];
764
- if (meta.width !== null && meta.height !== null) {
765
- parts.push(`${meta.width} × ${meta.height}`);
766
- }
767
- if (meta.bytes !== null) {
768
- parts.push(formatBytes(meta.bytes));
769
- }
770
- return parts.join(" · ");
771
- }
772
-
773
713
  // src/ui/media-picker.ts
774
714
  var mediaCache = [];
775
715
  var mediaCacheLoaded = false;
@@ -914,7 +854,7 @@ function renderMediaPickerPopover() {
914
854
  <sp-menu-item value=${m.path}>
915
855
  ${m.isImage ? html`<img
916
856
  slot="icon"
917
- src=${loopbackAssetSrc(m.path)}
857
+ src=${previewFileSrc(m.file)}
918
858
  alt=""
919
859
  style="width:24px;height:24px;object-fit:cover;border-radius:var(--spectrum-corner-radius-75, 2px)"
920
860
  @load=${(e) => noteImageSize(m.file, e.target)}
@@ -983,7 +923,7 @@ function pickAndUpload(onCommit) {
983
923
  const input = document.createElement("input");
984
924
  input.type = "file";
985
925
  input.multiple = true;
986
- input.accept = UPLOAD_ACCEPT;
926
+ input.accept = uploadAccept();
987
927
  input.addEventListener("change", () => {
988
928
  if (input.files?.length) {
989
929
  uploadAndAssign(input.files, onCommit);
@@ -997,11 +937,7 @@ function renderMediaPicker(prop, value, onCommit) {
997
937
  const isImage = IMAGE_EXTENSIONS.has(extensionOf(currentValue));
998
938
  return html`
999
939
  <div class="media-picker">
1000
- ${isImage && currentValue ? html`<img
1001
- class="media-picker-thumb"
1002
- src=${loopbackAssetSrc(previewAssetSrc(currentValue))}
1003
- alt=""
1004
- />` : nothing}
940
+ ${isImage && currentValue ? html`<img class="media-picker-thumb" src=${previewAssetSrc(currentValue)} alt="" />` : nothing}
1005
941
  <sp-textfield
1006
942
  size="s"
1007
943
  placeholder="/image.jpg"
@@ -4788,7 +4724,7 @@ function renderComponentPropsFieldsTemplate(node, path, mapSignals, navigateToCo
4788
4724
  const literalDefault = boundRef ? defaultAsString(defs[boundRef.startsWith("#/state/") ? boundRef.slice(8) : boundRef]) || undefined : undefined;
4789
4725
  let debounce;
4790
4726
  let widgetTpl;
4791
- if (prop.format === "image") {
4727
+ if (isMediaFormat(prop.format)) {
4792
4728
  widgetTpl = renderMediaPicker(prop.name, staticVal, onChange);
4793
4729
  } else if (prop.format === "color") {
4794
4730
  widgetTpl = renderColorSelector(prop.name, staticVal, onChange);
@@ -5128,10 +5064,10 @@ function renderUsagesSection(tagName, componentPath) {
5128
5064
  `;
5129
5065
  }
5130
5066
  function openUsage(path) {
5131
- import("./files-yew27sn9.js").then((m) => m.openFileInTab(path));
5067
+ import("./files-0cratsr0.js").then((m) => m.openFileInTab(path));
5132
5068
  }
5133
5069
  function showLogicTab() {
5134
- import("./right-panel-kcnhtc5j.js").then((m) => m.setInspectorTab("events"));
5070
+ import("./right-panel-cqp8bc4v.js").then((m) => m.setInspectorTab("events"));
5135
5071
  }
5136
5072
  function renderPropertiesPanelTemplate(ctx) {
5137
5073
  const tab = activeTab.value;
@@ -6433,7 +6369,7 @@ function renderSignalEditorTemplate(S, name, defArg, ctx) {
6433
6369
  fields = html`
6434
6370
  ${pickerRow("Type", ["string", "integer", "number", "boolean", "array", "object"], def.type || "string", (v) => transactDoc(activeTab.value, (t) => mutateUpdateDef(t, name, { type: v })))}
6435
6371
  ${def.type === "string" || !def.type ? pickerRow("Format", ["", "image", "date", "color"], def.format || "", (v) => transactDoc(activeTab.value, (t) => mutateUpdateDef(t, name, { format: v || undefined }))) : nothing}
6436
- ${def.format === "image" ? renderFieldRow({
6372
+ ${isMediaFormat(def.format) ? renderFieldRow({
6437
6373
  hasValue: false,
6438
6374
  label: "Default",
6439
6375
  prop: "Default",
@@ -6999,5 +6935,5 @@ function registerSignalsCommands(registry) {
6999
6935
 
7000
6936
  export { isSchemeQuery, schemeOfQuery, parseMediaEntries, DERIVE_PRESETS, PRESET_LABELS, declaredMedia, installDerivationEffects, presetRefusal, deriveRefusal, pinRefusal, derivationCommands, invalidateMediaCache, renderMediaPicker, spTextField, spTextArea, spNumberField, unwrapSignal, dataTypeLabel, registerDataExplorerCommands, registerDataPanel, livePreviewExpression, closeFunctionEditor, logicTarget, revealLogicPanel, openLogicTarget, registerLogicPanel, registerFormulaEditorCommands, JxColorPopover, isColorPopoverOpen, css_meta_default, initCssData, getCssInitialMap, allConditionsPass, autoOpenSections, getLonghands, expandShorthand, compressShorthand, expandBorderSide, compressBorderSide, widgetForType2 as widgetForType, renderStatementEditor, mapSignalsFor, bindableSignalNames, defaultAsString, invalidatePageRouteCache, renderPropertiesPanelTemplate, isInspectorSectionOpen, setInspectorSection, inspectorCommands, registerInspectorCommands, defCategory, defBadgeLabel, isCustomElementDoc, collectCssParts, renderSignalsTemplate, registerSignalsCommands };
7001
6937
 
7002
- //# debugId=9BF36A7266D05ECB64756E2164756E21
7003
- //# sourceMappingURL=studio-v1va0vhd.js.map
6938
+ //# debugId=CB884404B44B28B964756E2164756E21
6939
+ //# sourceMappingURL=studio-pdfjntbk.js.map