@jxsuite/studio 2.0.1 → 2.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/canvas.html +21 -0
- package/dist/chunks/Overlay.dev-qfjzkms8.js +23 -0
- package/dist/chunks/{Overlay.dev-cszx7yn5.js.map → Overlay.dev-qfjzkms8.js.map} +1 -1
- package/dist/chunks/{adapter-z8fkmbmv.js → adapter-qfnesn5v.js} +2 -2
- package/dist/chunks/{cf-settings-mmyv436d.js → cf-settings-73sh5z4p.js} +3 -3
- package/dist/chunks/{components-799jpvhm.js → components-2bpqp4mq.js} +5 -7
- package/dist/chunks/{components-799jpvhm.js.map → components-2bpqp4mq.js.map} +1 -1
- package/dist/chunks/content-source-34gnkbnn.js +38 -0
- package/dist/chunks/content-source-34gnkbnn.js.map +9 -0
- package/dist/chunks/convert-to-repeater-t8kxre5s.js +258 -0
- package/dist/chunks/convert-to-repeater-t8kxre5s.js.map +10 -0
- package/dist/chunks/extension-sections-6mqydz35.js +301 -0
- package/dist/chunks/extension-sections-6mqydz35.js.map +11 -0
- package/dist/chunks/files-8kn321h1.js +70 -0
- package/dist/chunks/files-8kn321h1.js.map +9 -0
- package/dist/chunks/{format-host-8jxwts2p.js → format-host-mkwsmt8d.js} +3 -3
- package/dist/chunks/git-panel-tjbr191d.js +51 -0
- package/dist/chunks/git-panel-tjbr191d.js.map +9 -0
- package/dist/chunks/{index-baeg2x3y.js → index-7pxchcce.js} +4 -3
- package/dist/chunks/{index-baeg2x3y.js.map → index-7pxchcce.js.map} +3 -3
- package/dist/chunks/{jx-validate-qx8degj7.js → jx-validate-v6qgknrs.js} +3 -3
- package/dist/chunks/layers-panel-87pb25km.js +58 -0
- package/dist/chunks/layers-panel-87pb25km.js.map +9 -0
- package/dist/chunks/{monaco-setup-zjdp9zdw.js → monaco-setup-e0yh25j4.js} +4 -75
- package/dist/chunks/{monaco-setup-zjdp9zdw.js.map → monaco-setup-e0yh25j4.js.map} +3 -4
- package/dist/chunks/publish-panel-m0fcgdrt.js +21 -0
- package/dist/chunks/publish-panel-m0fcgdrt.js.map +9 -0
- package/dist/chunks/quick-search-rhs6cbsb.js +53 -0
- package/dist/chunks/quick-search-rhs6cbsb.js.map +9 -0
- package/dist/chunks/right-panel-zpdxd98t.js +37 -0
- package/dist/chunks/right-panel-zpdxd98t.js.map +9 -0
- package/dist/chunks/section-registry-zmckaxf4.js +30 -0
- package/dist/chunks/section-registry-zmckaxf4.js.map +9 -0
- package/dist/chunks/sp-overlay.dev-9ran0sfq.js +18 -0
- package/dist/chunks/sp-overlay.dev-9ran0sfq.js.map +9 -0
- package/dist/chunks/sp-popover.dev-rebmdncr.js +9 -0
- package/dist/chunks/sp-popover.dev-rebmdncr.js.map +9 -0
- package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js +15 -0
- package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js.map +9 -0
- package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js +15 -0
- package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js.map +9 -0
- package/dist/chunks/{sp-tray.dev-pb2fsd65.js → sp-tray.dev-ey59vfh7.js} +10 -8
- package/dist/chunks/{sp-tray.dev-pb2fsd65.js.map → sp-tray.dev-ey59vfh7.js.map} +2 -2
- package/dist/chunks/{studio-9qr6fq7p.js → studio-0rqqhrdy.js} +10 -378
- package/dist/chunks/{studio-9qr6fq7p.js.map → studio-0rqqhrdy.js.map} +4 -14
- package/dist/chunks/{studio-5x6tqqec.js → studio-2sj1jj3v.js} +10 -8
- package/dist/chunks/{studio-5x6tqqec.js.map → studio-2sj1jj3v.js.map} +2 -2
- package/dist/chunks/{studio-h3fw0wn8.js → studio-3fk1ac9z.js} +6 -4
- package/dist/chunks/{studio-h3fw0wn8.js.map → studio-3fk1ac9z.js.map} +2 -2
- package/dist/chunks/studio-41exgzhq.js +6690 -0
- package/dist/chunks/studio-41exgzhq.js.map +38 -0
- package/dist/chunks/{studio-7v2bpweq.js → studio-4mqb9a0j.js} +6 -4
- package/dist/chunks/{studio-7v2bpweq.js.map → studio-4mqb9a0j.js.map} +2 -2
- package/dist/chunks/studio-50k77cca.js +1787 -0
- package/dist/chunks/studio-50k77cca.js.map +18 -0
- package/dist/chunks/{studio-56v3zwk6.js → studio-6a0h7sne.js} +10 -8
- package/dist/chunks/{studio-56v3zwk6.js.map → studio-6a0h7sne.js.map} +2 -2
- package/dist/chunks/studio-6f0am8f2.js +53 -0
- package/dist/chunks/studio-6f0am8f2.js.map +10 -0
- package/dist/chunks/studio-6nmjc5qk.js +7002 -0
- package/dist/chunks/studio-6nmjc5qk.js.map +32 -0
- package/dist/chunks/studio-7afd21nw.js +67 -0
- package/dist/chunks/studio-7afd21nw.js.map +10 -0
- package/dist/chunks/{studio-xze4zrs1.js → studio-7bmdvzne.js} +2 -2
- package/dist/chunks/studio-7bmdvzne.js.map +10 -0
- package/dist/chunks/studio-8jpzqk5s.js +128 -0
- package/dist/chunks/studio-8jpzqk5s.js.map +10 -0
- package/dist/chunks/studio-94m77tgk.js +1482 -0
- package/dist/chunks/studio-94m77tgk.js.map +13 -0
- package/dist/chunks/studio-9je6w5sq.js +1000 -0
- package/dist/chunks/studio-9je6w5sq.js.map +16 -0
- package/dist/chunks/{studio-w7c6kvk7.js → studio-a7pzveq1.js} +2 -2
- package/dist/chunks/{studio-gs6kqdt1.js → studio-adn0z1k3.js} +14 -8
- package/dist/chunks/{studio-gs6kqdt1.js.map → studio-adn0z1k3.js.map} +3 -3
- package/dist/chunks/{studio-kr88ryr7.js → studio-bsxxx3x2.js} +17 -15
- package/dist/chunks/{studio-kr88ryr7.js.map → studio-bsxxx3x2.js.map} +7 -6
- package/dist/chunks/studio-bw5dz6km.js +608 -0
- package/dist/chunks/studio-bw5dz6km.js.map +21 -0
- package/dist/chunks/studio-c6s5getc.js +4232 -0
- package/dist/chunks/studio-c6s5getc.js.map +39 -0
- package/dist/chunks/studio-cjm7fdjf.js +451 -0
- package/dist/chunks/studio-cjm7fdjf.js.map +14 -0
- package/dist/chunks/{studio-cx91mnh8.js → studio-ckwz4d3x.js} +53 -53
- package/dist/chunks/{studio-cx91mnh8.js.map → studio-ckwz4d3x.js.map} +5 -5
- package/dist/chunks/studio-dg7zyt5x.js +28 -0
- package/dist/chunks/studio-dg7zyt5x.js.map +10 -0
- package/dist/chunks/studio-dzcyvvvz.js +166 -0
- package/dist/chunks/studio-dzcyvvvz.js.map +10 -0
- package/dist/chunks/{studio-7kqe41sa.js → studio-evkr5d3b.js} +15 -7
- package/dist/chunks/{studio-7kqe41sa.js.map → studio-evkr5d3b.js.map} +5 -4
- package/dist/chunks/studio-f12h6177.js +411 -0
- package/dist/chunks/studio-f12h6177.js.map +13 -0
- package/dist/chunks/studio-hbp1s8m9.js +1817 -0
- package/dist/chunks/studio-hbp1s8m9.js.map +14 -0
- package/dist/chunks/studio-k2sxjph5.js +15295 -0
- package/dist/chunks/studio-k2sxjph5.js.map +235 -0
- package/dist/chunks/studio-myje51t3.js +385 -0
- package/dist/chunks/studio-myje51t3.js.map +12 -0
- package/dist/chunks/studio-na6rwzhw.js +353 -0
- package/dist/chunks/studio-na6rwzhw.js.map +11 -0
- package/dist/chunks/{studio-4k0m4fmp.js → studio-p471gg5n.js} +126 -3
- package/dist/chunks/studio-p471gg5n.js.map +14 -0
- package/dist/chunks/{studio-9bjwf0d4.js → studio-rgwcpast.js} +5 -46
- package/dist/chunks/{studio-9bjwf0d4.js.map → studio-rgwcpast.js.map} +4 -5
- package/dist/chunks/{studio-esrewxap.js → studio-s519zc99.js} +3 -3
- package/dist/chunks/studio-sas7mt3k.js +75 -0
- package/dist/chunks/studio-sas7mt3k.js.map +10 -0
- package/dist/chunks/studio-t5wqwzdh.js +74 -0
- package/dist/chunks/studio-t5wqwzdh.js.map +10 -0
- package/dist/chunks/{studio-9qpspwfn.js → studio-temv5bw4.js} +5 -5
- package/dist/chunks/{studio-9qpspwfn.js.map → studio-temv5bw4.js.map} +1 -1
- package/dist/chunks/{studio-qkvt37c0.js → studio-tr20m8g8.js} +669 -18
- package/dist/chunks/studio-tr20m8g8.js.map +9 -0
- package/dist/chunks/{studio-v7jkjqng.js → studio-v96qfnww.js} +5514 -4291
- package/dist/chunks/studio-v96qfnww.js.map +54 -0
- package/dist/chunks/studio-vcetc91k.js +659 -0
- package/dist/chunks/studio-vcetc91k.js.map +10 -0
- package/dist/chunks/{studio-jm0z592w.js → studio-vmymjefp.js} +2972 -4937
- package/dist/chunks/studio-vmymjefp.js.map +98 -0
- package/dist/chunks/{studio-bghqfmea.js → studio-wwseqyw0.js} +2 -2
- package/dist/chunks/studio-x9hmy5kr.js +390 -0
- package/dist/chunks/studio-x9hmy5kr.js.map +10 -0
- package/dist/chunks/studio-xa0ce0n7.js +335 -0
- package/dist/chunks/studio-xa0ce0n7.js.map +10 -0
- package/dist/chunks/studio-xm3dbxvn.js +378 -0
- package/dist/chunks/studio-xm3dbxvn.js.map +19 -0
- package/dist/chunks/{studio-nqw433kv.js → studio-xmvbhg31.js} +2 -2
- package/dist/chunks/studio-zv37yrfa.js +1054 -0
- package/dist/chunks/studio-zv37yrfa.js.map +13 -0
- package/dist/chunks/{ws-client-q7hkz3j9.js → ws-client-654ts66j.js} +6 -4
- package/dist/chunks/ws-client-654ts66j.js.map +11 -0
- package/dist/iframe-entry.js +668 -230
- package/dist/studio.js +21080 -32585
- package/index.html +35 -4685
- package/package.json +17 -15
- package/src/about/about-modal.ts +42 -11
- package/src/browse/library-commands.ts +240 -0
- package/src/browse/library-layouts.ts +369 -0
- package/src/browse/library-model.ts +396 -0
- package/src/browse/library-pane.ts +1049 -0
- package/src/browse/library-preview.ts +252 -0
- package/src/browse/library-source.ts +150 -0
- package/src/canvas/canvas-helpers.ts +33 -9
- package/src/canvas/canvas-live-render.ts +45 -29
- package/src/canvas/canvas-patcher.ts +151 -31
- package/src/canvas/canvas-perf.ts +46 -7
- package/src/canvas/canvas-render.ts +1092 -220
- package/src/canvas/canvas-surface.ts +240 -0
- package/src/canvas/canvas-utils.ts +1166 -124
- package/src/canvas/iframe-drop.ts +2 -1
- package/src/canvas/iframe-entry.ts +241 -4
- package/src/canvas/iframe-host.ts +1226 -143
- package/src/canvas/iframe-inline-edit.ts +31 -0
- package/src/canvas/iframe-interaction.ts +76 -16
- package/src/canvas/iframe-keys.ts +107 -45
- package/src/canvas/iframe-overlay.ts +38 -1
- package/src/canvas/iframe-protocol.ts +137 -2
- package/src/canvas/iframe-render.ts +70 -2
- package/src/canvas/iframe-slash.ts +6 -0
- package/src/canvas/path-mapping.ts +56 -6
- package/src/canvas/surface-registry.ts +292 -0
- package/src/collab/collab-commands.ts +244 -0
- package/src/collab/collab-session.ts +198 -32
- package/src/collab/collab-state.ts +28 -2
- package/src/collab/presence-chips.ts +100 -9
- package/src/commands/active-registry.ts +42 -0
- package/src/commands/app-commands.ts +176 -0
- package/src/commands/budget.ts +158 -0
- package/src/commands/command-args.ts +253 -0
- package/src/commands/context.ts +387 -0
- package/src/commands/defaults.ts +580 -0
- package/src/commands/keymap.ts +571 -0
- package/src/commands/levels.ts +345 -0
- package/src/commands/live-context.ts +193 -0
- package/src/commands/reference.ts +227 -0
- package/src/commands/registry.ts +293 -0
- package/src/component-props.ts +3 -2
- package/src/content/draft-state.ts +106 -0
- package/src/content/entry-commands.ts +282 -0
- package/src/content/entry-editor.ts +327 -0
- package/src/content/entry-fields.ts +116 -0
- package/src/content/entry-model.ts +175 -0
- package/src/editor/canvas-context-menu.ts +17 -11
- package/src/editor/canvas-slash-bridge.ts +11 -4
- package/src/editor/context-menu.ts +804 -204
- package/src/editor/convert-to-component.ts +31 -10
- package/src/editor/convert-to-repeater.ts +3 -2
- package/src/editor/inline-edit-apply.ts +5 -5
- package/src/editor/inline-edit.ts +86 -50
- package/src/editor/insert-zone-action.ts +1 -1
- package/src/editor/shortcuts.ts +1043 -329
- package/src/editor/slash-menu.ts +1 -0
- package/src/files/elements.ts +166 -0
- package/src/files/file-ops.ts +178 -31
- package/src/files/files.ts +898 -268
- package/src/files/fs-events.ts +21 -0
- package/src/files/media-meta.ts +203 -0
- package/src/files/media-paths.ts +141 -0
- package/src/files/media-upload.ts +7 -3
- package/src/files/media-usage.ts +189 -0
- package/src/github/github-auth.ts +235 -33
- package/src/github/github-publish.ts +80 -21
- package/src/grid/grid-controller.ts +152 -12
- package/src/grid/grid-layout.ts +225 -20
- package/src/grid/grid-open.ts +120 -0
- package/src/grid/grid-panel.ts +554 -39
- package/src/grid/grid-source.ts +27 -1
- package/src/grid/redirects-grid.ts +599 -0
- package/src/grid/redirects.ts +398 -0
- package/src/grid/sources/content-source.ts +108 -2
- package/src/i18n/i18n-commands.ts +322 -0
- package/src/new-project/add-repo-modal.ts +8 -10
- package/src/new-project/import-tab.ts +7 -0
- package/src/new-project/location-fields.ts +9 -1
- package/src/new-project/new-project-modal.ts +221 -245
- package/src/packages/jxsuite-update.ts +97 -48
- package/src/packages/pull-package-sync.ts +18 -9
- package/src/page-params.ts +2 -1
- package/src/panels/activity-bar.ts +152 -91
- package/src/panels/activity-panel.ts +481 -0
- package/src/panels/ai-chat/chat-markdown.ts +8 -3
- package/src/panels/ai-chat/chat-view.ts +245 -18
- package/src/panels/ai-chat/composer.ts +31 -5
- package/src/panels/ai-chat/sessions-view.ts +17 -10
- package/src/panels/ai-panel.ts +279 -53
- package/src/panels/block-action-bar.ts +1115 -224
- package/src/panels/bottom-dock.ts +337 -0
- package/src/panels/canvas-dnd-bridge.ts +37 -8
- package/src/panels/chat-panel.ts +29 -12
- package/src/panels/data-explorer.ts +254 -112
- package/src/panels/data-grid.ts +10 -4
- package/src/panels/dnd.ts +28 -51
- package/src/panels/editors.ts +434 -107
- package/src/panels/elements-panel.ts +66 -2
- package/src/panels/empty-state.ts +112 -0
- package/src/panels/events-panel.ts +596 -82
- package/src/panels/formula-workspace.ts +408 -218
- package/src/panels/frontmatter-fields.ts +51 -10
- package/src/panels/frontmatter-panel.ts +357 -79
- package/src/panels/git-panel.ts +375 -164
- package/src/panels/head-panel.ts +791 -85
- package/src/panels/i18n-panel.ts +592 -0
- package/src/panels/imports-panel.ts +95 -85
- package/src/panels/jump-bar.ts +584 -0
- package/src/panels/layers-panel.ts +1106 -328
- package/src/panels/left-panel.ts +109 -204
- package/src/panels/navigator-panels.ts +131 -0
- package/src/panels/overlays.ts +7 -2
- package/src/panels/pane-context.ts +1477 -0
- package/src/panels/pane-grid.ts +406 -0
- package/src/panels/panel-registry.ts +340 -0
- package/src/panels/panel-scheduler.ts +75 -0
- package/src/panels/problems-panel.ts +234 -0
- package/src/panels/properties-panel.ts +946 -1139
- package/src/panels/provenance.ts +258 -0
- package/src/panels/quick-search.ts +791 -122
- package/src/panels/right-panel.ts +228 -102
- package/src/panels/seo-modal.ts +395 -0
- package/src/panels/settings-pane.ts +203 -0
- package/src/panels/signals-panel.ts +354 -137
- package/src/panels/statement-editor.ts +41 -25
- package/src/panels/statusbar.ts +342 -106
- package/src/panels/style-panel.ts +974 -463
- package/src/panels/style-utils.ts +3 -3
- package/src/panels/stylebook-doc.ts +4 -2
- package/src/panels/stylebook-layers-panel.ts +3 -2
- package/src/panels/stylebook-panel.ts +51 -26
- package/src/panels/tab-strip.ts +1058 -78
- package/src/panels/target-line.ts +274 -0
- package/src/panels/toolbar.ts +631 -484
- package/src/panels/welcome-screen.ts +301 -198
- package/src/platform-errors.ts +26 -3
- package/src/platform.ts +96 -2
- package/src/platforms/cloud.ts +71 -8
- package/src/platforms/devserver.ts +92 -29
- package/src/publish/deploy-checklist.ts +383 -0
- package/src/publish/pages-service.ts +10 -1
- package/src/publish/publish-commands.ts +218 -0
- package/src/publish/publish-panel.ts +110 -16
- package/src/recent-projects.ts +3 -2
- package/src/services/a11y-report.ts +505 -0
- package/src/services/ai-models.ts +30 -1
- package/src/services/ai-project-tools.ts +29 -10
- package/src/services/ai-system-prompt.ts +53 -14
- package/src/services/ai-tools.ts +39 -3
- package/src/services/ai-writes.ts +154 -0
- package/src/services/announce.ts +97 -0
- package/src/services/automation.ts +424 -175
- package/src/services/cem-export.ts +9 -4
- package/src/services/clock.ts +61 -0
- package/src/services/document-assistant.ts +36 -8
- package/src/services/idle.ts +179 -0
- package/src/services/import-client.ts +26 -0
- package/src/services/monaco-buffer.ts +627 -0
- package/src/services/monaco-lazy.ts +36 -0
- package/src/services/notify.ts +271 -0
- package/src/services/profile.ts +155 -0
- package/src/services/references.ts +0 -0
- package/src/services/token-lint.ts +3 -2
- package/src/services/tool-executor.ts +53 -7
- package/src/services/trusted-types.ts +123 -0
- package/src/settings/contexts-section.ts +427 -0
- package/src/settings/contributed-section.ts +149 -11
- package/src/settings/css-vars-editor.ts +306 -349
- package/src/settings/defs-editor.ts +93 -34
- package/src/settings/dependencies-editor.ts +7 -7
- package/src/settings/extension-sections.ts +37 -5
- package/src/settings/general-settings.ts +204 -121
- package/src/settings/locales-section.ts +347 -0
- package/src/settings/preferences-accounts.ts +140 -0
- package/src/settings/preferences-dialog.ts +620 -0
- package/src/settings/preferences-keymap.ts +270 -0
- package/src/settings/project-sections.ts +260 -0
- package/src/settings/section-registry.ts +169 -0
- package/src/settings/settings-document.ts +385 -0
- package/src/shell.ts +1549 -0
- package/src/site-context.ts +45 -20
- package/src/state.ts +14 -275
- package/src/store.ts +88 -43
- package/src/studio.ts +790 -346
- package/src/style/live-preview.ts +36 -0
- package/src/style/project-styles.ts +349 -0
- package/src/style/token-ref.ts +123 -0
- package/src/tabs/patch-ops.ts +16 -4
- package/src/tabs/project-config.ts +416 -0
- package/src/tabs/selection.ts +323 -0
- package/src/tabs/tab.ts +182 -47
- package/src/tabs/transact.ts +209 -28
- package/src/types.ts +68 -13
- package/src/ui/ai-credentials-form.ts +39 -35
- package/src/ui/ai-managed-connect.ts +7 -1
- package/src/ui/dynamic-slot.ts +224 -81
- package/src/ui/expression-editor.ts +71 -63
- package/src/ui/field-input.ts +4 -6
- package/src/ui/field-row.ts +215 -38
- package/src/ui/form-controls.ts +194 -7
- package/src/ui/layers.ts +492 -69
- package/src/ui/media-picker.ts +115 -25
- package/src/ui/panel-resize.ts +109 -91
- package/src/ui/progress-modal.ts +131 -50
- package/src/ui/regions.ts +462 -0
- package/src/ui/schema-form.ts +229 -45
- package/src/ui/spectrum.ts +24 -8
- package/src/ui/timing.ts +49 -0
- package/src/ui/value-selector.ts +20 -0
- package/src/ui/value-source.ts +348 -0
- package/src/ui/virtual-window.ts +400 -0
- package/src/utils/edit-display.ts +3 -2
- package/src/utils/inherited-style.ts +67 -37
- package/src/view.ts +64 -78
- package/src/workspace/pane-derive.ts +1258 -0
- package/src/workspace/session.ts +317 -0
- package/src/workspace/workspace.ts +1345 -23
- package/styles/canvas.css +653 -0
- package/styles/forced-colors.css +106 -0
- package/styles/inspector.css +1454 -0
- package/styles/overlays.css +2704 -0
- package/styles/panels.css +1701 -0
- package/styles/shell.css +1423 -0
- package/styles/tokens.css +151 -0
- package/dist/chunks/Overlay.dev-cszx7yn5.js +0 -22
- package/dist/chunks/extension-sections-qr3drkkw.js +0 -531
- package/dist/chunks/extension-sections-qr3drkkw.js.map +0 -12
- package/dist/chunks/files-j8a1t06k.js +0 -50
- package/dist/chunks/files-j8a1t06k.js.map +0 -9
- package/dist/chunks/git-panel-xtq5z81x.js +0 -28
- package/dist/chunks/git-panel-xtq5z81x.js.map +0 -9
- package/dist/chunks/layers-panel-ancn2wpq.js +0 -26
- package/dist/chunks/layers-panel-ancn2wpq.js.map +0 -9
- package/dist/chunks/settings-modal-17ttr96g.js +0 -29
- package/dist/chunks/settings-modal-17ttr96g.js.map +0 -9
- package/dist/chunks/sp-overlay.dev-earn5as8.js +0 -17
- package/dist/chunks/sp-overlay.dev-earn5as8.js.map +0 -9
- package/dist/chunks/sp-popover.dev-frxtfejn.js +0 -8
- package/dist/chunks/sp-popover.dev-frxtfejn.js.map +0 -9
- package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js +0 -14
- package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js.map +0 -9
- package/dist/chunks/sp-tooltip.dev-a9fywesm.js +0 -21
- package/dist/chunks/sp-tooltip.dev-a9fywesm.js.map +0 -10
- package/dist/chunks/studio-0xgs7xrs.js +0 -429
- package/dist/chunks/studio-0xgs7xrs.js.map +0 -13
- package/dist/chunks/studio-4d8hzcz5.js +0 -3427
- package/dist/chunks/studio-4d8hzcz5.js.map +0 -26
- package/dist/chunks/studio-4k0m4fmp.js.map +0 -13
- package/dist/chunks/studio-9smfzqhc.js +0 -19
- package/dist/chunks/studio-9smfzqhc.js.map +0 -10
- package/dist/chunks/studio-jm0z592w.js.map +0 -115
- package/dist/chunks/studio-m2t4mdg5.js +0 -1854
- package/dist/chunks/studio-m2t4mdg5.js.map +0 -18
- package/dist/chunks/studio-n4p11dfy.js +0 -853
- package/dist/chunks/studio-n4p11dfy.js.map +0 -12
- package/dist/chunks/studio-qkvt37c0.js.map +0 -9
- package/dist/chunks/studio-sjh1wt1a.js +0 -3744
- package/dist/chunks/studio-sjh1wt1a.js.map +0 -22
- package/dist/chunks/studio-v7jkjqng.js.map +0 -46
- package/dist/chunks/studio-xq0t7n5t.js +0 -140
- package/dist/chunks/studio-xq0t7n5t.js.map +0 -10
- package/dist/chunks/studio-xze4zrs1.js.map +0 -10
- package/dist/chunks/studio-yfcstdzy.js +0 -399
- package/dist/chunks/studio-yfcstdzy.js.map +0 -12
- package/dist/chunks/studio-zp7jncs8.js +0 -469
- package/dist/chunks/studio-zp7jncs8.js.map +0 -14
- package/dist/chunks/ws-client-q7hkz3j9.js.map +0 -11
- package/src/browse/browse-modal.ts +0 -69
- package/src/browse/browse.ts +0 -904
- package/src/canvas/canvas-diff.ts +0 -216
- package/src/canvas/nested-site-style.ts +0 -58
- package/src/new-project/design-fields.ts +0 -264
- package/src/new-project/templates.ts +0 -61
- package/src/panels/tab-bar.ts +0 -548
- package/src/settings/settings-modal.ts +0 -203
- /package/dist/chunks/{adapter-z8fkmbmv.js.map → adapter-qfnesn5v.js.map} +0 -0
- /package/dist/chunks/{cf-settings-mmyv436d.js.map → cf-settings-73sh5z4p.js.map} +0 -0
- /package/dist/chunks/{format-host-8jxwts2p.js.map → format-host-mkwsmt8d.js.map} +0 -0
- /package/dist/chunks/{jx-validate-qx8degj7.js.map → jx-validate-v6qgknrs.js.map} +0 -0
- /package/dist/chunks/{studio-w7c6kvk7.js.map → studio-a7pzveq1.js.map} +0 -0
- /package/dist/chunks/{studio-esrewxap.js.map → studio-s519zc99.js.map} +0 -0
- /package/dist/chunks/{studio-bghqfmea.js.map → studio-wwseqyw0.js.map} +0 -0
- /package/dist/chunks/{studio-nqw433kv.js.map → studio-xmvbhg31.js.map} +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Directive,
|
|
3
|
-
PartType,
|
|
4
|
-
directive,
|
|
5
|
-
getCommittedValue,
|
|
6
|
-
insertPart,
|
|
7
|
-
removePart,
|
|
8
|
-
setChildPartValue,
|
|
9
|
-
setCommittedValue
|
|
10
|
-
} from "./studio-4k0m4fmp.js";
|
|
11
|
-
import {
|
|
12
|
-
noChange
|
|
13
|
-
} from "./studio-5x5774ak.js";
|
|
14
|
-
|
|
15
|
-
// ../../node_modules/lit-html/development/directives/repeat.js
|
|
16
|
-
var generateMap = (list, start, end) => {
|
|
17
|
-
const map = new Map;
|
|
18
|
-
for (let i = start;i <= end; i++) {
|
|
19
|
-
map.set(list[i], i);
|
|
20
|
-
}
|
|
21
|
-
return map;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
class RepeatDirective extends Directive {
|
|
25
|
-
constructor(partInfo) {
|
|
26
|
-
super(partInfo);
|
|
27
|
-
if (partInfo.type !== PartType.CHILD) {
|
|
28
|
-
throw new Error("repeat() can only be used in text expressions");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
_getValuesAndKeys(items, keyFnOrTemplate, template) {
|
|
32
|
-
let keyFn;
|
|
33
|
-
if (template === undefined) {
|
|
34
|
-
template = keyFnOrTemplate;
|
|
35
|
-
} else if (keyFnOrTemplate !== undefined) {
|
|
36
|
-
keyFn = keyFnOrTemplate;
|
|
37
|
-
}
|
|
38
|
-
const keys = [];
|
|
39
|
-
const values = [];
|
|
40
|
-
let index = 0;
|
|
41
|
-
for (const item of items) {
|
|
42
|
-
keys[index] = keyFn ? keyFn(item, index) : index;
|
|
43
|
-
values[index] = template(item, index);
|
|
44
|
-
index++;
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
values,
|
|
48
|
-
keys
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
render(items, keyFnOrTemplate, template) {
|
|
52
|
-
return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;
|
|
53
|
-
}
|
|
54
|
-
update(containerPart, [items, keyFnOrTemplate, template]) {
|
|
55
|
-
const oldParts = getCommittedValue(containerPart);
|
|
56
|
-
const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);
|
|
57
|
-
if (!Array.isArray(oldParts)) {
|
|
58
|
-
this._itemKeys = newKeys;
|
|
59
|
-
return newValues;
|
|
60
|
-
}
|
|
61
|
-
const oldKeys = this._itemKeys ??= [];
|
|
62
|
-
const newParts = [];
|
|
63
|
-
let newKeyToIndexMap;
|
|
64
|
-
let oldKeyToIndexMap;
|
|
65
|
-
let oldHead = 0;
|
|
66
|
-
let oldTail = oldParts.length - 1;
|
|
67
|
-
let newHead = 0;
|
|
68
|
-
let newTail = newValues.length - 1;
|
|
69
|
-
while (oldHead <= oldTail && newHead <= newTail) {
|
|
70
|
-
if (oldParts[oldHead] === null) {
|
|
71
|
-
oldHead++;
|
|
72
|
-
} else if (oldParts[oldTail] === null) {
|
|
73
|
-
oldTail--;
|
|
74
|
-
} else if (oldKeys[oldHead] === newKeys[newHead]) {
|
|
75
|
-
newParts[newHead] = setChildPartValue(oldParts[oldHead], newValues[newHead]);
|
|
76
|
-
oldHead++;
|
|
77
|
-
newHead++;
|
|
78
|
-
} else if (oldKeys[oldTail] === newKeys[newTail]) {
|
|
79
|
-
newParts[newTail] = setChildPartValue(oldParts[oldTail], newValues[newTail]);
|
|
80
|
-
oldTail--;
|
|
81
|
-
newTail--;
|
|
82
|
-
} else if (oldKeys[oldHead] === newKeys[newTail]) {
|
|
83
|
-
newParts[newTail] = setChildPartValue(oldParts[oldHead], newValues[newTail]);
|
|
84
|
-
insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]);
|
|
85
|
-
oldHead++;
|
|
86
|
-
newTail--;
|
|
87
|
-
} else if (oldKeys[oldTail] === newKeys[newHead]) {
|
|
88
|
-
newParts[newHead] = setChildPartValue(oldParts[oldTail], newValues[newHead]);
|
|
89
|
-
insertPart(containerPart, oldParts[oldHead], oldParts[oldTail]);
|
|
90
|
-
oldTail--;
|
|
91
|
-
newHead++;
|
|
92
|
-
} else {
|
|
93
|
-
if (newKeyToIndexMap === undefined) {
|
|
94
|
-
newKeyToIndexMap = generateMap(newKeys, newHead, newTail);
|
|
95
|
-
oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);
|
|
96
|
-
}
|
|
97
|
-
if (!newKeyToIndexMap.has(oldKeys[oldHead])) {
|
|
98
|
-
removePart(oldParts[oldHead]);
|
|
99
|
-
oldHead++;
|
|
100
|
-
} else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {
|
|
101
|
-
removePart(oldParts[oldTail]);
|
|
102
|
-
oldTail--;
|
|
103
|
-
} else {
|
|
104
|
-
const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);
|
|
105
|
-
const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;
|
|
106
|
-
if (oldPart === null) {
|
|
107
|
-
const newPart = insertPart(containerPart, oldParts[oldHead]);
|
|
108
|
-
setChildPartValue(newPart, newValues[newHead]);
|
|
109
|
-
newParts[newHead] = newPart;
|
|
110
|
-
} else {
|
|
111
|
-
newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);
|
|
112
|
-
insertPart(containerPart, oldParts[oldHead], oldPart);
|
|
113
|
-
oldParts[oldIndex] = null;
|
|
114
|
-
}
|
|
115
|
-
newHead++;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
while (newHead <= newTail) {
|
|
120
|
-
const newPart = insertPart(containerPart, newParts[newTail + 1]);
|
|
121
|
-
setChildPartValue(newPart, newValues[newHead]);
|
|
122
|
-
newParts[newHead++] = newPart;
|
|
123
|
-
}
|
|
124
|
-
while (oldHead <= oldTail) {
|
|
125
|
-
const oldPart = oldParts[oldHead++];
|
|
126
|
-
if (oldPart !== null) {
|
|
127
|
-
removePart(oldPart);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
this._itemKeys = newKeys;
|
|
131
|
-
setCommittedValue(containerPart, newParts);
|
|
132
|
-
return noChange;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
var repeat = directive(RepeatDirective);
|
|
136
|
-
|
|
137
|
-
export { repeat };
|
|
138
|
-
|
|
139
|
-
//# debugId=25916A2DD803B44964756E2164756E21
|
|
140
|
-
//# sourceMappingURL=studio-xq0t7n5t.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/lit-html/development/directives/repeat.js"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { noChange } from '../lit-html.js';\nimport { directive, Directive, PartType } from '../directive.js';\nimport { insertPart, getCommittedValue, removePart, setCommittedValue, setChildPartValue, } from '../directive-helpers.js';\n// Helper for generating a map of array item to its index over a subset\n// of an array (used to lazily generate `newKeyToIndexMap` and\n// `oldKeyToIndexMap`)\nconst generateMap = (list, start, end) => {\n const map = new Map();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\nclass RepeatDirective extends Directive {\n constructor(partInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('repeat() can only be used in text expressions');\n }\n }\n _getValuesAndKeys(items, keyFnOrTemplate, template) {\n let keyFn;\n if (template === undefined) {\n template = keyFnOrTemplate;\n }\n else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate;\n }\n const keys = [];\n const values = [];\n let index = 0;\n for (const item of items) {\n keys[index] = keyFn ? keyFn(item, index) : index;\n values[index] = template(item, index);\n index++;\n }\n return {\n values,\n keys,\n };\n }\n render(items, keyFnOrTemplate, template) {\n return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;\n }\n update(containerPart, [items, keyFnOrTemplate, template]) {\n // Old part & key lists are retrieved from the last update (which may\n // be primed by hydration)\n const oldParts = getCommittedValue(containerPart);\n const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);\n // We check that oldParts, the committed value, is an Array as an\n // indicator that the previous value came from a repeat() call. If\n // oldParts is not an Array then this is the first render and we return\n // an array for lit-html's array handling to render, and remember the\n // keys.\n if (!Array.isArray(oldParts)) {\n this._itemKeys = newKeys;\n return newValues;\n }\n // In SSR hydration it's possible for oldParts to be an array but for us\n // to not have item keys because the update() hasn't run yet. We set the\n // keys to an empty array. This will cause all oldKey/newKey comparisons\n // to fail and execution to fall to the last nested brach below which\n // reuses the oldPart.\n const oldKeys = (this._itemKeys ??= []);\n // New part list will be built up as we go (either reused from\n // old parts or created for new keys in this update). This is\n // saved in the above cache at the end of the update.\n const newParts = [];\n // Maps from key to index for current and previous update; these\n // are generated lazily only when needed as a performance\n // optimization, since they are only required for multiple\n // non-contiguous changes in the list, which are less common.\n let newKeyToIndexMap;\n let oldKeyToIndexMap;\n // Head and tail pointers to old parts and new values\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n // Overview of O(n) reconciliation algorithm (general approach\n // based on ideas found in ivi, vue, snabbdom, etc.):\n //\n // * We start with the list of old parts and new values (and\n // arrays of their respective keys), head/tail pointers into\n // each, and we build up the new list of parts by updating\n // (and when needed, moving) old parts or creating new ones.\n // The initial scenario might look like this (for brevity of\n // the diagrams, the numbers in the array reflect keys\n // associated with the old parts or new values, although keys\n // and parts/values are actually stored in parallel arrays\n // indexed using the same head/tail pointers):\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [ , , , , , , ]\n // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new\n // item order\n // newHead ^ ^ newTail\n //\n // * Iterate old & new lists from both sides, updating,\n // swapping, or removing parts at the head/tail locations\n // until neither head nor tail can move.\n //\n // * Example below: keys at head pointers match, so update old\n // part 0 in-place (no need to move it) and record part 0 in\n // the `newParts` list. The last thing we do is advance the\n // `oldHead` and `newHead` pointers (will be reflected in the\n // next diagram).\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , ] <- heads matched: update 0\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: head pointers don't match, but tail\n // pointers do, so update part 6 in place (no need to move\n // it), and record part 6 in the `newParts` list. Last,\n // advance the `oldTail` and `oldHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- tails matched: update 6\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail\n // & newTail\n // newHead ^ ^ newTail\n //\n // * If neither head nor tail match; next check if one of the\n // old head/tail items was removed. We first need to generate\n // the reverse map of new keys to index (`newKeyToIndexMap`),\n // which is done once lazily as a performance optimization,\n // since we only hit this case if multiple non-contiguous\n // changes were made. Note that for contiguous removal\n // anywhere in the list, the head and tails would advance\n // from either end and pass each other before we get to this\n // case and removals would be handled in the final while loop\n // without needing to generate the map.\n //\n // * Example below: The key at `oldTail` was removed (no longer\n // in the `newKeyToIndexMap`), so remove that part from the\n // DOM and advance just the `oldTail` pointer.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- 5 not in new map: remove\n // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail\n // newHead ^ ^ newTail\n //\n // * Once head and tail cannot move, any mismatches are due to\n // either new or moved items; if a new key is in the previous\n // \"old key to old index\" map, move the old part to the new\n // location, otherwise create and insert a new part. Note\n // that when moving an old part we null its position in the\n // oldParts array if it lies between the head and tail so we\n // know to skip it when the pointers get there.\n //\n // * Example below: neither head nor tail match, and neither\n // were removed; so find the `newHead` key in the\n // `oldKeyToIndexMap`, and move that old part's DOM into the\n // next head position (before `oldParts[oldHead]`). Last,\n // null the part in the `oldPart` array since it was\n // somewhere in the remaining oldParts still to be scanned\n // (between the head and tail pointers) so that we know to\n // skip that old part on future iterations.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, , , , , 6] <- stuck: update & move 2\n // newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance\n // newHead\n // newHead ^ ^ newTail\n //\n // * Note that for moves/insertions like the one above, a part\n // inserted at the head pointer is inserted before the\n // current `oldParts[oldHead]`, and a part inserted at the\n // tail pointer is inserted before `newParts[newTail+1]`. The\n // seeming asymmetry lies in the fact that new parts are\n // moved into place outside in, so to the right of the head\n // pointer are old parts, and to the right of the tail\n // pointer are new parts.\n //\n // * We always restart back from the top of the algorithm,\n // allowing matching and simple updates in place to\n // continue...\n //\n // * Example below: the head pointers once again match, so\n // simply update part 1 and record it in the `newParts`\n // array. Last, advance both head pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, , , , 6] <- heads matched: update 1\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * As mentioned above, items that were moved as a result of\n // being stuck (the final else clause in the code below) are\n // marked with null, so we always advance old pointers over\n // these so we're comparing the next actual old value on\n // either end.\n //\n // * Example below: `oldHead` is null (already placed in\n // newParts), so advance `oldHead`.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:\n // newParts: [0, 2, 1, , , , 6] advance oldHead\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ ^ newTail\n //\n // * Note it's not critical to mark old parts as null when they\n // are moved from head to tail or tail to head, since they\n // will be outside the pointer range and never visited again.\n //\n // * Example below: Here the old tail key matches the new head\n // key, so the part at the `oldTail` position and move its\n // DOM to the new head position (before `oldParts[oldHead]`).\n // Last, advance `oldTail` and `newHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new\n // newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,\n // advance oldTail & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: Old and new head keys match, so update the\n // old head part in place, and advance the `oldHead` and\n // `newHead` pointers.\n //\n // oldHead v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &\n // newHead\n // newHead ^ ^ newTail\n //\n // * Once the new or old pointers move past each other then all\n // we have left is additions (if old list exhausted) or\n // removals (if new list exhausted). Those are handled in the\n // final while loops at the end.\n //\n // * Example below: `oldHead` exceeded `oldTail`, so we're done\n // with the main loop. Create the remaining part and insert\n // it at the new head position, and the update is complete.\n //\n // (oldHead > oldTail)\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ newTail\n //\n // * Note that the order of the if/else clauses is not\n // important to the algorithm, as long as the null checks\n // come first (to ensure we're always working on valid old\n // parts) and that the final else clause comes last (since\n // that's where the expensive moves occur). The order of\n // remaining clauses is just a simple guess at which cases\n // will be most common.\n //\n // * Note, we could calculate the longest\n // increasing subsequence (LIS) of old items in new position,\n // and only move those not in the LIS set. However that costs\n // O(nlogn) time and adds a bit more code, and only helps\n // make rare types of mutations require fewer moves. The\n // above handles removes, adds, reversal, swaps, and single\n // moves of contiguous items in linear time, in the minimum\n // number of moves. As the number of multiple moves where LIS\n // might help approaches a random shuffle, the LIS\n // optimization becomes less helpful, so it seems not worth\n // the code at this point. Could reconsider if a compelling\n // case arises.\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n // `null` means old part at head has already been used\n // below; skip\n oldHead++;\n }\n else if (oldParts[oldTail] === null) {\n // `null` means old part at tail has already been used\n // below; skip\n oldTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newHead]) {\n // Old head matches new head; update in place\n newParts[newHead] = setChildPartValue(oldParts[oldHead], newValues[newHead]);\n oldHead++;\n newHead++;\n }\n else if (oldKeys[oldTail] === newKeys[newTail]) {\n // Old tail matches new tail; update in place\n newParts[newTail] = setChildPartValue(oldParts[oldTail], newValues[newTail]);\n oldTail--;\n newTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newTail]) {\n // Old head matches new tail; update and move to new tail\n newParts[newTail] = setChildPartValue(oldParts[oldHead], newValues[newTail]);\n insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]);\n oldHead++;\n newTail--;\n }\n else if (oldKeys[oldTail] === newKeys[newHead]) {\n // Old tail matches new head; update and move to new head\n newParts[newHead] = setChildPartValue(oldParts[oldTail], newValues[newHead]);\n insertPart(containerPart, oldParts[oldHead], oldParts[oldTail]);\n oldTail--;\n newHead++;\n }\n else {\n if (newKeyToIndexMap === undefined) {\n // Lazily generate key-to-index maps, used for removals &\n // moves below\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n // Old head is no longer in new list; remove\n removePart(oldParts[oldHead]);\n oldHead++;\n }\n else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n // Old tail is no longer in new list; remove\n removePart(oldParts[oldTail]);\n oldTail--;\n }\n else {\n // Any mismatches at this point are due to additions or\n // moves; see if we have an old part we can reuse and move\n // into place\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n // No old part for this value; create a new one and\n // insert it\n const newPart = insertPart(containerPart, oldParts[oldHead]);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n }\n else {\n // Reuse old part\n newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);\n insertPart(containerPart, oldParts[oldHead], oldPart);\n // This marks the old part as having been used, so that\n // it will be skipped in the first two checks above\n oldParts[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n // Add parts for any remaining new values\n while (newHead <= newTail) {\n // For all remaining additions, we insert before last new\n // tail, since old pointers are no longer valid\n const newPart = insertPart(containerPart, newParts[newTail + 1]);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n // Remove any remaining unused old parts\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n // Save order of new parts for next round\n this._itemKeys = newKeys;\n // Directly set part value, bypassing it's dirty-checking\n setCommittedValue(containerPart, newParts);\n return noChange;\n }\n}\n/**\n * A directive that repeats a series of values (usually `TemplateResults`)\n * generated from an iterable, and updates those items efficiently when the\n * iterable changes based on user-provided `keys` associated with each item.\n *\n * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,\n * meaning previous DOM for a given key is moved into the new position if\n * needed, and DOM will never be reused with values for different keys (new DOM\n * will always be created for new keys). This is generally the most efficient\n * way to use `repeat` since it performs minimum unnecessary work for insertions\n * and removals.\n *\n * The `keyFn` takes two parameters, the item and its index, and returns a unique key value.\n *\n * ```js\n * html`\n * <ol>\n * ${repeat(this.items, (item) => item.id, (item, index) => {\n * return html`<li>${index}: ${item.name}</li>`;\n * })}\n * </ol>\n * `\n * ```\n *\n * **Important**: If providing a `keyFn`, keys *must* be unique for all items in a\n * given call to `repeat`. The behavior when two or more items have the same key\n * is undefined.\n *\n * If no `keyFn` is provided, this directive will perform similar to mapping\n * items to values, and DOM will be reused against potentially different items.\n */\nexport const repeat = directive(RepeatDirective);\n//# sourceMappingURL=repeat.js.map"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "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",
|
|
8
|
-
"debugId": "25916A2DD803B44964756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../collab/src/envelope.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * The binary wire envelope every Jx collab provider speaks: the Cloudflare platform DO, the\n * devserver endpoint in the server package, and the browser client. One WebSocket per project\n * carries every open document, multiplexed by path:\n *\n * frame := varUint frameType, body\n * 0 DOC_SYNC := varString path, varUint docEpoch, varUint8Array y-protocols sync body\n * 1 AWARENESS := varUint8Array y-protocols awareness update (project-scoped)\n * 2 DOC_CLOSE := varString path (client → server unsubscribe)\n * 3 CONTROL := varString json (see ControlMessage)\n *\n * `docEpoch` is the server-owned lifetime counter of a document's Y history. Out-of-band content\n * replacement (git discard/pull/rename, non-collab writes) bumps it; frames carrying a stale epoch\n * are dropped and answered with a `doc-reset` control message, upon which the client destroys its\n * Y.Doc and re-opens. The invariant \"Y history is never deleted or replaced without an epoch bump\"\n * is what prevents divergent-history duplicate-content merges.\n */\n\nimport * as decoding from \"lib0/decoding\";\nimport * as encoding from \"lib0/encoding\";\n\nexport const FRAME_DOC_SYNC = 0;\nexport const FRAME_AWARENESS = 1;\nexport const FRAME_DOC_CLOSE = 2;\nexport const FRAME_CONTROL = 3;\n\nexport type CollabPermission = \"admin\" | \"write\" | \"read\";\n\n/** JSON payloads of CONTROL frames. */\nexport type ControlMessage =\n /** Server → client on accept: the socket's identity and effective permission. */\n | {\n type: \"hello\";\n login: string;\n name?: string;\n avatarUrl?: string;\n color: string;\n permission: CollabPermission;\n }\n /** Client → server: subscribe to a document (the client's Y.Doc must start EMPTY). */\n | { type: \"open\"; path: string }\n /** Server → client: the room is ready at this epoch; sync follows. */\n | { type: \"opened\"; path: string; epoch: number }\n /** Server → client: the doc's history was replaced; destroy the local Y.Doc and re-open. */\n | { type: \"doc-reset\"; path: string; epoch: number }\n /** Client → server: persist this doc to durable storage now (Cmd+S). */\n | { type: \"flush\"; path: string }\n /** Server → client: the flush landed. */\n | { type: \"flush-ack\"; path: string }\n /**\n * Server → client: the room's unsaved-since-last-persist state changed (drives the Save\n * affordance). Room-level and authoritative: any peer's edit dirties the room for everyone; a\n * persist clears it for everyone. Sent to a newly-subscribing connection during the open\n * handshake so it learns the current state.\n */\n | { type: \"doc-dirty\"; path: string; dirty: boolean }\n /**\n * Server → client: a request was refused (codes: read-only, content-not-loaded, too-large,\n * rate-limited, binary-file, unknown-frame).\n */\n | { type: \"error\"; path?: string; code: string; message: string };\n\nexport type CollabFrame =\n | { type: \"doc-sync\"; path: string; epoch: number; body: Uint8Array }\n | { type: \"awareness\"; body: Uint8Array }\n | { type: \"doc-close\"; path: string }\n | { type: \"control\"; message: ControlMessage };\n\nexport class EnvelopeError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"EnvelopeError\";\n }\n}\n\nexport function encodeFrame(frame: CollabFrame): Uint8Array {\n const encoder = encoding.createEncoder();\n switch (frame.type) {\n case \"doc-sync\": {\n encoding.writeVarUint(encoder, FRAME_DOC_SYNC);\n encoding.writeVarString(encoder, frame.path);\n encoding.writeVarUint(encoder, frame.epoch);\n encoding.writeVarUint8Array(encoder, frame.body);\n break;\n }\n case \"awareness\": {\n encoding.writeVarUint(encoder, FRAME_AWARENESS);\n encoding.writeVarUint8Array(encoder, frame.body);\n break;\n }\n case \"doc-close\": {\n encoding.writeVarUint(encoder, FRAME_DOC_CLOSE);\n encoding.writeVarString(encoder, frame.path);\n break;\n }\n case \"control\": {\n encoding.writeVarUint(encoder, FRAME_CONTROL);\n encoding.writeVarString(encoder, JSON.stringify(frame.message));\n break;\n }\n default: {\n throw new EnvelopeError(`unknown-frame:${(frame as CollabFrame).type}`);\n }\n }\n return encoding.toUint8Array(encoder);\n}\n\nexport function decodeFrame(data: Uint8Array): CollabFrame {\n try {\n const decoder = decoding.createDecoder(data);\n const frameType = decoding.readVarUint(decoder);\n switch (frameType) {\n case FRAME_DOC_SYNC: {\n const path = decoding.readVarString(decoder);\n const epoch = decoding.readVarUint(decoder);\n const body = decoding.readVarUint8Array(decoder);\n return { body, epoch, path, type: \"doc-sync\" };\n }\n case FRAME_AWARENESS: {\n return { body: decoding.readVarUint8Array(decoder), type: \"awareness\" };\n }\n case FRAME_DOC_CLOSE: {\n return { path: decoding.readVarString(decoder), type: \"doc-close\" };\n }\n case FRAME_CONTROL: {\n const message = JSON.parse(decoding.readVarString(decoder)) as ControlMessage;\n if (typeof message !== \"object\" || typeof message.type !== \"string\") {\n throw new EnvelopeError(\"malformed-control\");\n }\n return { message, type: \"control\" };\n }\n default: {\n throw new EnvelopeError(`unknown-frame-type:${frameType}`);\n }\n }\n } catch (error) {\n if (error instanceof EnvelopeError) {\n throw error;\n }\n throw new EnvelopeError(\n `malformed-frame: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;AAqBO,IAAM,iBAAiB;AACvB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AAAA;AA4CtB,MAAM,sBAAsB,MAAM;AAAA,EACvC,WAAW,CAAC,SAAiB;AAAA,IAC3B,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA;AAEhB;AAEO,SAAS,WAAW,CAAC,OAAgC;AAAA,EAC1D,MAAM,UAAmB,cAAc;AAAA,EACvC,QAAQ,MAAM;AAAA,SACP,YAAY;AAAA,MACN,aAAa,SAAS,cAAc;AAAA,MACpC,eAAe,SAAS,MAAM,IAAI;AAAA,MAClC,aAAa,SAAS,MAAM,KAAK;AAAA,MACjC,mBAAmB,SAAS,MAAM,IAAI;AAAA,MAC/C;AAAA,IACF;AAAA,SACK,aAAa;AAAA,MACP,aAAa,SAAS,eAAe;AAAA,MACrC,mBAAmB,SAAS,MAAM,IAAI;AAAA,MAC/C;AAAA,IACF;AAAA,SACK,aAAa;AAAA,MACP,aAAa,SAAS,eAAe;AAAA,MACrC,eAAe,SAAS,MAAM,IAAI;AAAA,MAC3C;AAAA,IACF;AAAA,SACK,WAAW;AAAA,MACL,aAAa,SAAS,aAAa;AAAA,MACnC,eAAe,SAAS,KAAK,UAAU,MAAM,OAAO,CAAC;AAAA,MAC9D;AAAA,IACF;AAAA,aACS;AAAA,MACP,MAAM,IAAI,cAAc,iBAAkB,MAAsB,MAAM;AAAA,IACxE;AAAA;AAAA,EAEF,OAAgB,aAAa,OAAO;AAAA;AAG/B,SAAS,WAAW,CAAC,MAA+B;AAAA,EACzD,IAAI;AAAA,IACF,MAAM,UAAmB,cAAc,IAAI;AAAA,IAC3C,MAAM,YAAqB,YAAY,OAAO;AAAA,IAC9C,QAAQ;AAAA,WACD,gBAAgB;AAAA,QACnB,MAAM,OAAgB,cAAc,OAAO;AAAA,QAC3C,MAAM,QAAiB,YAAY,OAAO;AAAA,QAC1C,MAAM,OAAgB,kBAAkB,OAAO;AAAA,QAC/C,OAAO,EAAE,MAAM,OAAO,MAAM,MAAM,WAAW;AAAA,MAC/C;AAAA,WACK,iBAAiB;AAAA,QACpB,OAAO,EAAE,MAAe,kBAAkB,OAAO,GAAG,MAAM,YAAY;AAAA,MACxE;AAAA,WACK,iBAAiB;AAAA,QACpB,OAAO,EAAE,MAAe,cAAc,OAAO,GAAG,MAAM,YAAY;AAAA,MACpE;AAAA,WACK,eAAe;AAAA,QAClB,MAAM,UAAU,KAAK,MAAe,cAAc,OAAO,CAAC;AAAA,QAC1D,IAAI,OAAO,YAAY,YAAY,OAAO,QAAQ,SAAS,UAAU;AAAA,UACnE,MAAM,IAAI,cAAc,mBAAmB;AAAA,QAC7C;AAAA,QACA,OAAO,EAAE,SAAS,MAAM,UAAU;AAAA,MACpC;AAAA,eACS;AAAA,QACP,MAAM,IAAI,cAAc,sBAAsB,WAAW;AAAA,MAC3D;AAAA;AAAA,IAEF,OAAO,OAAO;AAAA,IACd,IAAI,iBAAiB,eAAe;AAAA,MAClC,MAAM;AAAA,IACR;AAAA,IACA,MAAM,IAAI,cACR,oBAAoB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAC3E;AAAA;AAAA;",
|
|
8
|
-
"debugId": "DAAAC2821D4C97A164756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
classMap,
|
|
3
|
-
ifDefined,
|
|
4
|
-
styleMap
|
|
5
|
-
} from "./studio-cx91mnh8.js";
|
|
6
|
-
import {
|
|
7
|
-
live
|
|
8
|
-
} from "./studio-nqw433kv.js";
|
|
9
|
-
import {
|
|
10
|
-
isRef
|
|
11
|
-
} from "./studio-sjh1wt1a.js";
|
|
12
|
-
import {
|
|
13
|
-
html,
|
|
14
|
-
nothing
|
|
15
|
-
} from "./studio-5x5774ak.js";
|
|
16
|
-
|
|
17
|
-
// src/ui/field-row.ts
|
|
18
|
-
function renderFieldRow({
|
|
19
|
-
prop,
|
|
20
|
-
label,
|
|
21
|
-
hasValue,
|
|
22
|
-
onClear,
|
|
23
|
-
widget,
|
|
24
|
-
labelExtra,
|
|
25
|
-
span,
|
|
26
|
-
warning
|
|
27
|
-
}) {
|
|
28
|
-
return html`
|
|
29
|
-
<div
|
|
30
|
-
class=${classMap({ "style-row": true, "style-row--warning": Boolean(warning) })}
|
|
31
|
-
data-prop=${prop}
|
|
32
|
-
style=${span === 2 ? "grid-column: 1 / -1" : ""}
|
|
33
|
-
>
|
|
34
|
-
<div class="style-row-label">
|
|
35
|
-
${hasValue && onClear ? html`<span
|
|
36
|
-
class="set-dot"
|
|
37
|
-
title="Clear ${prop}"
|
|
38
|
-
@click=${(e) => {
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
onClear();
|
|
41
|
-
}}
|
|
42
|
-
></span>` : nothing}
|
|
43
|
-
<sp-field-label size="s" title=${prop}>${label}</sp-field-label>
|
|
44
|
-
${labelExtra ?? nothing}
|
|
45
|
-
</div>
|
|
46
|
-
${widget}
|
|
47
|
-
</div>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/ui/schema-form.ts
|
|
52
|
-
var controlRegistry = new Map;
|
|
53
|
-
function registerFormControl(name, control) {
|
|
54
|
-
controlRegistry.set(name, control);
|
|
55
|
-
}
|
|
56
|
-
var NULL_CONTEXT = {
|
|
57
|
-
resolvePointer: () => {}
|
|
58
|
-
};
|
|
59
|
-
function resolveFormEnum(enumDef, ctx, scope) {
|
|
60
|
-
if (Array.isArray(enumDef)) {
|
|
61
|
-
return enumDef;
|
|
62
|
-
}
|
|
63
|
-
let pointer;
|
|
64
|
-
if (enumDef && typeof enumDef === "object") {
|
|
65
|
-
const ref = enumDef.$ref;
|
|
66
|
-
if (typeof ref === "string") {
|
|
67
|
-
pointer = ref;
|
|
68
|
-
}
|
|
69
|
-
} else if (typeof enumDef === "string") {
|
|
70
|
-
pointer = enumDef;
|
|
71
|
-
}
|
|
72
|
-
if (pointer === undefined || !ctx) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const resolved = ctx.resolvePointer(pointer, scope);
|
|
76
|
-
if (Array.isArray(resolved)) {
|
|
77
|
-
return resolved.map(String);
|
|
78
|
-
}
|
|
79
|
-
if (resolved && typeof resolved === "object") {
|
|
80
|
-
return Object.keys(resolved);
|
|
81
|
-
}
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
function parseNumericField(raw, integer) {
|
|
85
|
-
if (raw.trim() === "") {
|
|
86
|
-
return Number.NaN;
|
|
87
|
-
}
|
|
88
|
-
return integer ? Math.trunc(Number(raw)) : Number(raw);
|
|
89
|
-
}
|
|
90
|
-
function refTextField(key, refVal, onChange) {
|
|
91
|
-
return html`<sp-textfield
|
|
92
|
-
size="s"
|
|
93
|
-
label=${key}
|
|
94
|
-
placeholder=${key}
|
|
95
|
-
.value=${live(refVal)}
|
|
96
|
-
@change=${(e) => {
|
|
97
|
-
const v = e.target.value.trim();
|
|
98
|
-
onChange(v ? { $ref: v } : undefined);
|
|
99
|
-
}}
|
|
100
|
-
></sp-textfield>`;
|
|
101
|
-
}
|
|
102
|
-
function renderInlineField(key, schema, value, onChange, ctx, scope) {
|
|
103
|
-
if (isRef(value)) {
|
|
104
|
-
return refTextField(key, value.$ref, onChange);
|
|
105
|
-
}
|
|
106
|
-
const enumValues = resolveFormEnum(schema.enum, ctx, scope);
|
|
107
|
-
if (enumValues) {
|
|
108
|
-
return html`<sp-picker
|
|
109
|
-
size="s"
|
|
110
|
-
label=${key}
|
|
111
|
-
value=${value !== undefined ? String(value) : "__none__"}
|
|
112
|
-
@change=${(e) => onChange(e.target.value === "__none__" ? undefined : e.target.value)}
|
|
113
|
-
>
|
|
114
|
-
<sp-menu-item value="__none__">—</sp-menu-item>
|
|
115
|
-
${enumValues.map((v) => html`<sp-menu-item value=${v}>${v}</sp-menu-item>`)}
|
|
116
|
-
</sp-picker>`;
|
|
117
|
-
}
|
|
118
|
-
if (schema.type === "boolean") {
|
|
119
|
-
return html`<sp-switch
|
|
120
|
-
size="s"
|
|
121
|
-
?checked=${Boolean(value)}
|
|
122
|
-
@change=${(e) => onChange(e.target.checked)}
|
|
123
|
-
>${key}</sp-switch
|
|
124
|
-
>`;
|
|
125
|
-
}
|
|
126
|
-
if (schema.type === "integer" || schema.type === "number") {
|
|
127
|
-
return html`<sp-number-field
|
|
128
|
-
size="s"
|
|
129
|
-
label=${key}
|
|
130
|
-
.value=${value !== undefined ? value : nothing}
|
|
131
|
-
step=${schema.type === "integer" ? "1" : nothing}
|
|
132
|
-
@change=${(e) => {
|
|
133
|
-
const parsed = parseNumericField(e.target.value, schema.type === "integer");
|
|
134
|
-
onChange(Number.isNaN(parsed) ? undefined : parsed);
|
|
135
|
-
}}
|
|
136
|
-
></sp-number-field>`;
|
|
137
|
-
}
|
|
138
|
-
return html`<sp-textfield
|
|
139
|
-
size="s"
|
|
140
|
-
label=${key}
|
|
141
|
-
placeholder=${key}
|
|
142
|
-
.value=${value ?? ""}
|
|
143
|
-
@input=${(e) => onChange(e.target.value || undefined)}
|
|
144
|
-
></sp-textfield>`;
|
|
145
|
-
}
|
|
146
|
-
function renderJsonTextField(currentValue, ps, commit) {
|
|
147
|
-
let debounce;
|
|
148
|
-
return html`<sp-textfield
|
|
149
|
-
multiline
|
|
150
|
-
size="s"
|
|
151
|
-
style="min-height:40px"
|
|
152
|
-
.value=${currentValue !== undefined ? JSON.stringify(currentValue, null, 2) : ""}
|
|
153
|
-
placeholder=${ps.default !== undefined ? JSON.stringify(ps.default) : nothing}
|
|
154
|
-
@input=${(e) => {
|
|
155
|
-
clearTimeout(debounce);
|
|
156
|
-
debounce = setTimeout(() => {
|
|
157
|
-
try {
|
|
158
|
-
commit(JSON.parse(e.target.value));
|
|
159
|
-
} catch {}
|
|
160
|
-
}, 500);
|
|
161
|
-
}}
|
|
162
|
-
></sp-textfield>`;
|
|
163
|
-
}
|
|
164
|
-
function renderPropertyControl(prop, ps, value, required, opts, ctx) {
|
|
165
|
-
const currentValue = value[prop];
|
|
166
|
-
const commit = (next) => opts.onChange({ [prop]: next });
|
|
167
|
-
const controlArgs = {
|
|
168
|
-
ctx,
|
|
169
|
-
key: prop,
|
|
170
|
-
onChange: commit,
|
|
171
|
-
rerender: opts.rerender,
|
|
172
|
-
schema: ps,
|
|
173
|
-
value: currentValue
|
|
174
|
-
};
|
|
175
|
-
const overrideName = opts.ui?.[prop]?.control;
|
|
176
|
-
if (overrideName) {
|
|
177
|
-
const custom = controlRegistry.get(overrideName);
|
|
178
|
-
if (custom) {
|
|
179
|
-
return custom(controlArgs);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
if (isRef(currentValue) && ps.format !== "json-schema" && ps.type !== "object" && ps.type !== "array") {
|
|
183
|
-
const binding = controlRegistry.get("binding");
|
|
184
|
-
if (binding) {
|
|
185
|
-
return binding(controlArgs);
|
|
186
|
-
}
|
|
187
|
-
return refTextField(prop, currentValue.$ref, commit);
|
|
188
|
-
}
|
|
189
|
-
const enumValues = resolveFormEnum(opts.ui?.[prop]?.enum ?? ps.enum, ctx, value);
|
|
190
|
-
if (enumValues) {
|
|
191
|
-
return html`
|
|
192
|
-
<sp-picker
|
|
193
|
-
size="s"
|
|
194
|
-
value=${currentValue !== undefined ? String(currentValue) : ps.default !== undefined ? String(ps.default) : "__none__"}
|
|
195
|
-
@change=${(e) => commit(e.target.value === "__none__" ? undefined : e.target.value)}
|
|
196
|
-
>
|
|
197
|
-
${!required.has(prop) ? html`<sp-menu-item value="__none__">—</sp-menu-item>` : nothing}
|
|
198
|
-
${enumValues.map((val) => html`<sp-menu-item value=${val}>${val}</sp-menu-item>`)}
|
|
199
|
-
</sp-picker>
|
|
200
|
-
`;
|
|
201
|
-
}
|
|
202
|
-
if (ps.type === "boolean") {
|
|
203
|
-
return html`<sp-checkbox
|
|
204
|
-
?checked=${currentValue ?? ps.default ?? false}
|
|
205
|
-
@change=${(e) => commit(e.target.checked)}
|
|
206
|
-
></sp-checkbox>`;
|
|
207
|
-
}
|
|
208
|
-
if (ps.type === "integer" || ps.type === "number") {
|
|
209
|
-
let debounce2;
|
|
210
|
-
return html`<sp-number-field
|
|
211
|
-
size="s"
|
|
212
|
-
min=${ifDefined(ps.minimum)}
|
|
213
|
-
max=${ifDefined(ps.maximum)}
|
|
214
|
-
step=${ps.type === "integer" ? "1" : nothing}
|
|
215
|
-
.value=${currentValue !== undefined ? currentValue : nothing}
|
|
216
|
-
placeholder=${ps.default != null ? String(ps.default) : nothing}
|
|
217
|
-
@change=${(e) => {
|
|
218
|
-
clearTimeout(debounce2);
|
|
219
|
-
debounce2 = setTimeout(() => {
|
|
220
|
-
const parsed = parseNumericField(e.target.value, ps.type === "integer");
|
|
221
|
-
commit(Number.isNaN(parsed) ? undefined : parsed);
|
|
222
|
-
}, 400);
|
|
223
|
-
}}
|
|
224
|
-
></sp-number-field>`;
|
|
225
|
-
}
|
|
226
|
-
if (ps.format === "json-schema") {
|
|
227
|
-
const hasValue = currentValue && typeof currentValue === "object" && Object.keys(currentValue).length > 0;
|
|
228
|
-
const cv = currentValue;
|
|
229
|
-
const isSchemaRef = hasValue && cv.$ref;
|
|
230
|
-
let debounce2;
|
|
231
|
-
return html`
|
|
232
|
-
<div class="schema-param-editor">
|
|
233
|
-
${hasValue && !isSchemaRef && cv.properties ? html`
|
|
234
|
-
<div style="display:flex;flex-wrap:wrap;gap:3px;margin-bottom:4px">
|
|
235
|
-
${Object.entries(cv.properties).map(([k, v]) => html`
|
|
236
|
-
<span
|
|
237
|
-
style="background:var(--bg);padding:1px 6px;border-radius:var(--radius);font-size:10px;color:var(--fg-dim)"
|
|
238
|
-
>${k}: ${v.type ?? "any"}</span
|
|
239
|
-
>
|
|
240
|
-
`)}
|
|
241
|
-
</div>
|
|
242
|
-
` : nothing}
|
|
243
|
-
<sp-textfield
|
|
244
|
-
multiline
|
|
245
|
-
size="s"
|
|
246
|
-
style=${styleMap({
|
|
247
|
-
fontFamily: "monospace",
|
|
248
|
-
fontSize: "11px",
|
|
249
|
-
minHeight: hasValue ? "80px" : "40px"
|
|
250
|
-
})}
|
|
251
|
-
.value=${currentValue !== undefined ? JSON.stringify(currentValue, null, 2) : ""}
|
|
252
|
-
placeholder=${ps.description ?? "JSON Schema defining the data shape…"}
|
|
253
|
-
@input=${(e) => {
|
|
254
|
-
clearTimeout(debounce2);
|
|
255
|
-
debounce2 = setTimeout(() => {
|
|
256
|
-
try {
|
|
257
|
-
commit(JSON.parse(e.target.value));
|
|
258
|
-
} catch {}
|
|
259
|
-
}, 500);
|
|
260
|
-
}}
|
|
261
|
-
></sp-textfield>
|
|
262
|
-
</div>
|
|
263
|
-
`;
|
|
264
|
-
}
|
|
265
|
-
if (ps.type === "array" && ps.items?.type === "object" && ps.items?.properties) {
|
|
266
|
-
const rows = Array.isArray(currentValue) ? currentValue : [];
|
|
267
|
-
const itemProps = ps.items.properties;
|
|
268
|
-
return html`
|
|
269
|
-
<div class="array-object-field">
|
|
270
|
-
${rows.map((row, idx) => html`
|
|
271
|
-
<div
|
|
272
|
-
class="array-object-row"
|
|
273
|
-
style="display:flex;gap:4px;align-items:center;margin-bottom:4px"
|
|
274
|
-
>
|
|
275
|
-
${Object.entries(itemProps).map(([propKey, propSchema]) => renderInlineField(propKey, propSchema, row[propKey], (val) => {
|
|
276
|
-
const updated = [...rows];
|
|
277
|
-
updated[idx] = { ...updated[idx], [propKey]: val };
|
|
278
|
-
commit(updated);
|
|
279
|
-
}, ctx, value))}
|
|
280
|
-
<sp-action-button
|
|
281
|
-
quiet
|
|
282
|
-
size="s"
|
|
283
|
-
@click=${() => {
|
|
284
|
-
const updated = rows.filter((_, i) => i !== idx);
|
|
285
|
-
commit(updated.length > 0 ? updated : undefined);
|
|
286
|
-
opts.rerender?.();
|
|
287
|
-
}}
|
|
288
|
-
>
|
|
289
|
-
<sp-icon-delete slot="icon"></sp-icon-delete>
|
|
290
|
-
</sp-action-button>
|
|
291
|
-
</div>
|
|
292
|
-
`)}
|
|
293
|
-
<sp-action-button
|
|
294
|
-
quiet
|
|
295
|
-
size="s"
|
|
296
|
-
@click=${(e) => {
|
|
297
|
-
e.stopPropagation();
|
|
298
|
-
const newRow = {};
|
|
299
|
-
for (const [k, v] of Object.entries(itemProps)) {
|
|
300
|
-
if (v.default !== undefined) {
|
|
301
|
-
newRow[k] = v.default;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
commit([...rows, newRow]);
|
|
305
|
-
opts.rerender?.();
|
|
306
|
-
}}
|
|
307
|
-
>+ Add</sp-action-button
|
|
308
|
-
>
|
|
309
|
-
</div>
|
|
310
|
-
`;
|
|
311
|
-
}
|
|
312
|
-
if (ps.type === "array" || ps.type === "object") {
|
|
313
|
-
return renderJsonTextField(currentValue, ps, commit);
|
|
314
|
-
}
|
|
315
|
-
let debounce;
|
|
316
|
-
const params = ctx.params ?? [];
|
|
317
|
-
const ph = ps.default !== undefined ? String(ps.default) : ps.examples?.[0] ?? "";
|
|
318
|
-
return html`<div style="display:flex;gap:4px;align-items:center">
|
|
319
|
-
<sp-textfield
|
|
320
|
-
size="s"
|
|
321
|
-
style="flex:1"
|
|
322
|
-
.value=${currentValue ?? ""}
|
|
323
|
-
placeholder=${ph || nothing}
|
|
324
|
-
title=${ps.description || nothing}
|
|
325
|
-
@input=${(e) => {
|
|
326
|
-
clearTimeout(debounce);
|
|
327
|
-
debounce = setTimeout(() => commit(e.target.value || undefined), 400);
|
|
328
|
-
}}
|
|
329
|
-
></sp-textfield>
|
|
330
|
-
${params.length > 0 ? html`<sp-action-button
|
|
331
|
-
quiet
|
|
332
|
-
size="s"
|
|
333
|
-
title="Bind to route param"
|
|
334
|
-
@click=${() => {
|
|
335
|
-
commit({ $ref: `#/$params/${params[0]}` });
|
|
336
|
-
opts.rerender?.();
|
|
337
|
-
}}
|
|
338
|
-
><sp-icon-link slot="icon"></sp-icon-link
|
|
339
|
-
></sp-action-button>` : nothing}
|
|
340
|
-
</div>`;
|
|
341
|
-
}
|
|
342
|
-
function renderForm(schema, value, opts) {
|
|
343
|
-
const required = new Set(schema.required);
|
|
344
|
-
const ctx = opts.context ?? NULL_CONTEXT;
|
|
345
|
-
const propertyFields = Object.entries(schema.properties ?? {}).map(([prop, ps]) => {
|
|
346
|
-
const labelText = prop + (required.has(prop) ? " *" : "");
|
|
347
|
-
return renderFieldRow({
|
|
348
|
-
hasValue: false,
|
|
349
|
-
label: labelText,
|
|
350
|
-
prop: ps.name || prop,
|
|
351
|
-
widget: renderPropertyControl(prop, ps, value, required, opts, ctx)
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
return html`${propertyFields}`;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// src/services/context-resolver.ts
|
|
358
|
-
var PARAM_SEGMENT = /^\{@(\w+)\}$/;
|
|
359
|
-
function resolveContextPointer(pointer, opts) {
|
|
360
|
-
if (!pointer.startsWith("#/$context/")) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
const segments = [];
|
|
364
|
-
for (const raw of pointer.slice("#/$context/".length).split("/")) {
|
|
365
|
-
const match = raw.match(PARAM_SEGMENT);
|
|
366
|
-
if (match) {
|
|
367
|
-
const value = opts.scope?.[match[1]];
|
|
368
|
-
if (typeof value !== "string" && typeof value !== "number") {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const substituted = String(value);
|
|
372
|
-
if (!substituted) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
segments.push(substituted);
|
|
376
|
-
} else {
|
|
377
|
-
segments.push(raw);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (segments[0] === "$formats") {
|
|
381
|
-
if (segments.length !== 1) {
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
return (opts.formats ?? []).map((format) => format.name);
|
|
385
|
-
}
|
|
386
|
-
let node = opts.projectConfig;
|
|
387
|
-
for (const segment of segments) {
|
|
388
|
-
if (node === null || typeof node !== "object") {
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
node = node[segment];
|
|
392
|
-
}
|
|
393
|
-
return node;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export { renderFieldRow, registerFormControl, renderForm, resolveContextPointer };
|
|
397
|
-
|
|
398
|
-
//# debugId=C2BB6E7E97CDF54564756E2164756E21
|
|
399
|
-
//# sourceMappingURL=studio-yfcstdzy.js.map
|