@jxsuite/studio 4.0.0 → 5.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.
- package/README.md +1 -1
- package/data/elements-meta.json +5 -15
- package/data/html-meta.json +51 -6
- package/dist/chunks/{2020-xp8vnwma.js → 2020-g79n01v9.js} +14 -14
- package/dist/chunks/action-group-sp6tna8v.js +118 -0
- package/dist/chunks/adapter-nj7tnjfn.js +13 -0
- package/dist/chunks/cf-account-picker-fyf63pmy.js +495 -0
- package/dist/chunks/cf-settings-71bv5zn9.js +20 -0
- package/dist/chunks/color-area-v17df7b8.js +154 -0
- package/dist/chunks/color-field-anwybnkn.js +208 -0
- package/dist/chunks/color-slider-44ez96fc.js +79 -0
- package/dist/chunks/color-xgg3kfw7.js +35 -0
- package/dist/chunks/combobox-5e7jev23.js +236 -0
- package/dist/chunks/components-2w1f35qs.js +18 -0
- package/dist/chunks/content-source-3wqeas45.js +46 -0
- package/dist/chunks/convert-to-repeater-d0cgnb6d.js +639 -0
- package/dist/chunks/dialog-s890b918.js +85 -0
- package/dist/chunks/editor-3qhbg51x.js +35 -0
- package/dist/chunks/entry-commands-d6g50j7s.js +42 -0
- package/dist/chunks/extension-sections-fy7q4fe9.js +651 -0
- package/dist/chunks/file-ops-3btj6st0.js +47 -0
- package/dist/chunks/files-ef8fgs3w.js +72 -0
- package/dist/chunks/format-host-3c33nwr8.js +40 -0
- package/dist/chunks/fs-events-13tj6sex.js +18 -0
- package/dist/chunks/git-panel-4wp2rn9b.js +49 -0
- package/dist/chunks/icons-yy10wk9r.js +402 -0
- package/dist/chunks/iframe-entry-15g3n6xv.js +114 -0
- package/dist/chunks/iframe-entry-b27vq81n.js +203 -0
- package/dist/chunks/iframe-entry-nbyxee1y.js +154 -0
- package/dist/chunks/iframe-host-jgesd924.js +115 -0
- package/dist/chunks/{index-nj44jpzj.js → index-mdmyx6s2.js} +11 -11
- package/dist/chunks/index-n4j7qxyr.js +109 -0
- package/dist/chunks/{javascript-q8kpmfah.js → javascript-xvrfrpkb.js} +8 -9
- package/dist/chunks/{jsonMode-dkr040ga.js → jsonMode-tyx2kj6p.js} +526 -527
- package/dist/chunks/jx-validate-j0wxk72w.js +15 -0
- package/dist/chunks/layers-1nq5evsh.js +29 -0
- package/dist/chunks/layers-panel-ar2gh90g.js +40 -0
- package/dist/chunks/listbox-6v2ac08j.js +44 -0
- package/dist/chunks/lit-html-m244w9nh.js +17 -0
- package/dist/chunks/media-picker-2qbetq73.js +33 -0
- package/dist/chunks/menu-q99sy9rf.js +285 -0
- package/dist/chunks/menu-rf7n72mf.js +14 -0
- package/dist/chunks/{monaco-binding-rj6xpx9y.js → monaco-binding-sw6en4dw.js} +12 -15
- package/dist/chunks/monaco-buffer-bhy3hb6m.js +24 -0
- package/dist/chunks/{monaco-setup-rws7k4br.js → monaco-setup-8r62fj6y.js} +27 -37
- package/dist/chunks/notify-628t0anh.js +21 -0
- package/dist/chunks/number-field-5cndyft8.js +72 -0
- package/dist/chunks/parse-0zx14y15.js +10 -0
- package/dist/chunks/platform-ts9cg1a4.js +15 -0
- package/dist/chunks/popover-47z3ytva.js +25 -0
- package/dist/chunks/publish-panel-98f7sr3g.js +27 -0
- package/dist/chunks/quick-search-srzz83k2.js +45 -0
- package/dist/chunks/references-n553f0e1.js +26 -0
- package/dist/chunks/right-panel-rrgx2dn3.js +45 -0
- package/dist/chunks/section-registry-5pq32t0q.js +25 -0
- package/dist/chunks/select-2r16ez41.js +49 -0
- package/dist/chunks/split-g7nm1rgb.js +191 -0
- package/dist/chunks/studio-0hqbpbd0.js +62 -0
- package/dist/chunks/studio-18avnhjp.js +2430 -0
- package/dist/chunks/{studio-kryvsw6j.js → studio-1k325pwf.js} +48 -48
- package/dist/chunks/{studio-hbtp0eh1.js → studio-25hkdrkw.js} +356 -85
- package/dist/chunks/studio-26d7myd1.js +258 -0
- package/dist/chunks/{studio-p8j86wag.js → studio-38emantv.js} +22 -5
- package/dist/chunks/studio-3gxv60tn.js +422 -0
- package/dist/chunks/{studio-8swrjbny.js → studio-3hxkd92t.js} +275 -163
- package/dist/chunks/studio-4m0haseg.js +185 -0
- package/dist/chunks/{studio-ynxwkrzd.js → studio-4wbb9ct0.js} +1953 -1785
- package/dist/chunks/{studio-gv8vvshc.js → studio-5523bpzt.js} +11 -11
- package/dist/chunks/{studio-5q69gfag.js → studio-57mf66w2.js} +1753 -2484
- package/dist/chunks/studio-5jy81t3s.js +17463 -0
- package/dist/chunks/studio-5rt7sqa0.js +1168 -0
- package/dist/chunks/studio-5te5tqng.js +81 -0
- package/dist/chunks/{studio-p4ngc046.js → studio-6ewqv390.js} +9 -9
- package/dist/chunks/{studio-9ab8gqsm.js → studio-6nzaktvy.js} +7 -7
- package/dist/chunks/studio-6xa21ej9.js +28 -0
- package/dist/chunks/{studio-5ehhackm.js → studio-727xh0e3.js} +19 -19
- package/dist/chunks/{studio-eenfkt4e.js → studio-79y5sz51.js} +52 -38
- package/dist/chunks/{studio-4q0wznzf.js → studio-7e11jpa9.js} +461 -145
- package/dist/chunks/{studio-q7v10cg2.js → studio-7r42c6ca.js} +17 -7
- package/dist/chunks/studio-7xptrg0j.js +954 -0
- package/dist/chunks/{studio-cft9r4r7.js → studio-81390n6f.js} +22 -22
- package/dist/chunks/{studio-q43a5y9h.js → studio-8jn5yhyn.js} +16 -16
- package/dist/chunks/studio-8qtrpzr3.js +839 -0
- package/dist/chunks/{studio-dg7zyt5x.js → studio-98b3z07n.js} +1 -1
- package/dist/chunks/studio-9xxz1q69.js +1356 -0
- package/dist/chunks/studio-akbww0j5.js +13615 -0
- package/dist/chunks/studio-arfpe389.js +195 -0
- package/dist/chunks/{studio-2zkz8evn.js → studio-az3zd49t.js} +473 -281
- package/dist/chunks/studio-cpvb2ed1.js +1171 -0
- package/dist/chunks/{studio-9r6j5ev1.js → studio-d0300636.js} +5078 -19
- package/dist/chunks/{studio-bgxt93ga.js → studio-d055c37e.js} +13 -13
- package/dist/chunks/studio-d1ja2x9r.js +362 -0
- package/dist/chunks/{studio-b9b6t1dg.js → studio-e1f24eff.js} +5664 -5666
- package/dist/chunks/{studio-4pqqxbrt.js → studio-em9nw8eh.js} +301 -112
- package/dist/chunks/studio-erdatzvp.js +1190 -0
- package/dist/chunks/{studio-g1wdche0.js → studio-esrxgwh6.js} +80 -80
- package/dist/chunks/studio-fabxk6r9.js +2811 -0
- package/dist/chunks/{studio-3n4ndrzh.js → studio-h4nvnjvz.js} +303 -303
- package/dist/chunks/studio-hhvs4sdg.js +195 -0
- package/dist/chunks/{studio-68n67094.js → studio-kcgff4r0.js} +15 -18
- package/dist/chunks/{studio-685s0ytq.js → studio-nqgawfks.js} +572 -572
- package/dist/chunks/{studio-xrapxwwc.js → studio-p1dw8wfw.js} +55 -29
- package/dist/chunks/studio-pm6hgy7r.js +4763 -0
- package/dist/chunks/studio-q0a3yk4n.js +33 -0
- package/dist/chunks/{studio-wcy8trfx.js → studio-q3x06vmj.js} +23 -22
- package/dist/chunks/studio-qahxvnan.js +111 -0
- package/dist/chunks/{studio-53n8bp04.js → studio-r6xmmtfh.js} +1 -1
- package/dist/chunks/{studio-kjjsjak4.js → studio-rkstz940.js} +3661 -6136
- package/dist/chunks/{studio-tvgyw9xw.js → studio-rnyf3f8e.js} +83 -250
- package/dist/chunks/studio-rpyah2ew.js +2805 -0
- package/dist/chunks/studio-rs76k67r.js +12 -0
- package/dist/chunks/{studio-yxrkyv8a.js → studio-s6z853aq.js} +12108 -11766
- package/dist/chunks/{studio-sf7zjgv1.js → studio-sgdc5pfc.js} +8 -8
- package/dist/chunks/studio-tb3ev01j.js +763 -0
- package/dist/chunks/{studio-t5wqwzdh.js → studio-tjjk7jvk.js} +1 -1
- package/dist/chunks/studio-vhv5tgxm.js +51 -0
- package/dist/chunks/{studio-htsf0w6m.js → studio-vz68yn9e.js} +31 -154
- package/dist/chunks/studio-wqpngpsk.js +174 -0
- package/dist/chunks/{studio-eesa1myv.js → studio-x3rty6tr.js} +58 -58
- package/dist/chunks/studio-xsykpvsh.js +8448 -0
- package/dist/chunks/{studio-92ab2jqe.js → studio-y9zedyjn.js} +14 -14
- package/dist/chunks/studio-yxa81f45.js +12 -0
- package/dist/chunks/swatch-group-t0n6h2rn.js +139 -0
- package/dist/chunks/tabs-wbp1cdws.js +156 -0
- package/dist/chunks/textfield-abk6qyee.js +73 -0
- package/dist/chunks/toast-780pvfbv.js +27 -0
- package/dist/chunks/toast-host-3sqv46sn.js +116 -0
- package/dist/chunks/toolbar-xbh5bhtr.js +194 -0
- package/dist/chunks/tooltip-eptb614w.js +369 -0
- package/dist/chunks/tree-a73p0pqm.js +367 -0
- package/dist/chunks/{tsMode-76kr53q0.js → tsMode-jy4m86rv.js} +83 -85
- package/dist/chunks/workspace-wrew8zk4.js +69 -0
- package/dist/chunks/{ws-client-6shc5rze.js → ws-client-ny4zc51r.js} +20 -22
- package/dist/iframe-entry.js +1812 -698
- package/dist/manifest.json +7 -0
- package/dist/studio.js +52900 -36573
- package/dist/workers/editor.worker.js +1040 -1085
- package/dist/workers/json.worker.js +1946 -1991
- package/dist/workers/ts.worker.js +4960 -5005
- package/favicon.ico +0 -0
- package/index.html +2 -0
- package/package.json +22 -55
- package/src/about/about-modal.ts +73 -123
- package/src/browse/library-commands.ts +20 -49
- package/src/browse/library-layouts.ts +87 -218
- package/src/browse/library-pane.ts +406 -438
- package/src/canvas/canvas-helpers.ts +0 -49
- package/src/canvas/canvas-live-render.ts +25 -2
- package/src/canvas/canvas-render.ts +666 -231
- package/src/canvas/canvas-surface.ts +0 -1
- package/src/canvas/canvas-utils.ts +310 -117
- package/src/canvas/dialog-path.ts +76 -0
- package/src/canvas/dialog-state.ts +67 -0
- package/src/canvas/diff-marks.ts +252 -0
- package/src/canvas/diff-toolbar.ts +349 -0
- package/src/canvas/diff-view.ts +123 -0
- package/src/canvas/edit-width-drag.ts +187 -0
- package/src/canvas/edit-width.ts +150 -0
- package/src/canvas/iframe-entry.ts +125 -8
- package/src/canvas/iframe-host.ts +271 -15
- package/src/canvas/iframe-interaction.ts +133 -13
- package/src/canvas/iframe-patch.ts +7 -1
- package/src/canvas/iframe-position.ts +5 -6
- package/src/canvas/iframe-protocol.ts +106 -5
- package/src/canvas/iframe-render.ts +373 -5
- package/src/canvas/iframe-slash.ts +2 -2
- package/src/canvas/iframe-subtree.ts +5 -8
- package/src/canvas/path-mapping.ts +25 -3
- package/src/canvas/popover-path.ts +106 -0
- package/src/canvas/popover-state.ts +155 -0
- package/src/canvas/surface-registry.ts +21 -10
- package/src/collab/presence-chips.ts +51 -73
- package/src/commands/app-commands.ts +10 -0
- package/src/commands/budget.ts +12 -0
- package/src/commands/command-args.ts +369 -6
- package/src/commands/defaults.ts +44 -14
- package/src/commands/live-context.ts +11 -5
- package/src/commands/reference.ts +12 -2
- package/src/commands/registry.ts +165 -8
- package/src/content/entry-commands.ts +16 -23
- package/src/content/entry-editor.ts +144 -101
- package/src/editor/canvas-slash-bridge.ts +2 -2
- package/src/editor/context-menu.ts +49 -200
- package/src/editor/convert-to-component.ts +42 -82
- package/src/editor/convert-to-repeater.ts +132 -173
- package/src/editor/inline-edit.ts +11 -0
- package/src/editor/shortcuts.ts +65 -26
- package/src/editor/slash-menu.ts +150 -157
- package/src/files/file-ops.ts +117 -11
- package/src/files/files.ts +949 -664
- package/src/files/json-layout.ts +474 -0
- package/src/files/media-paths.ts +13 -42
- package/src/files/media-usage.ts +41 -131
- package/src/files/serialize-document.ts +8 -1
- package/src/format/convert-file.ts +16 -10
- package/src/format/format-host.ts +50 -1
- package/src/github/github-auth.ts +71 -29
- package/src/github/github-publish.ts +57 -65
- package/src/grid/cell-editors.ts +46 -4
- package/src/grid/cell-popovers.ts +65 -62
- package/src/grid/grid-open.ts +86 -64
- package/src/grid/grid-panel.ts +390 -469
- package/src/grid/redirects-grid.ts +40 -44
- package/src/hosting/document.ts +2 -0
- package/src/hosting/layout.ts +10 -0
- package/src/i18n/i18n-commands.ts +127 -62
- package/src/media/media-pane.ts +83 -133
- package/src/new-project/add-repo-modal.ts +125 -176
- package/src/new-project/import-tab.ts +201 -250
- package/src/new-project/location-fields.ts +101 -165
- package/src/new-project/new-project-modal.ts +376 -367
- package/src/packages/jxsuite-update.ts +76 -18
- package/src/panels/activity-panel.ts +137 -104
- package/src/panels/ai-chat/chat-markdown.ts +15 -13
- package/src/panels/ai-chat/chat-view.ts +307 -472
- package/src/panels/ai-chat/composer.ts +175 -153
- package/src/panels/ai-chat/sessions-view.ts +31 -62
- package/src/panels/ai-panel.ts +210 -185
- package/src/panels/block-action-bar.ts +437 -643
- package/src/panels/bottom-dock.ts +112 -47
- package/src/panels/chat-panel.ts +19 -14
- package/src/panels/data-explorer.ts +141 -102
- package/src/panels/data-grid.ts +183 -150
- package/src/panels/dnd.ts +75 -20
- package/src/panels/editors.ts +26 -19
- package/src/panels/elements-panel.ts +243 -186
- package/src/panels/empty-state.ts +26 -42
- package/src/panels/events-panel.ts +950 -729
- package/src/panels/formula-workspace.ts +434 -207
- package/src/panels/frontmatter-fields.ts +185 -153
- package/src/panels/frontmatter-panel.ts +411 -187
- package/src/panels/git-diff-open.ts +148 -0
- package/src/panels/git-panel.ts +679 -605
- package/src/panels/head-panel.ts +617 -435
- package/src/panels/i18n-panel.ts +153 -133
- package/src/panels/imports-panel.ts +388 -414
- package/src/panels/jump-bar.ts +174 -147
- package/src/panels/layers-panel.ts +785 -671
- package/src/panels/left-panel.ts +166 -94
- package/src/panels/navigator-panels.ts +1 -1
- package/src/panels/pane-context.ts +529 -677
- package/src/panels/pane-grid.ts +265 -241
- package/src/panels/panel-registry.ts +15 -4
- package/src/panels/problems-panel.ts +177 -99
- package/src/panels/properties-panel.ts +1525 -966
- package/src/panels/provenance.ts +31 -113
- package/src/panels/quick-search.ts +217 -172
- package/src/panels/right-panel.ts +135 -169
- package/src/panels/seo-modal.ts +346 -167
- package/src/panels/settings-menu.ts +109 -646
- package/src/panels/settings-pane.ts +102 -86
- package/src/panels/signals-panel.ts +1318 -1172
- package/src/panels/statement-editor.ts +556 -428
- package/src/panels/style-panel.ts +1367 -630
- package/src/panels/style-utils.ts +36 -32
- package/src/panels/stylebook-doc.ts +30 -73
- package/src/panels/stylebook-layers-panel.ts +202 -109
- package/src/panels/stylebook-panel.ts +124 -88
- package/src/panels/tab-strip.ts +385 -287
- package/src/platforms/cloud.ts +347 -86
- package/src/platforms/devserver.ts +13 -0
- package/src/publish/deploy-checklist.ts +124 -78
- package/src/publish/publish-commands.ts +4 -12
- package/src/publish/publish-panel.ts +165 -299
- package/src/services/a11y-report.ts +100 -43
- package/src/services/ai-command-tools.ts +468 -0
- package/src/services/ai-import-tools.ts +50 -12
- package/src/services/ai-models.ts +108 -1
- package/src/services/ai-session-store.ts +6 -0
- package/src/services/ai-system-prompt.ts +110 -18
- package/src/services/ai-tools.ts +28 -143
- package/src/services/ai-write-report.ts +174 -0
- package/src/services/context-manager.ts +12 -1
- package/src/services/document-assistant.ts +50 -2
- package/src/services/idle.ts +16 -14
- package/src/services/live-surfaces.ts +237 -0
- package/src/services/model-uri.ts +75 -0
- package/src/services/notify.ts +63 -6
- package/src/services/popover-report.ts +325 -0
- package/src/services/surface-registry.ts +56 -0
- package/src/services/tool-executor.ts +17 -0
- package/src/settings/contexts-section.ts +301 -299
- package/src/settings/contributed-section.ts +361 -222
- package/src/settings/css-vars-editor.ts +320 -325
- package/src/settings/defs-editor.ts +572 -535
- package/src/settings/dependencies-editor.ts +79 -107
- package/src/settings/extension-commands.ts +379 -0
- package/src/settings/extension-rows.ts +113 -0
- package/src/settings/extensions-section.ts +287 -0
- package/src/settings/general-settings.ts +130 -181
- package/src/settings/head-editor.ts +10 -305
- package/src/settings/locales-section.ts +146 -196
- package/src/settings/preferences-accounts.ts +193 -12
- package/src/settings/preferences-dialog.ts +384 -307
- package/src/settings/project-sections.ts +108 -181
- package/src/settings/schema-field-ui.ts +11 -399
- package/src/settings/section-registry.ts +8 -1
- package/src/settings/settings-document.ts +31 -29
- package/src/shell/tree.ts +42 -87
- package/src/shell.ts +48 -36
- package/src/studio.ts +90 -67
- package/src/style/token-ref.ts +0 -39
- package/src/surfaces/about.json +263 -0
- package/src/surfaces/about.ts +163 -0
- package/src/surfaces/add-repo.json +486 -0
- package/src/surfaces/add-repo.ts +236 -0
- package/src/surfaces/ai-chat.json +2185 -0
- package/src/surfaces/ai-chat.ts +549 -0
- package/src/surfaces/ai-credentials-form.json +332 -0
- package/src/surfaces/ai-credentials-form.ts +151 -0
- package/src/surfaces/ai-managed-connect.json +108 -0
- package/src/surfaces/ai-managed-connect.ts +123 -0
- package/src/surfaces/ai-model-picker.json +114 -0
- package/src/surfaces/ai-model-picker.ts +139 -0
- package/src/surfaces/block-action-bar.json +640 -0
- package/src/surfaces/block-action-bar.ts +368 -0
- package/src/surfaces/bottom-dock.json +154 -0
- package/src/surfaces/bottom-dock.ts +125 -0
- package/src/surfaces/canvas-stage.json +444 -0
- package/src/surfaces/canvas-stage.ts +253 -0
- package/src/surfaces/cf-account-picker.json +300 -0
- package/src/surfaces/cf-account-picker.ts +214 -0
- package/src/surfaces/commandbar.json +984 -0
- package/src/{panels/toolbar.ts → surfaces/commandbar.ts} +414 -389
- package/src/surfaces/convert-repeater.json +309 -0
- package/src/surfaces/convert-repeater.ts +276 -0
- package/src/surfaces/data-actions.json +157 -0
- package/src/surfaces/data-actions.ts +115 -0
- package/src/surfaces/dialog.json +289 -0
- package/src/surfaces/dialog.ts +343 -0
- package/src/surfaces/diff-toolbar.json +266 -0
- package/src/surfaces/diff-toolbar.ts +139 -0
- package/src/surfaces/doc-header.json +739 -0
- package/src/surfaces/doc-header.ts +223 -0
- package/src/surfaces/empty-state.json +152 -0
- package/src/surfaces/empty-state.ts +173 -0
- package/src/surfaces/entry-editor.json +281 -0
- package/src/surfaces/entry-editor.ts +191 -0
- package/src/surfaces/expression-editor.json +977 -0
- package/src/surfaces/expression-editor.ts +266 -0
- package/src/surfaces/files-panel.json +592 -0
- package/src/surfaces/files-panel.ts +301 -0
- package/src/surfaces/formula-palette.json +364 -0
- package/src/surfaces/formula-palette.ts +340 -0
- package/src/surfaces/git-panel.json +1822 -0
- package/src/surfaces/git-panel.ts +272 -0
- package/src/surfaces/github-auth.json +112 -0
- package/src/surfaces/github-auth.ts +139 -0
- package/src/surfaces/github-publish.json +206 -0
- package/src/surfaces/github-publish.ts +169 -0
- package/src/surfaces/grid-cell.json +218 -0
- package/src/surfaces/grid-cell.ts +120 -0
- package/src/surfaces/grid-open.json +147 -0
- package/src/surfaces/grid-open.ts +87 -0
- package/src/surfaces/grid-panel.json +706 -0
- package/src/surfaces/grid-panel.ts +206 -0
- package/src/surfaces/grid-replace.json +179 -0
- package/src/surfaces/grid-replace.ts +89 -0
- package/src/surfaces/grid-views.json +446 -0
- package/src/surfaces/grid-views.ts +172 -0
- package/src/surfaces/inspector-dock.json +187 -0
- package/src/surfaces/inspector-dock.ts +161 -0
- package/src/surfaces/jump-bar.json +243 -0
- package/src/surfaces/jump-bar.ts +129 -0
- package/src/surfaces/jxsuite-update.json +146 -0
- package/src/surfaces/jxsuite-update.ts +149 -0
- package/src/surfaces/library-pane.json +1509 -0
- package/src/surfaces/library-pane.ts +363 -0
- package/src/surfaces/logic-panel.json +1949 -0
- package/src/surfaces/logic-panel.ts +369 -0
- package/src/surfaces/logic-workspace.json +685 -0
- package/src/surfaces/logic-workspace.ts +238 -0
- package/src/surfaces/media-browser.json +303 -0
- package/src/surfaces/media-browser.ts +145 -0
- package/src/surfaces/media-field.json +163 -0
- package/src/surfaces/media-field.ts +116 -0
- package/src/surfaces/media-pane.json +513 -0
- package/src/surfaces/media-pane.ts +197 -0
- package/src/surfaces/menu.json +232 -0
- package/src/surfaces/menu.ts +375 -0
- package/src/surfaces/navigator-dock.json +113 -0
- package/src/surfaces/navigator-dock.ts +130 -0
- package/src/surfaces/new-project.json +1654 -0
- package/src/surfaces/new-project.ts +411 -0
- package/src/surfaces/palette.json +535 -0
- package/src/surfaces/pane-context.json +1497 -0
- package/src/surfaces/pane-context.ts +513 -0
- package/src/surfaces/pane-grid.json +188 -0
- package/src/surfaces/pane-grid.ts +250 -0
- package/src/surfaces/panel-activity.json +563 -0
- package/src/surfaces/panel-activity.ts +187 -0
- package/src/surfaces/panel-data.json +141 -0
- package/src/surfaces/panel-data.ts +156 -0
- package/src/surfaces/panel-deploy-checklist.json +283 -0
- package/src/surfaces/panel-deploy-checklist.ts +175 -0
- package/src/surfaces/panel-elements.json +367 -0
- package/src/surfaces/panel-elements.ts +175 -0
- package/src/surfaces/panel-i18n.json +569 -0
- package/src/surfaces/panel-i18n.ts +212 -0
- package/src/surfaces/panel-imports.json +780 -0
- package/src/surfaces/panel-imports.ts +209 -0
- package/src/surfaces/panel-outline.json +734 -0
- package/src/surfaces/panel-outline.ts +326 -0
- package/src/surfaces/panel-page.json +1017 -0
- package/src/surfaces/panel-page.ts +240 -0
- package/src/surfaces/panel-problems.json +497 -0
- package/src/surfaces/panel-problems.ts +157 -0
- package/src/surfaces/panel-signals.json +1973 -0
- package/src/surfaces/panel-signals.ts +436 -0
- package/src/surfaces/panel-stylebook-layers.json +317 -0
- package/src/surfaces/panel-stylebook-layers.ts +155 -0
- package/src/surfaces/preferences.json +850 -0
- package/src/surfaces/preferences.ts +332 -0
- package/src/surfaces/progress-modal.json +110 -0
- package/src/surfaces/progress-modal.ts +150 -0
- package/src/surfaces/properties-panel.json +1578 -0
- package/src/surfaces/properties-panel.ts +337 -0
- package/src/surfaces/publish.json +945 -0
- package/src/surfaces/publish.ts +392 -0
- package/src/surfaces/push-plan.json +110 -0
- package/src/surfaces/push-plan.ts +87 -0
- package/src/surfaces/rail.json +255 -0
- package/src/surfaces/rail.ts +206 -0
- package/src/surfaces/reference-field.json +191 -0
- package/src/surfaces/reference-field.ts +168 -0
- package/src/surfaces/schema-builder.json +1011 -0
- package/src/surfaces/schema-builder.ts +181 -0
- package/src/surfaces/schema-form.json +1013 -0
- package/src/surfaces/schema-form.ts +287 -0
- package/src/surfaces/secret-field.json +60 -0
- package/src/surfaces/secret-field.ts +146 -0
- package/src/surfaces/seo.json +932 -0
- package/src/surfaces/seo.ts +334 -0
- package/src/surfaces/settings-contexts.json +538 -0
- package/src/surfaces/settings-contexts.ts +196 -0
- package/src/surfaces/settings-contributed.json +489 -0
- package/src/surfaces/settings-contributed.ts +199 -0
- package/src/surfaces/settings-css-vars.json +820 -0
- package/src/surfaces/settings-css-vars.ts +199 -0
- package/src/surfaces/settings-defs.json +1363 -0
- package/src/surfaces/settings-defs.ts +232 -0
- package/src/surfaces/settings-deploy.json +108 -0
- package/src/surfaces/settings-deploy.ts +135 -0
- package/src/surfaces/settings-extensions.json +486 -0
- package/src/surfaces/settings-extensions.ts +201 -0
- package/src/surfaces/settings-head.json +779 -0
- package/src/surfaces/settings-head.ts +397 -0
- package/src/surfaces/settings-locales.json +420 -0
- package/src/surfaces/settings-locales.ts +137 -0
- package/src/surfaces/settings-overview.json +423 -0
- package/src/surfaces/settings-overview.ts +218 -0
- package/src/surfaces/settings-packages.json +549 -0
- package/src/surfaces/settings-packages.ts +158 -0
- package/src/surfaces/settings-pane.json +147 -0
- package/src/surfaces/settings-pane.ts +150 -0
- package/src/surfaces/settings-rawjson.json +104 -0
- package/src/surfaces/settings-rawjson.ts +107 -0
- package/src/surfaces/shell.json +99 -0
- package/src/surfaces/shell.ts +30 -0
- package/src/surfaces/slash-menu.json +180 -0
- package/src/surfaces/slash-menu.ts +272 -0
- package/src/surfaces/statements.json +607 -0
- package/src/surfaces/statements.ts +238 -0
- package/src/surfaces/statusbar.json +94 -0
- package/src/{panels → surfaces}/statusbar.ts +163 -90
- package/src/surfaces/style-panel.json +1643 -0
- package/src/surfaces/style-panel.ts +338 -0
- package/src/surfaces/stylebook-chrome.json +122 -0
- package/src/surfaces/stylebook-chrome.ts +122 -0
- package/src/surfaces/tab-strip.json +448 -0
- package/src/surfaces/tab-strip.ts +200 -0
- package/src/surfaces/target-line.json +419 -0
- package/src/surfaces/target-line.ts +349 -0
- package/src/surfaces/toasts.json +189 -0
- package/src/surfaces/welcome.json +571 -0
- package/src/surfaces/welcome.ts +338 -0
- package/src/tabs/project-config.ts +71 -15
- package/src/tabs/tab.ts +52 -1
- package/src/types.ts +49 -3
- package/src/ui/ai-credentials-form.ts +104 -100
- package/src/ui/ai-managed-connect.ts +116 -49
- package/src/ui/ai-model-picker.ts +102 -47
- package/src/ui/cf-account-picker.ts +135 -0
- package/src/ui/color-selector.ts +80 -301
- package/src/ui/dynamic-slot.ts +43 -283
- package/src/ui/expression-editor.ts +797 -576
- package/src/ui/field-input.ts +8 -181
- package/src/ui/form-controls.ts +838 -366
- package/src/ui/formula-chips.ts +80 -85
- package/src/ui/kit.ts +33 -0
- package/src/ui/layers.ts +293 -593
- package/src/ui/media-picker.ts +203 -284
- package/src/ui/panel-resize.ts +251 -64
- package/src/ui/popover-surface.ts +153 -0
- package/src/ui/progress-modal.ts +22 -60
- package/src/ui/regions.ts +13 -7
- package/src/ui/schema-form.ts +906 -440
- package/src/ui/surface.ts +122 -0
- package/src/ui/unit-selector.ts +15 -131
- package/src/ui/value-source.ts +14 -0
- package/src/ui/virtual-window.ts +88 -9
- package/src/utils/canvas-media.ts +72 -0
- package/src/utils/edit-display.ts +7 -2
- package/src/utils/element-selectors.ts +69 -0
- package/src/utils/link-target.ts +2 -2
- package/src/utils/studio-utils.ts +0 -10
- package/src/view.ts +15 -0
- package/src/workspace/pane-derive.ts +36 -14
- package/src/workspace/workspace.ts +15 -6
- package/styles/canvas.css +72 -467
- package/styles/forced-colors.css +48 -82
- package/styles/forced-colors.json +41 -0
- package/styles/inspector.css +2 -1301
- package/styles/overlays.css +96 -2823
- package/styles/panels.css +6 -1423
- package/styles/shell-frame.css +272 -0
- package/styles/shell-frame.json +227 -0
- package/styles/shell.css +0 -1532
- package/styles/tokens.css +65 -136
- package/styles/tokens.json +84 -0
- package/dist/chunks/Overlay.dev-723bv0df.js +0 -23
- package/dist/chunks/adapter-jkcyhgtr.js +0 -14
- package/dist/chunks/cf-settings-45fgyx8y.js +0 -21
- package/dist/chunks/components-zmx10t62.js +0 -21
- package/dist/chunks/content-source-t88vb2dr.js +0 -49
- package/dist/chunks/convert-to-repeater-dhw1nrz9.js +0 -268
- package/dist/chunks/editor-cptq5jp1.js +0 -37
- package/dist/chunks/entry-commands-6z6bhxg0.js +0 -46
- package/dist/chunks/extension-sections-3ydgjbdy.js +0 -311
- package/dist/chunks/file-ops-rskmhxyq.js +0 -48
- package/dist/chunks/files-0cratsr0.js +0 -92
- package/dist/chunks/flow-qbfgrpeh.js +0 -634
- package/dist/chunks/focus-trap.esm-ggawf1hy.js +0 -1024
- package/dist/chunks/focus-visible-6eg70z18.js +0 -167
- package/dist/chunks/format-host-tgcmfs4p.js +0 -43
- package/dist/chunks/fs-events-hrrg328g.js +0 -21
- package/dist/chunks/git-panel-0yywyk76.js +0 -58
- package/dist/chunks/index-zqxmqxmh.js +0 -109
- package/dist/chunks/jx-validate-8q2g05x1.js +0 -19
- package/dist/chunks/layers-panel-z3tqe5cd.js +0 -67
- package/dist/chunks/layers-q75tj2mf.js +0 -45
- package/dist/chunks/lit-html-j055mkh8.js +0 -22
- package/dist/chunks/monaco-buffer-dqw0xxpx.js +0 -25
- package/dist/chunks/notify-yjm79n4s.js +0 -30
- package/dist/chunks/parse-24d0gay3.js +0 -19
- package/dist/chunks/platform-ba1j1gbh.js +0 -16
- package/dist/chunks/publish-panel-54jvhskq.js +0 -28
- package/dist/chunks/quick-search-cgfmjwq5.js +0 -65
- package/dist/chunks/references-3qx8fkyp.js +0 -29
- package/dist/chunks/right-panel-cqp8bc4v.js +0 -46
- package/dist/chunks/section-registry-sx1ykvkw.js +0 -30
- package/dist/chunks/sp-overlay.dev-yztmtrs1.js +0 -18
- package/dist/chunks/sp-popover.dev-n2etmqdp.js +0 -9
- package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +0 -15
- package/dist/chunks/sp-tooltip.dev-xcvpnqr0.js +0 -15
- package/dist/chunks/sp-tray.dev-tkbscm06.js +0 -199
- package/dist/chunks/studio-0a5qrh01.js +0 -3
- package/dist/chunks/studio-18j3bmcz.js +0 -14
- package/dist/chunks/studio-1hbqnt19.js +0 -1823
- package/dist/chunks/studio-4rzyrtjz.js +0 -426
- package/dist/chunks/studio-5rywrkxz.js +0 -1903
- package/dist/chunks/studio-7afd21nw.js +0 -67
- package/dist/chunks/studio-7nte2hj4.js +0 -613
- package/dist/chunks/studio-8jpzqk5s.js +0 -128
- package/dist/chunks/studio-8q517dfr.js +0 -24
- package/dist/chunks/studio-9c4k4vhv.js +0 -357
- package/dist/chunks/studio-9n4mrmnb.js +0 -184
- package/dist/chunks/studio-a0tswy0w.js +0 -58
- package/dist/chunks/studio-ahjfdy6e.js +0 -387
- package/dist/chunks/studio-ahnzd9rg.js +0 -23
- package/dist/chunks/studio-bw5dz6km.js +0 -608
- package/dist/chunks/studio-cb12yz9w.js +0 -15055
- package/dist/chunks/studio-d1ks410h.js +0 -175
- package/dist/chunks/studio-eqq1w638.js +0 -113
- package/dist/chunks/studio-ex8zyp98.js +0 -1813
- package/dist/chunks/studio-h4rxscfc.js +0 -10
- package/dist/chunks/studio-kyh9avvv.js +0 -28
- package/dist/chunks/studio-kyk2v92a.js +0 -659
- package/dist/chunks/studio-m3hwn7y1.js +0 -120
- package/dist/chunks/studio-mmv72a27.js +0 -4344
- package/dist/chunks/studio-n8b9wqwy.js +0 -291
- package/dist/chunks/studio-pdfjntbk.js +0 -6939
- package/dist/chunks/studio-qq6jym04.js +0 -53
- package/dist/chunks/studio-r1r7afxx.js +0 -1066
- package/dist/chunks/studio-rdx8jcxy.js +0 -83
- package/dist/chunks/studio-rn9ta2mz.js +0 -111
- package/dist/chunks/studio-t7qb9db8.js +0 -665
- package/dist/chunks/studio-tmc5emrw.js +0 -8
- package/dist/chunks/studio-txwkm6p9.js +0 -12
- package/dist/chunks/studio-v38hmvx1.js +0 -390
- package/dist/chunks/studio-vadzgkrz.js +0 -318
- package/dist/chunks/studio-wx5609xd.js +0 -341
- package/dist/chunks/studio-z6nw2ek2.js +0 -18
- package/dist/chunks/studio-zczps70q.js +0 -378
- package/dist/chunks/workspace-xpres40v.js +0 -89
- package/src/panels/activity-bar.ts +0 -251
- package/src/panels/panel-scheduler.ts +0 -219
- package/src/panels/style-inputs.ts +0 -237
- package/src/panels/target-line.ts +0 -274
- package/src/panels/welcome-screen.ts +0 -346
- package/src/ui/button-group.ts +0 -102
- package/src/ui/choice-field.ts +0 -72
- package/src/ui/field-row.ts +0 -249
- package/src/ui/formula-palette.ts +0 -213
- package/src/ui/icons.ts +0 -52
- package/src/ui/jx-theme.ts +0 -130
- package/src/ui/spectrum.ts +0 -340
- package/src/ui/value-selector.ts +0 -174
- package/src/ui/widgets.ts +0 -172
- /package/dist/chunks/{javascript-s56a8dpk.css → javascript-4abzjcy9.css} +0 -0
- /package/dist/chunks/{jsonMode-zr9sw0c7.css → jsonMode-vvmpmk34.css} +0 -0
- /package/dist/chunks/{monaco-setup-pav68602.css → monaco-setup-8vbyqnhr.css} +0 -0
- /package/dist/chunks/{tsMode-ef187txx.css → tsMode-hnxxb73h.css} +0 -0
|
@@ -940,9 +940,9 @@ var create5 = (left, right) => new Pair(left, right);
|
|
|
940
940
|
|
|
941
941
|
// ../../node_modules/lib0/prng.js
|
|
942
942
|
var bool = (gen) => gen.next() >= 0.5;
|
|
943
|
-
var int53 = (gen,
|
|
944
|
-
var int32 = (gen,
|
|
945
|
-
var int31 = (gen,
|
|
943
|
+
var int53 = (gen, min, max) => floor(gen.next() * (max + 1 - min) + min);
|
|
944
|
+
var int32 = (gen, min, max) => floor(gen.next() * (max + 1 - min) + min);
|
|
945
|
+
var int31 = (gen, min, max) => int32(gen, min, max);
|
|
946
946
|
var letter = (gen) => fromCharCode(int31(gen, 97, 122));
|
|
947
947
|
var word = (gen, minLen = 0, maxLen = 20) => {
|
|
948
948
|
const len = int31(gen, minLen, maxLen);
|
|
@@ -1157,10 +1157,10 @@ var $$object = $constructedBy($Object);
|
|
|
1157
1157
|
var $objectAny = $custom((o) => o != null && (o.constructor === Object || o.constructor == null));
|
|
1158
1158
|
|
|
1159
1159
|
class $Record extends Schema {
|
|
1160
|
-
constructor(
|
|
1160
|
+
constructor(keys, values) {
|
|
1161
1161
|
super();
|
|
1162
1162
|
this.shape = {
|
|
1163
|
-
keys
|
|
1163
|
+
keys,
|
|
1164
1164
|
values
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
@@ -1172,7 +1172,7 @@ class $Record extends Schema {
|
|
|
1172
1172
|
});
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
var $record = (
|
|
1175
|
+
var $record = (keys, values) => new $Record(keys, values);
|
|
1176
1176
|
var $$record = $constructedBy($Record);
|
|
1177
1177
|
|
|
1178
1178
|
class $Tuple extends Schema {
|
|
@@ -1223,11 +1223,11 @@ var $$instanceOf = $constructedBy($InstanceOf);
|
|
|
1223
1223
|
var $$schema = $instanceOf(Schema);
|
|
1224
1224
|
|
|
1225
1225
|
class $Lambda extends Schema {
|
|
1226
|
-
constructor(
|
|
1226
|
+
constructor(args) {
|
|
1227
1227
|
super();
|
|
1228
|
-
this.len =
|
|
1229
|
-
this.args = $tuple(...
|
|
1230
|
-
this.res =
|
|
1228
|
+
this.len = args.length - 1;
|
|
1229
|
+
this.args = $tuple(...args.slice(-1));
|
|
1230
|
+
this.res = args[this.len];
|
|
1231
1231
|
}
|
|
1232
1232
|
check(f, err) {
|
|
1233
1233
|
const c = f.constructor === Function && f.length <= this.len;
|
|
@@ -1289,10 +1289,10 @@ var $primitive = $union($number, $string, $null, $undefined, $bigint, $boolean,
|
|
|
1289
1289
|
var $json = (() => {
|
|
1290
1290
|
const $jsonArr = $array($any);
|
|
1291
1291
|
const $jsonRecord = $record($string, $any);
|
|
1292
|
-
const $
|
|
1293
|
-
$jsonArr.shape = $
|
|
1294
|
-
$jsonRecord.shape.values = $
|
|
1295
|
-
return $
|
|
1292
|
+
const $json = $union($number, $string, $null, $boolean, $jsonArr, $jsonRecord);
|
|
1293
|
+
$jsonArr.shape = $json;
|
|
1294
|
+
$jsonRecord.shape.values = $json;
|
|
1295
|
+
return $json;
|
|
1296
1296
|
})();
|
|
1297
1297
|
var $ = (o) => {
|
|
1298
1298
|
if ($$schema.check(o)) {
|
|
@@ -1422,15 +1422,15 @@ var RED = create6();
|
|
|
1422
1422
|
var PURPLE = create6();
|
|
1423
1423
|
var ORANGE = create6();
|
|
1424
1424
|
var UNCOLOR = create6();
|
|
1425
|
-
var computeNoColorLoggingArgs = (
|
|
1426
|
-
if (
|
|
1427
|
-
|
|
1425
|
+
var computeNoColorLoggingArgs = (args) => {
|
|
1426
|
+
if (args.length === 1 && args[0]?.constructor === Function) {
|
|
1427
|
+
args = args[0]();
|
|
1428
1428
|
}
|
|
1429
1429
|
const strBuilder = [];
|
|
1430
1430
|
const logArgs = [];
|
|
1431
1431
|
let i = 0;
|
|
1432
|
-
for (;i <
|
|
1433
|
-
const arg =
|
|
1432
|
+
for (;i < args.length; i++) {
|
|
1433
|
+
const arg = args[i];
|
|
1434
1434
|
if (arg === undefined) {
|
|
1435
1435
|
break;
|
|
1436
1436
|
} else if (arg.constructor === String || arg.constructor === Number) {
|
|
@@ -1442,8 +1442,8 @@ var computeNoColorLoggingArgs = (args2) => {
|
|
|
1442
1442
|
if (i > 0) {
|
|
1443
1443
|
logArgs.push(strBuilder.join(""));
|
|
1444
1444
|
}
|
|
1445
|
-
for (;i <
|
|
1446
|
-
const arg =
|
|
1445
|
+
for (;i < args.length; i++) {
|
|
1446
|
+
const arg = args[i];
|
|
1447
1447
|
if (!(arg instanceof Symbol)) {
|
|
1448
1448
|
logArgs.push(arg);
|
|
1449
1449
|
}
|
|
@@ -1464,17 +1464,17 @@ var _browserStyleMap = {
|
|
|
1464
1464
|
[ORANGE]: create5("color", "orange"),
|
|
1465
1465
|
[UNCOLOR]: create5("color", "black")
|
|
1466
1466
|
};
|
|
1467
|
-
var computeBrowserLoggingArgs = (
|
|
1468
|
-
if (
|
|
1469
|
-
|
|
1467
|
+
var computeBrowserLoggingArgs = (args) => {
|
|
1468
|
+
if (args.length === 1 && args[0]?.constructor === Function) {
|
|
1469
|
+
args = args[0]();
|
|
1470
1470
|
}
|
|
1471
1471
|
const strBuilder = [];
|
|
1472
1472
|
const styles = [];
|
|
1473
1473
|
const currentStyle = create3();
|
|
1474
1474
|
let logArgs = [];
|
|
1475
1475
|
let i = 0;
|
|
1476
|
-
for (;i <
|
|
1477
|
-
const arg =
|
|
1476
|
+
for (;i < args.length; i++) {
|
|
1477
|
+
const arg = args[i];
|
|
1478
1478
|
const style = _browserStyleMap[arg];
|
|
1479
1479
|
if (style !== undefined) {
|
|
1480
1480
|
currentStyle.set(style.left, style.right);
|
|
@@ -1483,10 +1483,10 @@ var computeBrowserLoggingArgs = (args2) => {
|
|
|
1483
1483
|
break;
|
|
1484
1484
|
}
|
|
1485
1485
|
if (arg.constructor === String || arg.constructor === Number) {
|
|
1486
|
-
const
|
|
1487
|
-
if (i > 0 ||
|
|
1486
|
+
const style = mapToStyleString(currentStyle);
|
|
1487
|
+
if (i > 0 || style.length > 0) {
|
|
1488
1488
|
strBuilder.push("%c" + arg);
|
|
1489
|
-
styles.push(
|
|
1489
|
+
styles.push(style);
|
|
1490
1490
|
} else {
|
|
1491
1491
|
strBuilder.push(arg);
|
|
1492
1492
|
}
|
|
@@ -1499,8 +1499,8 @@ var computeBrowserLoggingArgs = (args2) => {
|
|
|
1499
1499
|
logArgs = styles;
|
|
1500
1500
|
logArgs.unshift(strBuilder.join(""));
|
|
1501
1501
|
}
|
|
1502
|
-
for (;i <
|
|
1503
|
-
const arg =
|
|
1502
|
+
for (;i < args.length; i++) {
|
|
1503
|
+
const arg = args[i];
|
|
1504
1504
|
if (!(arg instanceof Symbol)) {
|
|
1505
1505
|
logArgs.push(arg);
|
|
1506
1506
|
}
|
|
@@ -1508,14 +1508,14 @@ var computeBrowserLoggingArgs = (args2) => {
|
|
|
1508
1508
|
return logArgs;
|
|
1509
1509
|
};
|
|
1510
1510
|
var computeLoggingArgs = supportsColor ? computeBrowserLoggingArgs : computeNoColorLoggingArgs;
|
|
1511
|
-
var print = (...
|
|
1512
|
-
console.log(...computeLoggingArgs(
|
|
1513
|
-
vconsoles.forEach((vc) => vc.print(
|
|
1511
|
+
var print = (...args) => {
|
|
1512
|
+
console.log(...computeLoggingArgs(args));
|
|
1513
|
+
vconsoles.forEach((vc) => vc.print(args));
|
|
1514
1514
|
};
|
|
1515
|
-
var warn = (...
|
|
1516
|
-
console.warn(...computeLoggingArgs(
|
|
1517
|
-
|
|
1518
|
-
vconsoles.forEach((vc) => vc.print(
|
|
1515
|
+
var warn = (...args) => {
|
|
1516
|
+
console.warn(...computeLoggingArgs(args));
|
|
1517
|
+
args.unshift(ORANGE);
|
|
1518
|
+
vconsoles.forEach((vc) => vc.print(args));
|
|
1519
1519
|
};
|
|
1520
1520
|
var vconsoles = create();
|
|
1521
1521
|
|
|
@@ -1579,9 +1579,9 @@ var findIndexDS = (dis, clock) => {
|
|
|
1579
1579
|
}
|
|
1580
1580
|
return null;
|
|
1581
1581
|
};
|
|
1582
|
-
var isDeleted = (ds,
|
|
1583
|
-
const dis = ds.clients.get(
|
|
1584
|
-
return dis !== undefined && findIndexDS(dis,
|
|
1582
|
+
var isDeleted = (ds, id) => {
|
|
1583
|
+
const dis = ds.clients.get(id.client);
|
|
1584
|
+
return dis !== undefined && findIndexDS(dis, id.clock) !== null;
|
|
1585
1585
|
};
|
|
1586
1586
|
var sortAndMergeDeleteSet = (ds) => {
|
|
1587
1587
|
ds.clients.forEach((dels) => {
|
|
@@ -1618,8 +1618,8 @@ var mergeDeleteSets = (dss) => {
|
|
|
1618
1618
|
sortAndMergeDeleteSet(merged);
|
|
1619
1619
|
return merged;
|
|
1620
1620
|
};
|
|
1621
|
-
var addToDeleteSet = (ds, client, clock,
|
|
1622
|
-
setIfUndefined(ds.clients, client, () => []).push(new DeleteItem(clock,
|
|
1621
|
+
var addToDeleteSet = (ds, client, clock, length) => {
|
|
1622
|
+
setIfUndefined(ds.clients, client, () => []).push(new DeleteItem(clock, length));
|
|
1623
1623
|
};
|
|
1624
1624
|
var createDeleteSet = () => new DeleteSet;
|
|
1625
1625
|
var createDeleteSetFromStructStore = (ss) => {
|
|
@@ -1668,7 +1668,7 @@ var readDeleteSet = (decoder) => {
|
|
|
1668
1668
|
const numberOfDeletes = readVarUint(decoder.restDecoder);
|
|
1669
1669
|
if (numberOfDeletes > 0) {
|
|
1670
1670
|
const dsField = setIfUndefined(ds.clients, client, () => []);
|
|
1671
|
-
for (let
|
|
1671
|
+
for (let i = 0;i < numberOfDeletes; i++) {
|
|
1672
1672
|
dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()));
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
@@ -1684,7 +1684,7 @@ var readAndApplyDeleteSet = (decoder, transaction, store) => {
|
|
|
1684
1684
|
const numberOfDeletes = readVarUint(decoder.restDecoder);
|
|
1685
1685
|
const structs = store.clients.get(client) || [];
|
|
1686
1686
|
const state = getState(store, client);
|
|
1687
|
-
for (let
|
|
1687
|
+
for (let i = 0;i < numberOfDeletes; i++) {
|
|
1688
1688
|
const clock = decoder.readDsClock();
|
|
1689
1689
|
const clockEnd = clock + decoder.readDsLen();
|
|
1690
1690
|
if (clock < state) {
|
|
@@ -1784,7 +1784,7 @@ class Doc extends ObservableV2 {
|
|
|
1784
1784
|
return this.subdocs;
|
|
1785
1785
|
}
|
|
1786
1786
|
getSubdocGuids() {
|
|
1787
|
-
return new Set(from(this.subdocs).map((
|
|
1787
|
+
return new Set(from(this.subdocs).map((doc) => doc.guid));
|
|
1788
1788
|
}
|
|
1789
1789
|
transact(f, origin = null) {
|
|
1790
1790
|
return transact(this, f, origin);
|
|
@@ -1835,11 +1835,11 @@ class Doc extends ObservableV2 {
|
|
|
1835
1835
|
return this.get(name, YXmlFragment);
|
|
1836
1836
|
}
|
|
1837
1837
|
toJSON() {
|
|
1838
|
-
const
|
|
1838
|
+
const doc = {};
|
|
1839
1839
|
this.share.forEach((value, key) => {
|
|
1840
|
-
|
|
1840
|
+
doc[key] = value.toJSON();
|
|
1841
1841
|
});
|
|
1842
|
-
return
|
|
1842
|
+
return doc;
|
|
1843
1843
|
}
|
|
1844
1844
|
destroy() {
|
|
1845
1845
|
this.isDestroyed = true;
|
|
@@ -1851,9 +1851,9 @@ class Doc extends ObservableV2 {
|
|
|
1851
1851
|
content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false });
|
|
1852
1852
|
content.doc._item = item;
|
|
1853
1853
|
transact(item.parent.doc, (transaction) => {
|
|
1854
|
-
const
|
|
1854
|
+
const doc = content.doc;
|
|
1855
1855
|
if (!item.deleted) {
|
|
1856
|
-
transaction.subdocsAdded.add(
|
|
1856
|
+
transaction.subdocsAdded.add(doc);
|
|
1857
1857
|
}
|
|
1858
1858
|
transaction.subdocsRemoved.add(this);
|
|
1859
1859
|
}, null, true);
|
|
@@ -2012,13 +2012,13 @@ class DSEncoderV1 {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
|
|
2014
2014
|
class UpdateEncoderV1 extends DSEncoderV1 {
|
|
2015
|
-
writeLeftID(
|
|
2016
|
-
writeVarUint(this.restEncoder,
|
|
2017
|
-
writeVarUint(this.restEncoder,
|
|
2015
|
+
writeLeftID(id) {
|
|
2016
|
+
writeVarUint(this.restEncoder, id.client);
|
|
2017
|
+
writeVarUint(this.restEncoder, id.clock);
|
|
2018
2018
|
}
|
|
2019
|
-
writeRightID(
|
|
2020
|
-
writeVarUint(this.restEncoder,
|
|
2021
|
-
writeVarUint(this.restEncoder,
|
|
2019
|
+
writeRightID(id) {
|
|
2020
|
+
writeVarUint(this.restEncoder, id.client);
|
|
2021
|
+
writeVarUint(this.restEncoder, id.clock);
|
|
2022
2022
|
}
|
|
2023
2023
|
writeClient(client) {
|
|
2024
2024
|
writeVarUint(this.restEncoder, client);
|
|
@@ -2038,8 +2038,8 @@ class UpdateEncoderV1 extends DSEncoderV1 {
|
|
|
2038
2038
|
writeLen(len) {
|
|
2039
2039
|
writeVarUint(this.restEncoder, len);
|
|
2040
2040
|
}
|
|
2041
|
-
writeAny(
|
|
2042
|
-
writeAny(this.restEncoder,
|
|
2041
|
+
writeAny(any) {
|
|
2042
|
+
writeAny(this.restEncoder, any);
|
|
2043
2043
|
}
|
|
2044
2044
|
writeBuf(buf) {
|
|
2045
2045
|
writeVarUint8Array(this.restEncoder, buf);
|
|
@@ -2107,13 +2107,13 @@ class UpdateEncoderV2 extends DSEncoderV2 {
|
|
|
2107
2107
|
writeUint8Array(encoder, toUint8Array(this.restEncoder));
|
|
2108
2108
|
return toUint8Array(encoder);
|
|
2109
2109
|
}
|
|
2110
|
-
writeLeftID(
|
|
2111
|
-
this.clientEncoder.write(
|
|
2112
|
-
this.leftClockEncoder.write(
|
|
2110
|
+
writeLeftID(id) {
|
|
2111
|
+
this.clientEncoder.write(id.client);
|
|
2112
|
+
this.leftClockEncoder.write(id.clock);
|
|
2113
2113
|
}
|
|
2114
|
-
writeRightID(
|
|
2115
|
-
this.clientEncoder.write(
|
|
2116
|
-
this.rightClockEncoder.write(
|
|
2114
|
+
writeRightID(id) {
|
|
2115
|
+
this.clientEncoder.write(id.client);
|
|
2116
|
+
this.rightClockEncoder.write(id.clock);
|
|
2117
2117
|
}
|
|
2118
2118
|
writeClient(client) {
|
|
2119
2119
|
this.clientEncoder.write(client);
|
|
@@ -2133,8 +2133,8 @@ class UpdateEncoderV2 extends DSEncoderV2 {
|
|
|
2133
2133
|
writeLen(len) {
|
|
2134
2134
|
this.lenEncoder.write(len);
|
|
2135
2135
|
}
|
|
2136
|
-
writeAny(
|
|
2137
|
-
writeAny(this.restEncoder,
|
|
2136
|
+
writeAny(any) {
|
|
2137
|
+
writeAny(this.restEncoder, any);
|
|
2138
2138
|
}
|
|
2139
2139
|
writeBuf(buf) {
|
|
2140
2140
|
writeVarUint8Array(this.restEncoder, buf);
|
|
@@ -2181,7 +2181,7 @@ var writeClientsStructs = (encoder, store, _sm) => {
|
|
|
2181
2181
|
writeStructs(encoder, store.clients.get(client), client, clock);
|
|
2182
2182
|
});
|
|
2183
2183
|
};
|
|
2184
|
-
var readClientsStructRefs = (decoder,
|
|
2184
|
+
var readClientsStructRefs = (decoder, doc) => {
|
|
2185
2185
|
const clientRefs = create3();
|
|
2186
2186
|
const numOfStateUpdates = readVarUint(decoder.restDecoder);
|
|
2187
2187
|
for (let i = 0;i < numOfStateUpdates; i++) {
|
|
@@ -2190,25 +2190,25 @@ var readClientsStructRefs = (decoder, doc2) => {
|
|
|
2190
2190
|
const client = decoder.readClient();
|
|
2191
2191
|
let clock = readVarUint(decoder.restDecoder);
|
|
2192
2192
|
clientRefs.set(client, { i: 0, refs });
|
|
2193
|
-
for (let
|
|
2193
|
+
for (let i = 0;i < numberOfStructs; i++) {
|
|
2194
2194
|
const info = decoder.readInfo();
|
|
2195
2195
|
switch (BITS5 & info) {
|
|
2196
2196
|
case 0: {
|
|
2197
2197
|
const len = decoder.readLen();
|
|
2198
|
-
refs[
|
|
2198
|
+
refs[i] = new GC(createID(client, clock), len);
|
|
2199
2199
|
clock += len;
|
|
2200
2200
|
break;
|
|
2201
2201
|
}
|
|
2202
2202
|
case 10: {
|
|
2203
2203
|
const len = readVarUint(decoder.restDecoder);
|
|
2204
|
-
refs[
|
|
2204
|
+
refs[i] = new Skip(createID(client, clock), len);
|
|
2205
2205
|
clock += len;
|
|
2206
2206
|
break;
|
|
2207
2207
|
}
|
|
2208
2208
|
default: {
|
|
2209
2209
|
const cantCopyParentInfo = (info & (BIT7 | BIT8)) === 0;
|
|
2210
|
-
const struct = new Item(createID(client, clock), null, (info & BIT8) === BIT8 ? decoder.readLeftID() : null, null, (info & BIT7) === BIT7 ? decoder.readRightID() : null, cantCopyParentInfo ? decoder.readParentInfo() ?
|
|
2211
|
-
refs[
|
|
2210
|
+
const struct = new Item(createID(client, clock), null, (info & BIT8) === BIT8 ? decoder.readLeftID() : null, null, (info & BIT7) === BIT7 ? decoder.readRightID() : null, cantCopyParentInfo ? decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID() : null, cantCopyParentInfo && (info & BIT6) === BIT6 ? decoder.readString() : null, readItemContent(decoder, info));
|
|
2211
|
+
refs[i] = struct;
|
|
2212
2212
|
clock += struct.length;
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
@@ -2319,9 +2319,9 @@ var writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(
|
|
|
2319
2319
|
var readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) => transact(ydoc, (transaction) => {
|
|
2320
2320
|
transaction.local = false;
|
|
2321
2321
|
let retry = false;
|
|
2322
|
-
const
|
|
2323
|
-
const store =
|
|
2324
|
-
const ss = readClientsStructRefs(structDecoder,
|
|
2322
|
+
const doc = transaction.doc;
|
|
2323
|
+
const store = doc.store;
|
|
2324
|
+
const ss = readClientsStructRefs(structDecoder, doc);
|
|
2325
2325
|
const restStructs = integrateStructs(transaction, store, ss);
|
|
2326
2326
|
const pending = store.pendingStructs;
|
|
2327
2327
|
if (pending) {
|
|
@@ -2367,19 +2367,19 @@ var applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2
|
|
|
2367
2367
|
readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder));
|
|
2368
2368
|
};
|
|
2369
2369
|
var applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1);
|
|
2370
|
-
var writeStateAsUpdate = (encoder,
|
|
2371
|
-
writeClientsStructs(encoder,
|
|
2372
|
-
writeDeleteSet(encoder, createDeleteSetFromStructStore(
|
|
2370
|
+
var writeStateAsUpdate = (encoder, doc, targetStateVector = new Map) => {
|
|
2371
|
+
writeClientsStructs(encoder, doc.store, targetStateVector);
|
|
2372
|
+
writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store));
|
|
2373
2373
|
};
|
|
2374
|
-
var encodeStateAsUpdateV2 = (
|
|
2374
|
+
var encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2) => {
|
|
2375
2375
|
const targetStateVector = decodeStateVector(encodedTargetStateVector);
|
|
2376
|
-
writeStateAsUpdate(encoder,
|
|
2376
|
+
writeStateAsUpdate(encoder, doc, targetStateVector);
|
|
2377
2377
|
const updates = [encoder.toUint8Array()];
|
|
2378
|
-
if (
|
|
2379
|
-
updates.push(
|
|
2378
|
+
if (doc.store.pendingDs) {
|
|
2379
|
+
updates.push(doc.store.pendingDs);
|
|
2380
2380
|
}
|
|
2381
|
-
if (
|
|
2382
|
-
updates.push(diffUpdateV2(
|
|
2381
|
+
if (doc.store.pendingStructs) {
|
|
2382
|
+
updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector));
|
|
2383
2383
|
}
|
|
2384
2384
|
if (updates.length > 1) {
|
|
2385
2385
|
if (encoder.constructor === UpdateEncoderV1) {
|
|
@@ -2390,7 +2390,7 @@ var encodeStateAsUpdateV2 = (doc2, encodedTargetStateVector = new Uint8Array([0]
|
|
|
2390
2390
|
}
|
|
2391
2391
|
return updates[0];
|
|
2392
2392
|
};
|
|
2393
|
-
var encodeStateAsUpdate = (
|
|
2393
|
+
var encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1);
|
|
2394
2394
|
var readStateVector = (decoder) => {
|
|
2395
2395
|
const ss = new Map;
|
|
2396
2396
|
const ssLength = readVarUint(decoder.restDecoder);
|
|
@@ -2410,16 +2410,16 @@ var writeStateVector = (encoder, sv) => {
|
|
|
2410
2410
|
});
|
|
2411
2411
|
return encoder;
|
|
2412
2412
|
};
|
|
2413
|
-
var writeDocumentStateVector = (encoder,
|
|
2414
|
-
var encodeStateVectorV2 = (
|
|
2415
|
-
if (
|
|
2416
|
-
writeStateVector(encoder,
|
|
2413
|
+
var writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store));
|
|
2414
|
+
var encodeStateVectorV2 = (doc, encoder = new DSEncoderV2) => {
|
|
2415
|
+
if (doc instanceof Map) {
|
|
2416
|
+
writeStateVector(encoder, doc);
|
|
2417
2417
|
} else {
|
|
2418
|
-
writeDocumentStateVector(encoder,
|
|
2418
|
+
writeDocumentStateVector(encoder, doc);
|
|
2419
2419
|
}
|
|
2420
2420
|
return encoder.toUint8Array();
|
|
2421
2421
|
};
|
|
2422
|
-
var encodeStateVector = (
|
|
2422
|
+
var encodeStateVector = (doc) => encodeStateVectorV2(doc, new DSEncoderV1);
|
|
2423
2423
|
|
|
2424
2424
|
class EventHandler {
|
|
2425
2425
|
constructor() {
|
|
@@ -2489,7 +2489,7 @@ var createRelativePosition = (type, item, assoc) => {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
return new RelativePosition(typeid, tname, item, assoc);
|
|
2491
2491
|
};
|
|
2492
|
-
var
|
|
2492
|
+
var createRelativePositionFromTypeIndex2 = (type, index, assoc = 0) => {
|
|
2493
2493
|
let t = type._start;
|
|
2494
2494
|
if (assoc < 0) {
|
|
2495
2495
|
if (index === 0) {
|
|
@@ -2511,16 +2511,16 @@ var createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {
|
|
|
2511
2511
|
}
|
|
2512
2512
|
return createRelativePosition(type, null, assoc);
|
|
2513
2513
|
};
|
|
2514
|
-
var getItemWithOffset = (store,
|
|
2515
|
-
const item = getItem(store,
|
|
2516
|
-
const diff =
|
|
2514
|
+
var getItemWithOffset = (store, id) => {
|
|
2515
|
+
const item = getItem(store, id);
|
|
2516
|
+
const diff = id.clock - item.id.clock;
|
|
2517
2517
|
return {
|
|
2518
2518
|
item,
|
|
2519
2519
|
diff
|
|
2520
2520
|
};
|
|
2521
2521
|
};
|
|
2522
|
-
var
|
|
2523
|
-
const store =
|
|
2522
|
+
var createAbsolutePositionFromRelativePosition2 = (rpos, doc, followUndoneDeletions = true) => {
|
|
2523
|
+
const store = doc.store;
|
|
2524
2524
|
const rightID = rpos.item;
|
|
2525
2525
|
const typeID = rpos.type;
|
|
2526
2526
|
const tname = rpos.tname;
|
|
@@ -2549,7 +2549,7 @@ var createAbsolutePositionFromRelativePosition = (rpos, doc2, followUndoneDeleti
|
|
|
2549
2549
|
}
|
|
2550
2550
|
} else {
|
|
2551
2551
|
if (tname !== null) {
|
|
2552
|
-
type =
|
|
2552
|
+
type = doc.get(tname);
|
|
2553
2553
|
} else if (typeID !== null) {
|
|
2554
2554
|
if (getState(store, typeID.client) <= typeID.clock) {
|
|
2555
2555
|
return null;
|
|
@@ -2653,9 +2653,9 @@ var findIndexSS = (structs, clock) => {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
throw unexpectedCase();
|
|
2655
2655
|
};
|
|
2656
|
-
var find = (store,
|
|
2657
|
-
const structs = store.clients.get(
|
|
2658
|
-
return structs[findIndexSS(structs,
|
|
2656
|
+
var find = (store, id) => {
|
|
2657
|
+
const structs = store.clients.get(id.client);
|
|
2658
|
+
return structs[findIndexSS(structs, id.clock)];
|
|
2659
2659
|
};
|
|
2660
2660
|
var getItem = find;
|
|
2661
2661
|
var findIndexCleanStart = (transaction, structs, clock) => {
|
|
@@ -2667,16 +2667,16 @@ var findIndexCleanStart = (transaction, structs, clock) => {
|
|
|
2667
2667
|
}
|
|
2668
2668
|
return index;
|
|
2669
2669
|
};
|
|
2670
|
-
var getItemCleanStart = (transaction,
|
|
2671
|
-
const structs = transaction.doc.store.clients.get(
|
|
2672
|
-
return structs[findIndexCleanStart(transaction, structs,
|
|
2670
|
+
var getItemCleanStart = (transaction, id) => {
|
|
2671
|
+
const structs = transaction.doc.store.clients.get(id.client);
|
|
2672
|
+
return structs[findIndexCleanStart(transaction, structs, id.clock)];
|
|
2673
2673
|
};
|
|
2674
|
-
var getItemCleanEnd = (transaction, store,
|
|
2675
|
-
const structs = store.clients.get(
|
|
2676
|
-
const index = findIndexSS(structs,
|
|
2674
|
+
var getItemCleanEnd = (transaction, store, id) => {
|
|
2675
|
+
const structs = store.clients.get(id.client);
|
|
2676
|
+
const index = findIndexSS(structs, id.clock);
|
|
2677
2677
|
const struct = structs[index];
|
|
2678
|
-
if (
|
|
2679
|
-
structs.splice(index + 1, 0, splitItem(transaction, struct,
|
|
2678
|
+
if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {
|
|
2679
|
+
structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1));
|
|
2680
2680
|
}
|
|
2681
2681
|
return struct;
|
|
2682
2682
|
};
|
|
@@ -2701,10 +2701,10 @@ var iterateStructs = (transaction, structs, clockStart, len, f) => {
|
|
|
2701
2701
|
};
|
|
2702
2702
|
|
|
2703
2703
|
class Transaction {
|
|
2704
|
-
constructor(
|
|
2705
|
-
this.doc =
|
|
2704
|
+
constructor(doc, origin, local) {
|
|
2705
|
+
this.doc = doc;
|
|
2706
2706
|
this.deleteSet = new DeleteSet;
|
|
2707
|
-
this.beforeState = getStateVector(
|
|
2707
|
+
this.beforeState = getStateVector(doc.store);
|
|
2708
2708
|
this.afterState = new Map;
|
|
2709
2709
|
this.changed = new Map;
|
|
2710
2710
|
this.changedParentTypes = new Map;
|
|
@@ -2761,12 +2761,12 @@ var tryGcDeleteSet = (ds, store, gcFilter) => {
|
|
|
2761
2761
|
const deleteItem = deleteItems[di];
|
|
2762
2762
|
const endDeleteItemClock = deleteItem.clock + deleteItem.len;
|
|
2763
2763
|
for (let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];si < structs.length && struct.id.clock < endDeleteItemClock; struct = structs[++si]) {
|
|
2764
|
-
const
|
|
2765
|
-
if (deleteItem.clock + deleteItem.len <=
|
|
2764
|
+
const struct = structs[si];
|
|
2765
|
+
if (deleteItem.clock + deleteItem.len <= struct.id.clock) {
|
|
2766
2766
|
break;
|
|
2767
2767
|
}
|
|
2768
|
-
if (
|
|
2769
|
-
|
|
2768
|
+
if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {
|
|
2769
|
+
struct.gc(store, false);
|
|
2770
2770
|
}
|
|
2771
2771
|
}
|
|
2772
2772
|
}
|
|
@@ -2787,14 +2787,14 @@ var tryMergeDeleteSet = (ds, store) => {
|
|
|
2787
2787
|
var cleanupTransactions = (transactionCleanups, i) => {
|
|
2788
2788
|
if (i < transactionCleanups.length) {
|
|
2789
2789
|
const transaction = transactionCleanups[i];
|
|
2790
|
-
const
|
|
2791
|
-
const store =
|
|
2790
|
+
const doc = transaction.doc;
|
|
2791
|
+
const store = doc.store;
|
|
2792
2792
|
const ds = transaction.deleteSet;
|
|
2793
2793
|
const mergeStructs = transaction._mergeStructs;
|
|
2794
2794
|
try {
|
|
2795
2795
|
sortAndMergeDeleteSet(ds);
|
|
2796
2796
|
transaction.afterState = getStateVector(transaction.doc.store);
|
|
2797
|
-
|
|
2797
|
+
doc.emit("beforeObserverCalls", [transaction, doc]);
|
|
2798
2798
|
const fs = [];
|
|
2799
2799
|
transaction.changed.forEach((subs, itemtype) => fs.push(() => {
|
|
2800
2800
|
if (itemtype._item === null || !itemtype._item.deleted) {
|
|
@@ -2815,7 +2815,7 @@ var cleanupTransactions = (transactionCleanups, i) => {
|
|
|
2815
2815
|
});
|
|
2816
2816
|
}
|
|
2817
2817
|
});
|
|
2818
|
-
fs.push(() =>
|
|
2818
|
+
fs.push(() => doc.emit("afterTransaction", [transaction, doc]));
|
|
2819
2819
|
fs.push(() => {
|
|
2820
2820
|
if (transaction._needFormattingCleanup) {
|
|
2821
2821
|
cleanupYTextAfterTransaction(transaction);
|
|
@@ -2824,8 +2824,8 @@ var cleanupTransactions = (transactionCleanups, i) => {
|
|
|
2824
2824
|
});
|
|
2825
2825
|
callAll(fs, []);
|
|
2826
2826
|
} finally {
|
|
2827
|
-
if (
|
|
2828
|
-
tryGcDeleteSet(ds, store,
|
|
2827
|
+
if (doc.gc) {
|
|
2828
|
+
tryGcDeleteSet(ds, store, doc.gcFilter);
|
|
2829
2829
|
}
|
|
2830
2830
|
tryMergeDeleteSet(ds, store);
|
|
2831
2831
|
transaction.afterState.forEach((clock, client) => {
|
|
@@ -2833,13 +2833,13 @@ var cleanupTransactions = (transactionCleanups, i) => {
|
|
|
2833
2833
|
if (beforeClock !== clock) {
|
|
2834
2834
|
const structs = store.clients.get(client);
|
|
2835
2835
|
const firstChangePos = max(findIndexSS(structs, beforeClock), 1);
|
|
2836
|
-
for (let
|
|
2837
|
-
|
|
2836
|
+
for (let i = structs.length - 1;i >= firstChangePos; ) {
|
|
2837
|
+
i -= 1 + tryToMergeWithLefts(structs, i);
|
|
2838
2838
|
}
|
|
2839
2839
|
}
|
|
2840
2840
|
});
|
|
2841
|
-
for (let
|
|
2842
|
-
const { client, clock } = mergeStructs[
|
|
2841
|
+
for (let i = mergeStructs.length - 1;i >= 0; i--) {
|
|
2842
|
+
const { client, clock } = mergeStructs[i].id;
|
|
2843
2843
|
const structs = store.clients.get(client);
|
|
2844
2844
|
const replacedStructPos = findIndexSS(structs, clock);
|
|
2845
2845
|
if (replacedStructPos + 1 < structs.length) {
|
|
@@ -2851,66 +2851,66 @@ var cleanupTransactions = (transactionCleanups, i) => {
|
|
|
2851
2851
|
tryToMergeWithLefts(structs, replacedStructPos);
|
|
2852
2852
|
}
|
|
2853
2853
|
}
|
|
2854
|
-
if (!transaction.local && transaction.afterState.get(
|
|
2854
|
+
if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {
|
|
2855
2855
|
print(ORANGE, BOLD, "[yjs] ", UNBOLD, RED, "Changed the client-id because another client seems to be using it.");
|
|
2856
|
-
|
|
2856
|
+
doc.clientID = generateNewClientId();
|
|
2857
2857
|
}
|
|
2858
|
-
|
|
2859
|
-
if (
|
|
2858
|
+
doc.emit("afterTransactionCleanup", [transaction, doc]);
|
|
2859
|
+
if (doc._observers.has("update")) {
|
|
2860
2860
|
const encoder = new UpdateEncoderV1;
|
|
2861
|
-
const
|
|
2862
|
-
if (
|
|
2863
|
-
|
|
2861
|
+
const hasContent = writeUpdateMessageFromTransaction(encoder, transaction);
|
|
2862
|
+
if (hasContent) {
|
|
2863
|
+
doc.emit("update", [encoder.toUint8Array(), transaction.origin, doc, transaction]);
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
|
-
if (
|
|
2866
|
+
if (doc._observers.has("updateV2")) {
|
|
2867
2867
|
const encoder = new UpdateEncoderV2;
|
|
2868
|
-
const
|
|
2869
|
-
if (
|
|
2870
|
-
|
|
2868
|
+
const hasContent = writeUpdateMessageFromTransaction(encoder, transaction);
|
|
2869
|
+
if (hasContent) {
|
|
2870
|
+
doc.emit("updateV2", [encoder.toUint8Array(), transaction.origin, doc, transaction]);
|
|
2871
2871
|
}
|
|
2872
2872
|
}
|
|
2873
2873
|
const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction;
|
|
2874
2874
|
if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {
|
|
2875
2875
|
subdocsAdded.forEach((subdoc) => {
|
|
2876
|
-
subdoc.clientID =
|
|
2876
|
+
subdoc.clientID = doc.clientID;
|
|
2877
2877
|
if (subdoc.collectionid == null) {
|
|
2878
|
-
subdoc.collectionid =
|
|
2878
|
+
subdoc.collectionid = doc.collectionid;
|
|
2879
2879
|
}
|
|
2880
|
-
|
|
2880
|
+
doc.subdocs.add(subdoc);
|
|
2881
2881
|
});
|
|
2882
|
-
subdocsRemoved.forEach((subdoc) =>
|
|
2883
|
-
|
|
2882
|
+
subdocsRemoved.forEach((subdoc) => doc.subdocs.delete(subdoc));
|
|
2883
|
+
doc.emit("subdocs", [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction]);
|
|
2884
2884
|
subdocsRemoved.forEach((subdoc) => subdoc.destroy());
|
|
2885
2885
|
}
|
|
2886
2886
|
if (transactionCleanups.length <= i + 1) {
|
|
2887
|
-
|
|
2888
|
-
|
|
2887
|
+
doc._transactionCleanups = [];
|
|
2888
|
+
doc.emit("afterAllTransactions", [doc, transactionCleanups]);
|
|
2889
2889
|
} else {
|
|
2890
2890
|
cleanupTransactions(transactionCleanups, i + 1);
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
};
|
|
2895
|
-
var transact = (
|
|
2896
|
-
const transactionCleanups =
|
|
2895
|
+
var transact = (doc, f, origin = null, local = true) => {
|
|
2896
|
+
const transactionCleanups = doc._transactionCleanups;
|
|
2897
2897
|
let initialCall = false;
|
|
2898
2898
|
let result = null;
|
|
2899
|
-
if (
|
|
2899
|
+
if (doc._transaction === null) {
|
|
2900
2900
|
initialCall = true;
|
|
2901
|
-
|
|
2902
|
-
transactionCleanups.push(
|
|
2901
|
+
doc._transaction = new Transaction(doc, origin, local);
|
|
2902
|
+
transactionCleanups.push(doc._transaction);
|
|
2903
2903
|
if (transactionCleanups.length === 1) {
|
|
2904
|
-
|
|
2904
|
+
doc.emit("beforeAllTransactions", [doc]);
|
|
2905
2905
|
}
|
|
2906
|
-
|
|
2906
|
+
doc.emit("beforeTransaction", [doc._transaction, doc]);
|
|
2907
2907
|
}
|
|
2908
2908
|
try {
|
|
2909
|
-
result = f(
|
|
2909
|
+
result = f(doc._transaction);
|
|
2910
2910
|
} finally {
|
|
2911
2911
|
if (initialCall) {
|
|
2912
|
-
const finishCleanup =
|
|
2913
|
-
|
|
2912
|
+
const finishCleanup = doc._transaction === transactionCleanups[0];
|
|
2913
|
+
doc._transaction = null;
|
|
2914
2914
|
if (finishCleanup) {
|
|
2915
2915
|
cleanupTransactions(transactionCleanups, 0);
|
|
2916
2916
|
}
|
|
@@ -2935,11 +2935,11 @@ var clearUndoManagerStackItem = (tr, um, stackItem) => {
|
|
|
2935
2935
|
};
|
|
2936
2936
|
var popStackItem = (undoManager, stack, eventType) => {
|
|
2937
2937
|
let _tr = null;
|
|
2938
|
-
const
|
|
2938
|
+
const doc = undoManager.doc;
|
|
2939
2939
|
const scope = undoManager.scope;
|
|
2940
|
-
transact(
|
|
2940
|
+
transact(doc, (transaction) => {
|
|
2941
2941
|
while (stack.length > 0 && undoManager.currStackItem === null) {
|
|
2942
|
-
const store =
|
|
2942
|
+
const store = doc.store;
|
|
2943
2943
|
const stackItem = stack.pop();
|
|
2944
2944
|
const itemsToRedo = new Set;
|
|
2945
2945
|
const itemsToDelete = [];
|
|
@@ -2991,18 +2991,18 @@ var popStackItem = (undoManager, stack, eventType) => {
|
|
|
2991
2991
|
return res;
|
|
2992
2992
|
};
|
|
2993
2993
|
|
|
2994
|
-
class
|
|
2994
|
+
class UndoManager2 extends ObservableV2 {
|
|
2995
2995
|
constructor(typeScope, {
|
|
2996
2996
|
captureTimeout = 500,
|
|
2997
2997
|
captureTransaction = (_tr) => true,
|
|
2998
2998
|
deleteFilter = () => true,
|
|
2999
2999
|
trackedOrigins = new Set([null]),
|
|
3000
3000
|
ignoreRemoteMapChanges = false,
|
|
3001
|
-
doc
|
|
3001
|
+
doc = isArray(typeScope) ? typeScope[0].doc : typeScope instanceof Doc ? typeScope : typeScope.doc
|
|
3002
3002
|
} = {}) {
|
|
3003
3003
|
super();
|
|
3004
3004
|
this.scope = [];
|
|
3005
|
-
this.doc =
|
|
3005
|
+
this.doc = doc;
|
|
3006
3006
|
this.addToScope(typeScope);
|
|
3007
3007
|
this.deleteFilter = deleteFilter;
|
|
3008
3008
|
trackedOrigins.add(this);
|
|
@@ -3140,7 +3140,7 @@ function* lazyStructReaderGenerator(decoder) {
|
|
|
3140
3140
|
const numberOfStructs = readVarUint(decoder.restDecoder);
|
|
3141
3141
|
const client = decoder.readClient();
|
|
3142
3142
|
let clock = readVarUint(decoder.restDecoder);
|
|
3143
|
-
for (let
|
|
3143
|
+
for (let i = 0;i < numberOfStructs; i++) {
|
|
3144
3144
|
const info = decoder.readInfo();
|
|
3145
3145
|
if (info === 10) {
|
|
3146
3146
|
const len = readVarUint(decoder.restDecoder);
|
|
@@ -3383,7 +3383,7 @@ class YEvent {
|
|
|
3383
3383
|
if (this.transaction.doc._transactionCleanups.length === 0) {
|
|
3384
3384
|
throw create2(errorComputeChanges);
|
|
3385
3385
|
}
|
|
3386
|
-
const
|
|
3386
|
+
const keys = new Map;
|
|
3387
3387
|
const target = this.target;
|
|
3388
3388
|
const changed = this.transaction.changed.get(target);
|
|
3389
3389
|
changed.forEach((key) => {
|
|
@@ -3420,10 +3420,10 @@ class YEvent {
|
|
|
3420
3420
|
return;
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
|
-
|
|
3423
|
+
keys.set(key, { action, oldValue });
|
|
3424
3424
|
}
|
|
3425
3425
|
});
|
|
3426
|
-
this._keys =
|
|
3426
|
+
this._keys = keys;
|
|
3427
3427
|
}
|
|
3428
3428
|
return this._keys;
|
|
3429
3429
|
}
|
|
@@ -3793,9 +3793,9 @@ var typeListGet = (type, index) => {
|
|
|
3793
3793
|
};
|
|
3794
3794
|
var typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {
|
|
3795
3795
|
let left = referenceItem;
|
|
3796
|
-
const
|
|
3797
|
-
const ownClientId =
|
|
3798
|
-
const store =
|
|
3796
|
+
const doc = transaction.doc;
|
|
3797
|
+
const ownClientId = doc.clientID;
|
|
3798
|
+
const store = doc.store;
|
|
3799
3799
|
const right = referenceItem === null ? parent._start : referenceItem.right;
|
|
3800
3800
|
let jsonContent = [];
|
|
3801
3801
|
const packJsonContent = () => {
|
|
@@ -3890,12 +3890,12 @@ var typeListPushGenerics = (transaction, parent, content) => {
|
|
|
3890
3890
|
}
|
|
3891
3891
|
return typeListInsertGenericsAfter(transaction, parent, n, content);
|
|
3892
3892
|
};
|
|
3893
|
-
var typeListDelete = (transaction, parent, index,
|
|
3894
|
-
if (
|
|
3893
|
+
var typeListDelete = (transaction, parent, index, length) => {
|
|
3894
|
+
if (length === 0) {
|
|
3895
3895
|
return;
|
|
3896
3896
|
}
|
|
3897
3897
|
const startIndex = index;
|
|
3898
|
-
const startLength =
|
|
3898
|
+
const startLength = length;
|
|
3899
3899
|
const marker = findMarker(parent, index);
|
|
3900
3900
|
let n = parent._start;
|
|
3901
3901
|
if (marker !== null) {
|
|
@@ -3910,21 +3910,21 @@ var typeListDelete = (transaction, parent, index, length2) => {
|
|
|
3910
3910
|
index -= n.length;
|
|
3911
3911
|
}
|
|
3912
3912
|
}
|
|
3913
|
-
while (
|
|
3913
|
+
while (length > 0 && n !== null) {
|
|
3914
3914
|
if (!n.deleted) {
|
|
3915
|
-
if (
|
|
3916
|
-
getItemCleanStart(transaction, createID(n.id.client, n.id.clock +
|
|
3915
|
+
if (length < n.length) {
|
|
3916
|
+
getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length));
|
|
3917
3917
|
}
|
|
3918
3918
|
n.delete(transaction);
|
|
3919
|
-
|
|
3919
|
+
length -= n.length;
|
|
3920
3920
|
}
|
|
3921
3921
|
n = n.right;
|
|
3922
3922
|
}
|
|
3923
|
-
if (
|
|
3923
|
+
if (length > 0) {
|
|
3924
3924
|
throw lengthExceeded();
|
|
3925
3925
|
}
|
|
3926
3926
|
if (parent._searchMarker) {
|
|
3927
|
-
updateMarkerChanges(parent._searchMarker, startIndex, -startLength +
|
|
3927
|
+
updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length);
|
|
3928
3928
|
}
|
|
3929
3929
|
};
|
|
3930
3930
|
var typeMapDelete = (transaction, parent, key) => {
|
|
@@ -3935,8 +3935,8 @@ var typeMapDelete = (transaction, parent, key) => {
|
|
|
3935
3935
|
};
|
|
3936
3936
|
var typeMapSet = (transaction, parent, key, value) => {
|
|
3937
3937
|
const left = parent._map.get(key) || null;
|
|
3938
|
-
const
|
|
3939
|
-
const ownClientId =
|
|
3938
|
+
const doc = transaction.doc;
|
|
3939
|
+
const ownClientId = doc.clientID;
|
|
3940
3940
|
let content;
|
|
3941
3941
|
if (value == null) {
|
|
3942
3942
|
content = new ContentAny([value]);
|
|
@@ -3965,7 +3965,7 @@ var typeMapSet = (transaction, parent, key, value) => {
|
|
|
3965
3965
|
}
|
|
3966
3966
|
}
|
|
3967
3967
|
}
|
|
3968
|
-
new Item(createID(ownClientId, getState(
|
|
3968
|
+
new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0);
|
|
3969
3969
|
};
|
|
3970
3970
|
var typeMapGet = (parent, key) => {
|
|
3971
3971
|
parent.doc ?? warnPrematureAccess();
|
|
@@ -4061,13 +4061,13 @@ class YArray extends AbstractType {
|
|
|
4061
4061
|
unshift(content) {
|
|
4062
4062
|
this.insert(0, content);
|
|
4063
4063
|
}
|
|
4064
|
-
delete(index,
|
|
4064
|
+
delete(index, length = 1) {
|
|
4065
4065
|
if (this.doc !== null) {
|
|
4066
4066
|
transact(this.doc, (transaction) => {
|
|
4067
|
-
typeListDelete(transaction, this, index,
|
|
4067
|
+
typeListDelete(transaction, this, index, length);
|
|
4068
4068
|
});
|
|
4069
4069
|
} else {
|
|
4070
|
-
this._prelimContent.splice(index,
|
|
4070
|
+
this._prelimContent.splice(index, length);
|
|
4071
4071
|
}
|
|
4072
4072
|
}
|
|
4073
4073
|
get(index) {
|
|
@@ -4125,25 +4125,25 @@ class YMap extends AbstractType {
|
|
|
4125
4125
|
return new YMap;
|
|
4126
4126
|
}
|
|
4127
4127
|
clone() {
|
|
4128
|
-
const
|
|
4128
|
+
const map = new YMap;
|
|
4129
4129
|
this.forEach((value, key) => {
|
|
4130
|
-
|
|
4130
|
+
map.set(key, value instanceof AbstractType ? value.clone() : value);
|
|
4131
4131
|
});
|
|
4132
|
-
return
|
|
4132
|
+
return map;
|
|
4133
4133
|
}
|
|
4134
4134
|
_callObserver(transaction, parentSubs) {
|
|
4135
4135
|
callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs));
|
|
4136
4136
|
}
|
|
4137
4137
|
toJSON() {
|
|
4138
4138
|
this.doc ?? warnPrematureAccess();
|
|
4139
|
-
const
|
|
4139
|
+
const map = {};
|
|
4140
4140
|
this._map.forEach((item, key) => {
|
|
4141
4141
|
if (!item.deleted) {
|
|
4142
4142
|
const v = item.content.getContent()[item.length - 1];
|
|
4143
|
-
|
|
4143
|
+
map[key] = v instanceof AbstractType ? v.toJSON() : v;
|
|
4144
4144
|
}
|
|
4145
4145
|
});
|
|
4146
|
-
return
|
|
4146
|
+
return map;
|
|
4147
4147
|
}
|
|
4148
4148
|
get size() {
|
|
4149
4149
|
return [...createMapIterator(this)].length;
|
|
@@ -4196,8 +4196,8 @@ class YMap extends AbstractType {
|
|
|
4196
4196
|
clear() {
|
|
4197
4197
|
if (this.doc !== null) {
|
|
4198
4198
|
transact(this.doc, (transaction) => {
|
|
4199
|
-
this.forEach(function(_value, key,
|
|
4200
|
-
typeMapDelete(transaction,
|
|
4199
|
+
this.forEach(function(_value, key, map) {
|
|
4200
|
+
typeMapDelete(transaction, map, key);
|
|
4201
4201
|
});
|
|
4202
4202
|
});
|
|
4203
4203
|
} else {
|
|
@@ -4279,12 +4279,12 @@ var insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes)
|
|
|
4279
4279
|
}
|
|
4280
4280
|
currPos.forward();
|
|
4281
4281
|
}
|
|
4282
|
-
const
|
|
4283
|
-
const ownClientId =
|
|
4282
|
+
const doc = transaction.doc;
|
|
4283
|
+
const ownClientId = doc.clientID;
|
|
4284
4284
|
negatedAttributes.forEach((val, key) => {
|
|
4285
4285
|
const left = currPos.left;
|
|
4286
4286
|
const right = currPos.right;
|
|
4287
|
-
const nextFormat = new Item(createID(ownClientId, getState(
|
|
4287
|
+
const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
|
|
4288
4288
|
nextFormat.integrate(transaction, 0);
|
|
4289
4289
|
currPos.right = nextFormat;
|
|
4290
4290
|
currPos.forward();
|
|
@@ -4311,8 +4311,8 @@ var minimizeAttributeChanges = (currPos, attributes) => {
|
|
|
4311
4311
|
}
|
|
4312
4312
|
};
|
|
4313
4313
|
var insertAttributes = (transaction, parent, currPos, attributes) => {
|
|
4314
|
-
const
|
|
4315
|
-
const ownClientId =
|
|
4314
|
+
const doc = transaction.doc;
|
|
4315
|
+
const ownClientId = doc.clientID;
|
|
4316
4316
|
const negatedAttributes = new Map;
|
|
4317
4317
|
for (const key in attributes) {
|
|
4318
4318
|
const val = attributes[key];
|
|
@@ -4320,42 +4320,42 @@ var insertAttributes = (transaction, parent, currPos, attributes) => {
|
|
|
4320
4320
|
if (!equalAttrs(currentVal, val)) {
|
|
4321
4321
|
negatedAttributes.set(key, currentVal);
|
|
4322
4322
|
const { left, right } = currPos;
|
|
4323
|
-
currPos.right = new Item(createID(ownClientId, getState(
|
|
4323
|
+
currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
|
|
4324
4324
|
currPos.right.integrate(transaction, 0);
|
|
4325
4325
|
currPos.forward();
|
|
4326
4326
|
}
|
|
4327
4327
|
}
|
|
4328
4328
|
return negatedAttributes;
|
|
4329
4329
|
};
|
|
4330
|
-
var insertText = (transaction, parent, currPos,
|
|
4330
|
+
var insertText = (transaction, parent, currPos, text, attributes) => {
|
|
4331
4331
|
currPos.currentAttributes.forEach((_val, key) => {
|
|
4332
4332
|
if (attributes[key] === undefined) {
|
|
4333
4333
|
attributes[key] = null;
|
|
4334
4334
|
}
|
|
4335
4335
|
});
|
|
4336
|
-
const
|
|
4337
|
-
const ownClientId =
|
|
4336
|
+
const doc = transaction.doc;
|
|
4337
|
+
const ownClientId = doc.clientID;
|
|
4338
4338
|
minimizeAttributeChanges(currPos, attributes);
|
|
4339
4339
|
const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
|
|
4340
|
-
const content =
|
|
4340
|
+
const content = text.constructor === String ? new ContentString(text) : text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text);
|
|
4341
4341
|
let { left, right, index } = currPos;
|
|
4342
4342
|
if (parent._searchMarker) {
|
|
4343
4343
|
updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength());
|
|
4344
4344
|
}
|
|
4345
|
-
right = new Item(createID(ownClientId, getState(
|
|
4345
|
+
right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content);
|
|
4346
4346
|
right.integrate(transaction, 0);
|
|
4347
4347
|
currPos.right = right;
|
|
4348
4348
|
currPos.index = index;
|
|
4349
4349
|
currPos.forward();
|
|
4350
4350
|
insertNegatedAttributes(transaction, parent, currPos, negatedAttributes);
|
|
4351
4351
|
};
|
|
4352
|
-
var formatText = (transaction, parent, currPos,
|
|
4353
|
-
const
|
|
4354
|
-
const ownClientId =
|
|
4352
|
+
var formatText = (transaction, parent, currPos, length, attributes) => {
|
|
4353
|
+
const doc = transaction.doc;
|
|
4354
|
+
const ownClientId = doc.clientID;
|
|
4355
4355
|
minimizeAttributeChanges(currPos, attributes);
|
|
4356
4356
|
const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
|
|
4357
4357
|
iterationLoop:
|
|
4358
|
-
while (currPos.right !== null && (
|
|
4358
|
+
while (currPos.right !== null && (length > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
|
|
4359
4359
|
if (!currPos.right.deleted) {
|
|
4360
4360
|
switch (currPos.right.content.constructor) {
|
|
4361
4361
|
case ContentFormat: {
|
|
@@ -4365,7 +4365,7 @@ var formatText = (transaction, parent, currPos, length2, attributes) => {
|
|
|
4365
4365
|
if (equalAttrs(attr, value)) {
|
|
4366
4366
|
negatedAttributes.delete(key);
|
|
4367
4367
|
} else {
|
|
4368
|
-
if (
|
|
4368
|
+
if (length === 0) {
|
|
4369
4369
|
break iterationLoop;
|
|
4370
4370
|
}
|
|
4371
4371
|
negatedAttributes.set(key, value);
|
|
@@ -4377,22 +4377,22 @@ var formatText = (transaction, parent, currPos, length2, attributes) => {
|
|
|
4377
4377
|
break;
|
|
4378
4378
|
}
|
|
4379
4379
|
default:
|
|
4380
|
-
if (
|
|
4381
|
-
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock +
|
|
4380
|
+
if (length < currPos.right.length) {
|
|
4381
|
+
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length));
|
|
4382
4382
|
}
|
|
4383
|
-
|
|
4383
|
+
length -= currPos.right.length;
|
|
4384
4384
|
break;
|
|
4385
4385
|
}
|
|
4386
4386
|
}
|
|
4387
4387
|
currPos.forward();
|
|
4388
4388
|
}
|
|
4389
|
-
if (
|
|
4389
|
+
if (length > 0) {
|
|
4390
4390
|
let newlines = "";
|
|
4391
|
-
for (;
|
|
4391
|
+
for (;length > 0; length--) {
|
|
4392
4392
|
newlines += `
|
|
4393
4393
|
`;
|
|
4394
4394
|
}
|
|
4395
|
-
currPos.right = new Item(createID(ownClientId, getState(
|
|
4395
|
+
currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines));
|
|
4396
4396
|
currPos.right.integrate(transaction, 0);
|
|
4397
4397
|
currPos.forward();
|
|
4398
4398
|
}
|
|
@@ -4486,19 +4486,19 @@ var cleanupYTextFormatting = (type) => {
|
|
|
4486
4486
|
};
|
|
4487
4487
|
var cleanupYTextAfterTransaction = (transaction) => {
|
|
4488
4488
|
const needFullCleanup = new Set;
|
|
4489
|
-
const
|
|
4489
|
+
const doc = transaction.doc;
|
|
4490
4490
|
for (const [client, afterClock] of transaction.afterState.entries()) {
|
|
4491
4491
|
const clock = transaction.beforeState.get(client) || 0;
|
|
4492
4492
|
if (afterClock === clock) {
|
|
4493
4493
|
continue;
|
|
4494
4494
|
}
|
|
4495
|
-
iterateStructs(transaction,
|
|
4495
|
+
iterateStructs(transaction, doc.store.clients.get(client), clock, afterClock, (item) => {
|
|
4496
4496
|
if (!item.deleted && item.content.constructor === ContentFormat && item.constructor !== GC) {
|
|
4497
4497
|
needFullCleanup.add(item.parent);
|
|
4498
4498
|
}
|
|
4499
4499
|
});
|
|
4500
4500
|
}
|
|
4501
|
-
transact(
|
|
4501
|
+
transact(doc, (t) => {
|
|
4502
4502
|
iterateDeletedStructs(transaction, transaction.deleteSet, (item) => {
|
|
4503
4503
|
if (item instanceof GC || !item.parent._hasFormatting || needFullCleanup.has(item.parent)) {
|
|
4504
4504
|
return;
|
|
@@ -4515,20 +4515,20 @@ var cleanupYTextAfterTransaction = (transaction) => {
|
|
|
4515
4515
|
}
|
|
4516
4516
|
});
|
|
4517
4517
|
};
|
|
4518
|
-
var deleteText = (transaction, currPos,
|
|
4519
|
-
const startLength =
|
|
4518
|
+
var deleteText = (transaction, currPos, length) => {
|
|
4519
|
+
const startLength = length;
|
|
4520
4520
|
const startAttrs = copy(currPos.currentAttributes);
|
|
4521
4521
|
const start = currPos.right;
|
|
4522
|
-
while (
|
|
4522
|
+
while (length > 0 && currPos.right !== null) {
|
|
4523
4523
|
if (currPos.right.deleted === false) {
|
|
4524
4524
|
switch (currPos.right.content.constructor) {
|
|
4525
4525
|
case ContentType:
|
|
4526
4526
|
case ContentEmbed:
|
|
4527
4527
|
case ContentString:
|
|
4528
|
-
if (
|
|
4529
|
-
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock +
|
|
4528
|
+
if (length < currPos.right.length) {
|
|
4529
|
+
getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length));
|
|
4530
4530
|
}
|
|
4531
|
-
|
|
4531
|
+
length -= currPos.right.length;
|
|
4532
4532
|
currPos.right.delete(transaction);
|
|
4533
4533
|
break;
|
|
4534
4534
|
}
|
|
@@ -4540,7 +4540,7 @@ var deleteText = (transaction, currPos, length2) => {
|
|
|
4540
4540
|
}
|
|
4541
4541
|
const parent = (currPos.left || currPos.right).parent;
|
|
4542
4542
|
if (parent._searchMarker) {
|
|
4543
|
-
updateMarkerChanges(parent._searchMarker, currPos.index, -startLength +
|
|
4543
|
+
updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length);
|
|
4544
4544
|
}
|
|
4545
4545
|
return currPos;
|
|
4546
4546
|
};
|
|
@@ -4766,9 +4766,9 @@ class YText extends AbstractType {
|
|
|
4766
4766
|
return new YText;
|
|
4767
4767
|
}
|
|
4768
4768
|
clone() {
|
|
4769
|
-
const
|
|
4770
|
-
|
|
4771
|
-
return
|
|
4769
|
+
const text = new YText;
|
|
4770
|
+
text.applyDelta(this.toDelta());
|
|
4771
|
+
return text;
|
|
4772
4772
|
}
|
|
4773
4773
|
_callObserver(transaction, parentSubs) {
|
|
4774
4774
|
super._callObserver(transaction, parentSubs);
|
|
@@ -4820,7 +4820,7 @@ class YText extends AbstractType {
|
|
|
4820
4820
|
this.doc ?? warnPrematureAccess();
|
|
4821
4821
|
const ops = [];
|
|
4822
4822
|
const currentAttributes = new Map;
|
|
4823
|
-
const
|
|
4823
|
+
const doc = this.doc;
|
|
4824
4824
|
let str = "";
|
|
4825
4825
|
let n = this._start;
|
|
4826
4826
|
function packStr() {
|
|
@@ -4891,7 +4891,7 @@ class YText extends AbstractType {
|
|
|
4891
4891
|
packStr();
|
|
4892
4892
|
};
|
|
4893
4893
|
if (snapshot || prevSnapshot) {
|
|
4894
|
-
transact(
|
|
4894
|
+
transact(doc, (transaction) => {
|
|
4895
4895
|
if (snapshot) {
|
|
4896
4896
|
splitSnapshotAffectedStructs(transaction, snapshot);
|
|
4897
4897
|
}
|
|
@@ -4905,8 +4905,8 @@ class YText extends AbstractType {
|
|
|
4905
4905
|
}
|
|
4906
4906
|
return ops;
|
|
4907
4907
|
}
|
|
4908
|
-
insert(index,
|
|
4909
|
-
if (
|
|
4908
|
+
insert(index, text, attributes) {
|
|
4909
|
+
if (text.length <= 0) {
|
|
4910
4910
|
return;
|
|
4911
4911
|
}
|
|
4912
4912
|
const y = this.doc;
|
|
@@ -4919,10 +4919,10 @@ class YText extends AbstractType {
|
|
|
4919
4919
|
attributes[k] = v;
|
|
4920
4920
|
});
|
|
4921
4921
|
}
|
|
4922
|
-
insertText(transaction, this, pos,
|
|
4922
|
+
insertText(transaction, this, pos, text, attributes);
|
|
4923
4923
|
});
|
|
4924
4924
|
} else {
|
|
4925
|
-
this._pending.push(() => this.insert(index,
|
|
4925
|
+
this._pending.push(() => this.insert(index, text, attributes));
|
|
4926
4926
|
}
|
|
4927
4927
|
}
|
|
4928
4928
|
insertEmbed(index, embed, attributes) {
|
|
@@ -4936,21 +4936,21 @@ class YText extends AbstractType {
|
|
|
4936
4936
|
this._pending.push(() => this.insertEmbed(index, embed, attributes || {}));
|
|
4937
4937
|
}
|
|
4938
4938
|
}
|
|
4939
|
-
delete(index,
|
|
4940
|
-
if (
|
|
4939
|
+
delete(index, length) {
|
|
4940
|
+
if (length === 0) {
|
|
4941
4941
|
return;
|
|
4942
4942
|
}
|
|
4943
4943
|
const y = this.doc;
|
|
4944
4944
|
if (y !== null) {
|
|
4945
4945
|
transact(y, (transaction) => {
|
|
4946
|
-
deleteText(transaction, findPosition(transaction, this, index, true),
|
|
4946
|
+
deleteText(transaction, findPosition(transaction, this, index, true), length);
|
|
4947
4947
|
});
|
|
4948
4948
|
} else {
|
|
4949
|
-
this._pending.push(() => this.delete(index,
|
|
4949
|
+
this._pending.push(() => this.delete(index, length));
|
|
4950
4950
|
}
|
|
4951
4951
|
}
|
|
4952
|
-
format(index,
|
|
4953
|
-
if (
|
|
4952
|
+
format(index, length, attributes) {
|
|
4953
|
+
if (length === 0) {
|
|
4954
4954
|
return;
|
|
4955
4955
|
}
|
|
4956
4956
|
const y = this.doc;
|
|
@@ -4960,10 +4960,10 @@ class YText extends AbstractType {
|
|
|
4960
4960
|
if (pos.right === null) {
|
|
4961
4961
|
return;
|
|
4962
4962
|
}
|
|
4963
|
-
formatText(transaction, this, pos,
|
|
4963
|
+
formatText(transaction, this, pos, length, attributes);
|
|
4964
4964
|
});
|
|
4965
4965
|
} else {
|
|
4966
|
-
this._pending.push(() => this.format(index,
|
|
4966
|
+
this._pending.push(() => this.format(index, length, attributes));
|
|
4967
4967
|
}
|
|
4968
4968
|
}
|
|
4969
4969
|
removeAttribute(attributeName) {
|
|
@@ -5070,7 +5070,7 @@ class YXmlFragment extends AbstractType {
|
|
|
5070
5070
|
}
|
|
5071
5071
|
querySelector(query) {
|
|
5072
5072
|
query = query.toUpperCase();
|
|
5073
|
-
const iterator = new YXmlTreeWalker(this, (
|
|
5073
|
+
const iterator = new YXmlTreeWalker(this, (element) => element.nodeName && element.nodeName.toUpperCase() === query);
|
|
5074
5074
|
const next = iterator.next();
|
|
5075
5075
|
if (next.done) {
|
|
5076
5076
|
return null;
|
|
@@ -5080,7 +5080,7 @@ class YXmlFragment extends AbstractType {
|
|
|
5080
5080
|
}
|
|
5081
5081
|
querySelectorAll(query) {
|
|
5082
5082
|
query = query.toUpperCase();
|
|
5083
|
-
return from(new YXmlTreeWalker(this, (
|
|
5083
|
+
return from(new YXmlTreeWalker(this, (element) => element.nodeName && element.nodeName.toUpperCase() === query));
|
|
5084
5084
|
}
|
|
5085
5085
|
_callObserver(transaction, parentSubs) {
|
|
5086
5086
|
callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction));
|
|
@@ -5125,13 +5125,13 @@ class YXmlFragment extends AbstractType {
|
|
|
5125
5125
|
pc.splice(index, 0, ...content);
|
|
5126
5126
|
}
|
|
5127
5127
|
}
|
|
5128
|
-
delete(index,
|
|
5128
|
+
delete(index, length = 1) {
|
|
5129
5129
|
if (this.doc !== null) {
|
|
5130
5130
|
transact(this.doc, (transaction) => {
|
|
5131
|
-
typeListDelete(transaction, this, index,
|
|
5131
|
+
typeListDelete(transaction, this, index, length);
|
|
5132
5132
|
});
|
|
5133
5133
|
} else {
|
|
5134
|
-
this._prelimContent.splice(index,
|
|
5134
|
+
this._prelimContent.splice(index, length);
|
|
5135
5135
|
}
|
|
5136
5136
|
}
|
|
5137
5137
|
toArray() {
|
|
@@ -5194,14 +5194,14 @@ class YXmlElement extends YXmlFragment {
|
|
|
5194
5194
|
toString() {
|
|
5195
5195
|
const attrs = this.getAttributes();
|
|
5196
5196
|
const stringBuilder = [];
|
|
5197
|
-
const
|
|
5197
|
+
const keys = [];
|
|
5198
5198
|
for (const key in attrs) {
|
|
5199
|
-
|
|
5199
|
+
keys.push(key);
|
|
5200
5200
|
}
|
|
5201
|
-
|
|
5202
|
-
const keysLen =
|
|
5201
|
+
keys.sort();
|
|
5202
|
+
const keysLen = keys.length;
|
|
5203
5203
|
for (let i = 0;i < keysLen; i++) {
|
|
5204
|
-
const key =
|
|
5204
|
+
const key = keys[i];
|
|
5205
5205
|
stringBuilder.push(key + '="' + attrs[key] + '"');
|
|
5206
5206
|
}
|
|
5207
5207
|
const nodeName = this.nodeName.toLocaleLowerCase();
|
|
@@ -5323,9 +5323,9 @@ class YXmlText extends YText {
|
|
|
5323
5323
|
return new YXmlText;
|
|
5324
5324
|
}
|
|
5325
5325
|
clone() {
|
|
5326
|
-
const
|
|
5327
|
-
|
|
5328
|
-
return
|
|
5326
|
+
const text = new YXmlText;
|
|
5327
|
+
text.applyDelta(this.toDelta());
|
|
5328
|
+
return text;
|
|
5329
5329
|
}
|
|
5330
5330
|
toDOM(_document = document, hooks, binding) {
|
|
5331
5331
|
const dom = _document.createTextNode(this.toString());
|
|
@@ -5373,9 +5373,9 @@ class YXmlText extends YText {
|
|
|
5373
5373
|
var readYXmlText = (decoder) => new YXmlText;
|
|
5374
5374
|
|
|
5375
5375
|
class AbstractStruct {
|
|
5376
|
-
constructor(
|
|
5377
|
-
this.id =
|
|
5378
|
-
this.length =
|
|
5376
|
+
constructor(id, length) {
|
|
5377
|
+
this.id = id;
|
|
5378
|
+
this.length = length;
|
|
5379
5379
|
}
|
|
5380
5380
|
get deleted() {
|
|
5381
5381
|
throw methodUnimplemented();
|
|
@@ -5496,21 +5496,21 @@ var readContentDeleted = (decoder) => new ContentDeleted(decoder.readLen());
|
|
|
5496
5496
|
var createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false });
|
|
5497
5497
|
|
|
5498
5498
|
class ContentDoc {
|
|
5499
|
-
constructor(
|
|
5500
|
-
if (
|
|
5499
|
+
constructor(doc) {
|
|
5500
|
+
if (doc._item) {
|
|
5501
5501
|
console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid.");
|
|
5502
5502
|
}
|
|
5503
|
-
this.doc =
|
|
5503
|
+
this.doc = doc;
|
|
5504
5504
|
const opts = {};
|
|
5505
5505
|
this.opts = opts;
|
|
5506
|
-
if (!
|
|
5506
|
+
if (!doc.gc) {
|
|
5507
5507
|
opts.gc = false;
|
|
5508
5508
|
}
|
|
5509
|
-
if (
|
|
5509
|
+
if (doc.autoLoad) {
|
|
5510
5510
|
opts.autoLoad = true;
|
|
5511
5511
|
}
|
|
5512
|
-
if (
|
|
5513
|
-
opts.meta =
|
|
5512
|
+
if (doc.meta !== null) {
|
|
5513
|
+
opts.meta = doc.meta;
|
|
5514
5514
|
}
|
|
5515
5515
|
}
|
|
5516
5516
|
getLength() {
|
|
@@ -5828,11 +5828,11 @@ class ContentType {
|
|
|
5828
5828
|
}
|
|
5829
5829
|
item = item.right;
|
|
5830
5830
|
}
|
|
5831
|
-
this.type._map.forEach((
|
|
5832
|
-
if (!
|
|
5833
|
-
|
|
5834
|
-
} else if (
|
|
5835
|
-
transaction._mergeStructs.push(
|
|
5831
|
+
this.type._map.forEach((item) => {
|
|
5832
|
+
if (!item.deleted) {
|
|
5833
|
+
item.delete(transaction);
|
|
5834
|
+
} else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {
|
|
5835
|
+
transaction._mergeStructs.push(item);
|
|
5836
5836
|
}
|
|
5837
5837
|
});
|
|
5838
5838
|
transaction.changed.delete(this.type);
|
|
@@ -5844,10 +5844,10 @@ class ContentType {
|
|
|
5844
5844
|
item = item.right;
|
|
5845
5845
|
}
|
|
5846
5846
|
this.type._start = null;
|
|
5847
|
-
this.type._map.forEach((
|
|
5848
|
-
while (
|
|
5849
|
-
|
|
5850
|
-
|
|
5847
|
+
this.type._map.forEach((item) => {
|
|
5848
|
+
while (item !== null) {
|
|
5849
|
+
item.gc(store, true);
|
|
5850
|
+
item = item.left;
|
|
5851
5851
|
}
|
|
5852
5852
|
});
|
|
5853
5853
|
this.type._map = new Map;
|
|
@@ -5860,8 +5860,8 @@ class ContentType {
|
|
|
5860
5860
|
}
|
|
5861
5861
|
}
|
|
5862
5862
|
var readContentType = (decoder) => new ContentType(typeRefs[decoder.readTypeRef()](decoder));
|
|
5863
|
-
var followRedone = (store,
|
|
5864
|
-
let nextID =
|
|
5863
|
+
var followRedone = (store, id) => {
|
|
5864
|
+
let nextID = id;
|
|
5865
5865
|
let diff = 0;
|
|
5866
5866
|
let item;
|
|
5867
5867
|
do {
|
|
@@ -5906,11 +5906,11 @@ var splitItem = (transaction, leftItem, diff) => {
|
|
|
5906
5906
|
leftItem.length = diff;
|
|
5907
5907
|
return rightItem;
|
|
5908
5908
|
};
|
|
5909
|
-
var isDeletedByUndoStack = (stack,
|
|
5909
|
+
var isDeletedByUndoStack = (stack, id) => some(stack, (s) => isDeleted(s.deletions, id));
|
|
5910
5910
|
var redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {
|
|
5911
|
-
const
|
|
5912
|
-
const store =
|
|
5913
|
-
const ownClientID =
|
|
5911
|
+
const doc = transaction.doc;
|
|
5912
|
+
const store = doc.store;
|
|
5913
|
+
const ownClientID = doc.clientID;
|
|
5914
5914
|
const redone = item.redone;
|
|
5915
5915
|
if (redone !== null) {
|
|
5916
5916
|
return getItemCleanStart(transaction, redone);
|
|
@@ -5981,8 +5981,8 @@ var redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChan
|
|
|
5981
5981
|
};
|
|
5982
5982
|
|
|
5983
5983
|
class Item extends AbstractStruct {
|
|
5984
|
-
constructor(
|
|
5985
|
-
super(
|
|
5984
|
+
constructor(id, left, origin, right, rightOrigin, parent, parentSub, content) {
|
|
5985
|
+
super(id, content.getLength());
|
|
5986
5986
|
this.origin = origin;
|
|
5987
5987
|
this.left = left;
|
|
5988
5988
|
this.right = right;
|
|
@@ -6301,85 +6301,85 @@ if (glo[importIdentifier] === true) {
|
|
|
6301
6301
|
glo[importIdentifier] = true;
|
|
6302
6302
|
|
|
6303
6303
|
// ../collab/src/envelope.ts
|
|
6304
|
-
var
|
|
6305
|
-
var
|
|
6306
|
-
var
|
|
6307
|
-
var
|
|
6304
|
+
var FRAME_DOC_SYNC2 = 0;
|
|
6305
|
+
var FRAME_AWARENESS2 = 1;
|
|
6306
|
+
var FRAME_DOC_CLOSE2 = 2;
|
|
6307
|
+
var FRAME_CONTROL2 = 3;
|
|
6308
6308
|
|
|
6309
|
-
class
|
|
6309
|
+
class EnvelopeError2 extends Error {
|
|
6310
6310
|
constructor(message) {
|
|
6311
6311
|
super(message);
|
|
6312
6312
|
this.name = "EnvelopeError";
|
|
6313
6313
|
}
|
|
6314
6314
|
}
|
|
6315
|
-
function
|
|
6315
|
+
function encodeFrame2(frame) {
|
|
6316
6316
|
const encoder = createEncoder();
|
|
6317
6317
|
switch (frame.type) {
|
|
6318
6318
|
case "doc-sync": {
|
|
6319
|
-
writeVarUint(encoder,
|
|
6319
|
+
writeVarUint(encoder, FRAME_DOC_SYNC2);
|
|
6320
6320
|
writeVarString(encoder, frame.path);
|
|
6321
6321
|
writeVarUint(encoder, frame.epoch);
|
|
6322
6322
|
writeVarUint8Array(encoder, frame.body);
|
|
6323
6323
|
break;
|
|
6324
6324
|
}
|
|
6325
6325
|
case "awareness": {
|
|
6326
|
-
writeVarUint(encoder,
|
|
6326
|
+
writeVarUint(encoder, FRAME_AWARENESS2);
|
|
6327
6327
|
writeVarUint8Array(encoder, frame.body);
|
|
6328
6328
|
break;
|
|
6329
6329
|
}
|
|
6330
6330
|
case "doc-close": {
|
|
6331
|
-
writeVarUint(encoder,
|
|
6331
|
+
writeVarUint(encoder, FRAME_DOC_CLOSE2);
|
|
6332
6332
|
writeVarString(encoder, frame.path);
|
|
6333
6333
|
break;
|
|
6334
6334
|
}
|
|
6335
6335
|
case "control": {
|
|
6336
|
-
writeVarUint(encoder,
|
|
6336
|
+
writeVarUint(encoder, FRAME_CONTROL2);
|
|
6337
6337
|
writeVarString(encoder, JSON.stringify(frame.message));
|
|
6338
6338
|
break;
|
|
6339
6339
|
}
|
|
6340
6340
|
default: {
|
|
6341
|
-
throw new
|
|
6341
|
+
throw new EnvelopeError2(`unknown-frame:${frame.type}`);
|
|
6342
6342
|
}
|
|
6343
6343
|
}
|
|
6344
6344
|
return toUint8Array(encoder);
|
|
6345
6345
|
}
|
|
6346
|
-
function
|
|
6346
|
+
function decodeFrame2(data) {
|
|
6347
6347
|
try {
|
|
6348
6348
|
const decoder = createDecoder(data);
|
|
6349
6349
|
const frameType = readVarUint(decoder);
|
|
6350
6350
|
switch (frameType) {
|
|
6351
|
-
case
|
|
6351
|
+
case FRAME_DOC_SYNC2: {
|
|
6352
6352
|
const path = readVarString(decoder);
|
|
6353
6353
|
const epoch = readVarUint(decoder);
|
|
6354
6354
|
const body = readVarUint8Array(decoder);
|
|
6355
6355
|
return { body, epoch, path, type: "doc-sync" };
|
|
6356
6356
|
}
|
|
6357
|
-
case
|
|
6357
|
+
case FRAME_AWARENESS2: {
|
|
6358
6358
|
return { body: readVarUint8Array(decoder), type: "awareness" };
|
|
6359
6359
|
}
|
|
6360
|
-
case
|
|
6360
|
+
case FRAME_DOC_CLOSE2: {
|
|
6361
6361
|
return { path: readVarString(decoder), type: "doc-close" };
|
|
6362
6362
|
}
|
|
6363
|
-
case
|
|
6363
|
+
case FRAME_CONTROL2: {
|
|
6364
6364
|
const message = JSON.parse(readVarString(decoder));
|
|
6365
6365
|
if (typeof message !== "object" || typeof message.type !== "string") {
|
|
6366
|
-
throw new
|
|
6366
|
+
throw new EnvelopeError2("malformed-control");
|
|
6367
6367
|
}
|
|
6368
6368
|
return { message, type: "control" };
|
|
6369
6369
|
}
|
|
6370
6370
|
default: {
|
|
6371
|
-
throw new
|
|
6371
|
+
throw new EnvelopeError2(`unknown-frame-type:${frameType}`);
|
|
6372
6372
|
}
|
|
6373
6373
|
}
|
|
6374
6374
|
} catch (error) {
|
|
6375
|
-
if (error instanceof
|
|
6375
|
+
if (error instanceof EnvelopeError2) {
|
|
6376
6376
|
throw error;
|
|
6377
6377
|
}
|
|
6378
|
-
throw new
|
|
6378
|
+
throw new EnvelopeError2(`malformed-frame: ${error instanceof Error ? error.message : String(error)}`);
|
|
6379
6379
|
}
|
|
6380
6380
|
}
|
|
6381
6381
|
|
|
6382
|
-
export { Observable, floor, createEncoder, length, toUint8Array, writeVarUint, writeVarString, writeVarUint8Array, createDecoder, readVarUint8Array, readVarUint, readVarString, getUnixTime, equalityDeep, Doc, applyUpdate, encodeStateAsUpdate, encodeStateVector,
|
|
6382
|
+
export { Observable, floor, createEncoder, length, toUint8Array, writeVarUint, writeVarString, writeVarUint8Array, createDecoder, readVarUint8Array, readVarUint, readVarString, getUnixTime, equalityDeep, Doc, applyUpdate, encodeStateAsUpdate, encodeStateVector, createRelativePositionFromTypeIndex2, createAbsolutePositionFromRelativePosition2, UndoManager2, YArrayEvent, YArray, YMapEvent, YMap, YTextEvent, YText, FRAME_DOC_SYNC2, FRAME_AWARENESS2, FRAME_DOC_CLOSE2, FRAME_CONTROL2, EnvelopeError2, encodeFrame2, decodeFrame2 };
|
|
6383
6383
|
|
|
6384
|
-
//# debugId=
|
|
6385
|
-
//# sourceMappingURL=studio-
|
|
6384
|
+
//# debugId=4356C2FD61A1E57464756E2164756E21
|
|
6385
|
+
//# sourceMappingURL=studio-h4nvnjvz.js.map
|