@lostgradient/cinder 0.16.0 → 0.17.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/CHANGELOG.md +191 -0
- package/README.md +33 -11
- package/components.json +53 -102
- package/dist/_internal/chart/chart-utilities.d.ts +1 -0
- package/dist/cli/index.js +63 -10
- package/dist/cli/mcp-dependencies.d.ts +4 -0
- package/dist/components/approval-card/approval-card.css +1 -6
- package/dist/components/approval-card/index.js +94 -55
- package/dist/components/area-chart/index.js +40 -6
- package/dist/components/bar-chart/index.js +132 -83
- package/dist/components/code-block/index.js +58 -9
- package/dist/components/command-menu/command-menu.css +9 -0
- package/dist/components/command-menu/index.js +7 -2
- package/dist/components/data-table/index.js +88 -31
- package/dist/components/diff-statistics/diff-statistics.svelte.d.ts +3 -3
- package/dist/components/file-upload/file-upload.schema.js +5 -1
- package/dist/components/file-upload/file-upload.types.d.ts +2 -0
- package/dist/components/file-upload/index.js +37 -27
- package/dist/components/invocation-rule-builder/index.d.ts +1 -1
- package/dist/components/invocation-rule-builder/index.js +244 -199
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +8 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.d.ts +2 -2
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +309 -193
- package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +3 -2
- package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +98 -31
- package/dist/components/json-editor/index.d.ts +5 -0
- package/dist/components/json-editor/index.js +261 -0
- package/dist/components/json-editor/json-editor.css +49 -0
- package/dist/components/{diff-viewer/diff-viewer.schema.js → json-editor/json-editor.schema.js} +37 -49
- package/dist/components/json-editor/json-editor.svelte.d.ts +21 -0
- package/dist/components/json-editor/json-editor.types.d.ts +25 -0
- package/dist/components/{diff-viewer/diff-viewer.variables.js → json-editor/json-editor.variables.js} +4 -4
- package/dist/components/json-schema-editor/index.js +2041 -4165
- package/dist/components/json-schema-editor/json-schema-editor-state.svelte.d.ts +17 -1
- package/dist/components/json-schema-editor/json-schema-editor-types.d.ts +8 -1
- package/dist/components/json-schema-editor/json-schema-editor.css +35 -0
- package/dist/components/json-schema-editor/json-schema-editor.svelte.d.ts +0 -1
- package/dist/components/json-schema-editor/json-schema-validator.d.ts +9 -4
- package/dist/components/line-chart/index.js +40 -6
- package/dist/components/matrix-chart/index.js +40 -6
- package/dist/components/payload-inspector/index.js +10 -2
- package/dist/components/payload-inspector/payload-inspector.schema.js +11 -1
- package/dist/components/payload-inspector/payload-inspector.types.d.ts +20 -0
- package/dist/components/run-step-timeline/index.js +158 -110
- package/dist/components/run-step-timeline/run-step-timeline.css +46 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.js +26 -1
- package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +22 -2
- package/dist/components/schedule-builder/index.js +165 -93
- package/dist/components/schedule-builder/schedule-builder.schema.js +8 -1
- package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +1 -1
- package/dist/components/schedule-builder/schedule-builder.types.d.ts +12 -0
- package/dist/components/schema-form/index.d.ts +1 -1
- package/dist/components/schema-form/index.js +107 -25
- package/dist/components/schema-form/schema-form.schema.js +9 -1
- package/dist/components/schema-form/schema-form.svelte.d.ts +1 -1
- package/dist/components/schema-form/schema-form.types.d.ts +8 -0
- package/dist/components/sidebar/index.js +93 -42
- package/dist/components/sidebar/sidebar.css +7 -16
- package/dist/components/sidebar/sidebar.schema.js +8 -9
- package/dist/components/sidebar/sidebar.types.d.ts +14 -12
- package/dist/components/source-diff-viewer/source-diff-viewer.svelte.d.ts +2 -2
- package/dist/components/spectrogram/index.js +40 -6
- package/dist/components/spectrum-chart/index.js +40 -6
- package/dist/components/table/index.js +85 -28
- package/dist/components/table/table.css +11 -0
- package/dist/components/table/table.schema.js +10 -1
- package/dist/components/table/table.types.d.ts +24 -1
- package/dist/components/tabs/tabs.css +2 -0
- package/dist/components/textarea/textarea.svelte.d.ts +1 -1
- package/dist/components/toast-region/index.js +2 -2
- package/dist/components/toast-region/toast-region.css +1 -1
- package/dist/components/waveform/index.js +40 -6
- package/dist/highlighters/shiki/index.d.ts +47 -5
- package/dist/highlighters/shiki/index.js +58 -9
- package/dist/index.d.ts +4 -4
- package/dist/index.js +15394 -16128
- package/dist/server/components/access-gate/index.js +2 -5
- package/dist/server/components/approval-card/index.js +2 -2
- package/dist/server/components/area-chart/index.js +3 -3
- package/dist/server/components/bar-chart/index.js +3 -3
- package/dist/server/components/command-menu/index.js +1 -1
- package/dist/server/components/context-menu/index.js +5 -5
- package/dist/server/components/data-table/index.js +3 -3
- package/dist/server/components/diff-statistics/index.js +3 -5
- package/dist/server/components/dropdown/index.js +6 -7
- package/dist/server/components/file-upload/index.js +2 -3
- package/dist/server/components/icons/index.js +17 -26
- package/dist/server/components/inline-loading/index.js +1 -1
- package/dist/server/components/invocation-rule-builder/index.js +1 -1
- package/dist/server/components/json-editor/index.js +13 -0
- package/dist/server/components/json-schema-editor/index.js +4 -16
- package/dist/server/components/line-chart/index.js +3 -3
- package/dist/server/components/matrix-chart/index.js +2 -2
- package/dist/server/components/menu-bar/index.js +4 -4
- package/dist/server/components/payload-inspector/index.js +2 -2
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/schedule-builder/index.js +3 -3
- package/dist/server/components/schema-form/index.js +1 -1
- package/dist/server/components/selection-popover/index.js +3 -5
- package/dist/server/components/sidebar/index.js +1 -1
- package/dist/server/components/spectrogram/index.js +2 -2
- package/dist/server/components/spectrum-chart/index.js +2 -2
- package/dist/server/components/surface/index.js +3 -5
- package/dist/server/components/table/index.js +3 -3
- package/dist/server/components/tabs/index.js +5 -5
- package/dist/server/components/toast-region/index.js +1 -1
- package/dist/server/components/toolbar/index.js +2 -3
- package/dist/server/components/waveform/index.js +2 -2
- package/dist/server/highlighters/shiki/index.js +61 -25
- package/dist/server/index.js +106 -116
- package/dist/server/{index.server-7yfz2t73.js → index.server-003t81xk.js} +1 -1
- package/dist/server/{index.server-mehav5vs.js → index.server-032p855q.js} +5 -5
- package/dist/server/{index.server-tf2n3ccm.js → index.server-1vfhzhkj.js} +1 -1
- package/dist/server/{index.server-jz5yxwde.js → index.server-4cbqjf14.js} +16 -7
- package/dist/server/{index.server-aqethy0w.js → index.server-66nm5gd5.js} +102 -26
- package/dist/server/{index.server-m0ezemav.js → index.server-6mnbznbt.js} +4 -2
- package/dist/server/{index.server-1nq8h5yb.js → index.server-6vbpz6dd.js} +40 -6
- package/dist/server/{index.server-796hb0r8.js → index.server-7qak74fg.js} +1 -1
- package/dist/server/{index.server-5exh7rmw.js → index.server-7ygdwxre.js} +57 -5
- package/dist/server/{index.server-q1d48s9t.js → index.server-8c6cck0y.js} +6 -4
- package/dist/server/index.server-93vt8ktj.js +95 -0
- package/dist/server/{index.server-ep81fn23.js → index.server-9eccb2fc.js} +2 -2
- package/dist/server/{index.server-zncgb7mw.js → index.server-9nac5z11.js} +92 -49
- package/dist/server/{index.server-bf7d81b4.js → index.server-9vqfmhez.js} +16 -18
- package/dist/server/{index.server-nt304e00.js → index.server-dx58qant.js} +1 -1
- package/dist/server/{index.server-zh3r8vfd.js → index.server-fhrqsg97.js} +1 -1
- package/dist/server/{index.server-dq0k0qf6.js → index.server-geq56xaz.js} +10 -10
- package/dist/server/{index.server-51sxnete.js → index.server-hxveaqg1.js} +10 -10
- package/dist/server/{index.server-c5qv3p61.js → index.server-j87v28yy.js} +59 -30
- package/dist/server/{index.server-s5g7reqp.js → index.server-mewms9dg.js} +2 -2
- package/dist/server/index.server-mm728d0w.js +20 -0
- package/dist/server/{index.server-5mc2vsy0.js → index.server-n0rbn5yf.js} +4 -2
- package/dist/server/{index.server-qv0kkre4.js → index.server-ng8y854r.js} +188 -107
- package/dist/server/{index.server-ne4gzxvz.js → index.server-q5gvb174.js} +5 -5
- package/dist/server/{index.server-g5jgq3jp.js → index.server-qxneqxf8.js} +40 -6
- package/dist/server/{index.server-x1dha7bk.js → index.server-rnddtcb3.js} +4 -2
- package/dist/server/{index.server-7zpzspk6.js → index.server-s4wm4g2a.js} +30 -2
- package/dist/server/index.server-szgghcdh.js +887 -0
- package/dist/server/{index.server-thcda9ny.js → index.server-vd302sxz.js} +11 -4
- package/dist/server/{index.server-3sq9d73w.js → index.server-vz9hqkdq.js} +2 -2
- package/dist/server/{index.server-mvjzcna5.js → index.server-wg6ddzpa.js} +42 -20
- package/dist/server/index.server-xanq9ppe.js +119 -0
- package/dist/server/{index.server-67q8dmbp.js → index.server-y2ncgt7p.js} +1 -1
- package/dist/server/{index.server-4x91gzy1.js → index.server-yqhww50r.js} +4 -4
- package/dist/server/{index.server-7798gc22.js → index.server-zfx4magq.js} +4 -2
- package/package.json +45 -288
- package/src/_internal/chart/chart-utilities.ts +74 -5
- package/src/components/approval-card/approval-card-actions.svelte +12 -28
- package/src/components/approval-card/approval-card.css +1 -6
- package/src/components/bar-chart/bar-chart.examples.json +1 -1
- package/src/components/bar-chart/bar-chart.svelte +3 -1
- package/src/components/command-menu/command-menu.css +9 -0
- package/src/components/command-menu/command-menu.svelte +9 -2
- package/src/components/file-upload/file-upload.schema.json +4 -0
- package/src/components/file-upload/file-upload.schema.ts +4 -0
- package/src/components/file-upload/file-upload.svelte +3 -3
- package/src/components/file-upload/file-upload.types.ts +2 -0
- package/src/components/invocation-rule-builder/index.ts +1 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +8 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +70 -7
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +5 -250
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +106 -83
- package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +145 -62
- package/src/components/json-editor/index.ts +6 -0
- package/src/components/json-editor/json-editor.css +49 -0
- package/src/components/json-editor/json-editor.examples.json +13 -0
- package/src/components/json-editor/json-editor.schema.json +57 -0
- package/src/components/json-editor/json-editor.schema.ts +62 -0
- package/src/components/json-editor/json-editor.svelte +104 -0
- package/src/components/json-editor/json-editor.types.ts +29 -0
- package/src/components/json-schema-editor/diff-view.svelte +26 -8
- package/src/components/json-schema-editor/form-view.svelte +1 -1
- package/src/components/json-schema-editor/json-schema-editor-state.svelte.ts +163 -56
- package/src/components/json-schema-editor/json-schema-editor-types.ts +8 -1
- package/src/components/json-schema-editor/json-schema-editor.css +35 -0
- package/src/components/json-schema-editor/json-schema-validator.ts +59 -25
- package/src/components/json-schema-editor/json-view.svelte +52 -18
- package/src/components/payload-inspector/payload-inspector.schema.json +8 -0
- package/src/components/payload-inspector/payload-inspector.schema.ts +10 -0
- package/src/components/payload-inspector/payload-inspector.svelte +2 -2
- package/src/components/payload-inspector/payload-inspector.types.ts +20 -0
- package/src/components/run-step-timeline/run-step-timeline.css +46 -0
- package/src/components/run-step-timeline/run-step-timeline.examples.json +3 -3
- package/src/components/run-step-timeline/run-step-timeline.schema.json +24 -0
- package/src/components/run-step-timeline/run-step-timeline.schema.ts +26 -0
- package/src/components/run-step-timeline/run-step-timeline.svelte +41 -4
- package/src/components/run-step-timeline/run-step-timeline.types.ts +22 -1
- package/src/components/run-step-timeline/run-step-timeline.utilities.ts +9 -1
- package/src/components/schedule-builder/schedule-builder.schema.json +7 -0
- package/src/components/schedule-builder/schedule-builder.schema.ts +8 -0
- package/src/components/schedule-builder/schedule-builder.svelte +94 -22
- package/src/components/schedule-builder/schedule-builder.types.ts +12 -0
- package/src/components/schema-form/index.ts +1 -0
- package/src/components/schema-form/schema-form-body.svelte +94 -17
- package/src/components/schema-form/schema-form.examples.json +1 -1
- package/src/components/schema-form/schema-form.schema.json +5 -0
- package/src/components/schema-form/schema-form.schema.ts +6 -0
- package/src/components/schema-form/schema-form.svelte +4 -0
- package/src/components/schema-form/schema-form.types.ts +9 -0
- package/src/components/side-navigation/side-navigation.examples.json +1 -1
- package/src/components/sidebar/sidebar.css +7 -16
- package/src/components/sidebar/sidebar.examples.json +3 -3
- package/src/components/sidebar/sidebar.schema.json +7 -8
- package/src/components/sidebar/sidebar.schema.ts +8 -8
- package/src/components/sidebar/sidebar.svelte +65 -27
- package/src/components/sidebar/sidebar.types.ts +14 -12
- package/src/components/table/table.css +11 -0
- package/src/components/table/table.examples.json +3 -3
- package/src/components/table/table.schema.json +9 -0
- package/src/components/table/table.schema.ts +11 -0
- package/src/components/table/table.svelte +58 -14
- package/src/components/table/table.types.ts +27 -1
- package/src/components/tabs/tabs.css +2 -0
- package/src/components/toast-region/toast-region.css +1 -1
- package/src/components/toast-region/toast-region.examples.json +1 -1
- package/src/components/toast-region/toast-region.svelte +2 -2
- package/src/highlighters/shiki/index.ts +157 -17
- package/src/index.ts +5 -7
- package/src/styles/components.css +1 -1
- package/src/utilities/change-tracker.svelte.ts +1 -1
- package/dist/commentary/anchor-decorations.d.ts +0 -86
- package/dist/commentary/anchor-decorations.js +0 -490
- package/dist/commentary/anchoring.d.ts +0 -93
- package/dist/commentary/anchoring.js +0 -157
- package/dist/commentary/comments/index.d.ts +0 -12
- package/dist/commentary/comments/index.js +0 -14
- package/dist/commentary/comments/mentions.d.ts +0 -43
- package/dist/commentary/comments/mentions.js +0 -65
- package/dist/commentary/comments/reanchor.d.ts +0 -86
- package/dist/commentary/comments/reanchor.js +0 -220
- package/dist/commentary/comments/types.d.ts +0 -260
- package/dist/commentary/comments/types.js +0 -83
- package/dist/commentary/comments/updates.d.ts +0 -102
- package/dist/commentary/comments/updates.js +0 -226
- package/dist/commentary/export/comments-export.d.ts +0 -42
- package/dist/commentary/export/comments-export.js +0 -258
- package/dist/commentary/export/index.d.ts +0 -12
- package/dist/commentary/export/index.js +0 -12
- package/dist/commentary/export/markdown-summary.d.ts +0 -31
- package/dist/commentary/export/markdown-summary.js +0 -218
- package/dist/commentary/export/types.d.ts +0 -162
- package/dist/commentary/export/types.js +0 -7
- package/dist/commentary/export/unified-diff.d.ts +0 -28
- package/dist/commentary/export/unified-diff.js +0 -250
- package/dist/commentary/index.d.ts +0 -6
- package/dist/commentary/index.js +0 -6
- package/dist/commentary/session/index.d.ts +0 -12
- package/dist/commentary/session/index.js +0 -14
- package/dist/commentary/session/persistence.d.ts +0 -92
- package/dist/commentary/session/persistence.js +0 -253
- package/dist/commentary/session/types.d.ts +0 -208
- package/dist/commentary/session/types.js +0 -26
- package/dist/commentary/session/updates.d.ts +0 -155
- package/dist/commentary/session/updates.js +0 -362
- package/dist/commentary/shared/anchor-types.d.ts +0 -116
- package/dist/commentary/shared/anchor-types.js +0 -9
- package/dist/components/diff-viewer/diff-controller.svelte.d.ts +0 -75
- package/dist/components/diff-viewer/diff-front-matter.svelte.d.ts +0 -28
- package/dist/components/diff-viewer/diff-line.svelte.d.ts +0 -22
- package/dist/components/diff-viewer/diff-summary-bar.svelte.d.ts +0 -13
- package/dist/components/diff-viewer/diff-toolbar.svelte.d.ts +0 -36
- package/dist/components/diff-viewer/diff-viewer.svelte.d.ts +0 -22
- package/dist/components/diff-viewer/diff-viewer.types.d.ts +0 -53
- package/dist/components/diff-viewer/front-matter-header.svelte.d.ts +0 -26
- package/dist/components/diff-viewer/index.d.ts +0 -4
- package/dist/components/diff-viewer/index.js +0 -2848
- package/dist/components/markdown-editor/editor-skeleton.svelte.d.ts +0 -10
- package/dist/components/markdown-editor/editor-toolbar/editor-toolbar.svelte.d.ts +0 -37
- package/dist/components/markdown-editor/editor-toolbar/index.d.ts +0 -11
- package/dist/components/markdown-editor/editor-toolbar/link-popover.svelte.d.ts +0 -30
- package/dist/components/markdown-editor/editor-toolbar/toolbar-button.svelte.d.ts +0 -19
- package/dist/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte.d.ts +0 -24
- package/dist/components/markdown-editor/editor-toolbar/toolbar-separator.svelte.d.ts +0 -7
- package/dist/components/markdown-editor/editor-toolbar/types.d.ts +0 -13
- package/dist/components/markdown-editor/index.css +0 -61
- package/dist/components/markdown-editor/index.d.ts +0 -4
- package/dist/components/markdown-editor/index.js +0 -7494
- package/dist/components/markdown-editor/markdown-editor.schema.d.ts +0 -3
- package/dist/components/markdown-editor/markdown-editor.schema.js +0 -177
- package/dist/components/markdown-editor/markdown-editor.svelte.d.ts +0 -29
- package/dist/components/markdown-editor/markdown-editor.types.d.ts +0 -100
- package/dist/components/markdown-editor/markdown-editor.variables.d.ts +0 -2
- package/dist/components/markdown-editor/markdown-editor.variables.js +0 -61
- package/dist/components/review-editor/comment-composer.svelte.d.ts +0 -37
- package/dist/components/review-editor/comment-list.svelte.d.ts +0 -19
- package/dist/components/review-editor/comment-sidebar.svelte.d.ts +0 -22
- package/dist/components/review-editor/export-actions.svelte.d.ts +0 -18
- package/dist/components/review-editor/focus-navigation.d.ts +0 -105
- package/dist/components/review-editor/front-matter-fields.svelte.d.ts +0 -10
- package/dist/components/review-editor/index.d.ts +0 -20
- package/dist/components/review-editor/index.js +0 -14731
- package/dist/components/review-editor/live-region.svelte.d.ts +0 -23
- package/dist/components/review-editor/review-editor-anchors.svelte.d.ts +0 -96
- package/dist/components/review-editor/review-editor-controls.svelte.d.ts +0 -41
- package/dist/components/review-editor/review-editor-exports.d.ts +0 -80
- package/dist/components/review-editor/review-editor-front-matter.d.ts +0 -28
- package/dist/components/review-editor/review-editor-impl.svelte.d.ts +0 -31
- package/dist/components/review-editor/review-editor-selection-geometry.d.ts +0 -10
- package/dist/components/review-editor/review-editor-selection-types.d.ts +0 -62
- package/dist/components/review-editor/review-editor-selection.svelte.d.ts +0 -50
- package/dist/components/review-editor/review-editor-state.svelte.d.ts +0 -77
- package/dist/components/review-editor/review-editor-threads.svelte.d.ts +0 -137
- package/dist/components/review-editor/review-editor.css +0 -273
- package/dist/components/review-editor/review-editor.schema.d.ts +0 -3
- package/dist/components/review-editor/review-editor.schema.js +0 -143
- package/dist/components/review-editor/review-editor.svelte.d.ts +0 -19
- package/dist/components/review-editor/review-editor.types.d.ts +0 -77
- package/dist/components/review-editor/review-editor.variables.d.ts +0 -2
- package/dist/components/review-editor/review-editor.variables.js +0 -61
- package/dist/components/review-editor/thread-popover.svelte.d.ts +0 -32
- package/dist/diff/index.d.ts +0 -2
- package/dist/diff/index.js +0 -1
- package/dist/diff/line-diff.d.ts +0 -84
- package/dist/diff/line-diff.js +0 -372
- package/dist/diff/types.d.ts +0 -1
- package/dist/diff/types.js +0 -1
- package/dist/editor/attach.d.ts +0 -30
- package/dist/editor/attach.js +0 -86
- package/dist/editor/bridge.d.ts +0 -110
- package/dist/editor/bridge.js +0 -260
- package/dist/editor/clipboard.d.ts +0 -19
- package/dist/editor/clipboard.js +0 -189
- package/dist/editor/commands.d.ts +0 -167
- package/dist/editor/commands.js +0 -728
- package/dist/editor/component-runtime.d.ts +0 -21
- package/dist/editor/component-runtime.js +0 -20
- package/dist/editor/editor.d.ts +0 -23
- package/dist/editor/editor.js +0 -256
- package/dist/editor/index.d.ts +0 -30
- package/dist/editor/index.js +0 -42
- package/dist/editor/keymap-plugin.d.ts +0 -56
- package/dist/editor/keymap-plugin.js +0 -157
- package/dist/editor/link-input-rule.d.ts +0 -4
- package/dist/editor/link-input-rule.js +0 -26
- package/dist/editor/milkdown-plugin-runtime.d.ts +0 -20
- package/dist/editor/milkdown-plugin-runtime.js +0 -43
- package/dist/editor/placeholder-security.d.ts +0 -22
- package/dist/editor/placeholder-security.js +0 -36
- package/dist/editor/placeholder.d.ts +0 -14
- package/dist/editor/placeholder.js +0 -56
- package/dist/editor/sanitize-html.d.ts +0 -32
- package/dist/editor/sanitize-html.js +0 -111
- package/dist/editor/template-completion-plugin.d.ts +0 -159
- package/dist/editor/template-completion-plugin.js +0 -615
- package/dist/editor/template-invalid-decoration-plugin.d.ts +0 -73
- package/dist/editor/template-invalid-decoration-plugin.js +0 -155
- package/dist/editor/template-placeholders.d.ts +0 -96
- package/dist/editor/template-placeholders.js +0 -355
- package/dist/editor/template-position-utilities.d.ts +0 -34
- package/dist/editor/template-position-utilities.js +0 -63
- package/dist/editor/template-render.d.ts +0 -37
- package/dist/editor/template-render.js +0 -45
- package/dist/editor/test-utilities.d.ts +0 -49
- package/dist/editor/test-utilities.js +0 -93
- package/dist/editor/types.d.ts +0 -234
- package/dist/editor/types.js +0 -8
- package/dist/markdown/diff/compute.d.ts +0 -28
- package/dist/markdown/diff/compute.js +0 -250
- package/dist/markdown/diff/frontmatter.d.ts +0 -66
- package/dist/markdown/diff/frontmatter.js +0 -135
- package/dist/markdown/diff/index.d.ts +0 -27
- package/dist/markdown/diff/index.js +0 -28
- package/dist/markdown/diff/line-diff.d.ts +0 -2
- package/dist/markdown/diff/line-diff.js +0 -1
- package/dist/markdown/diff/positions.d.ts +0 -66
- package/dist/markdown/diff/positions.js +0 -147
- package/dist/markdown/diff/types.d.ts +0 -78
- package/dist/markdown/diff/types.js +0 -7
- package/dist/markdown/index.d.ts +0 -2
- package/dist/markdown/index.js +0 -8
- package/dist/markdown/pipeline/ast.d.ts +0 -302
- package/dist/markdown/pipeline/ast.js +0 -417
- package/dist/markdown/pipeline/errors.d.ts +0 -37
- package/dist/markdown/pipeline/errors.js +0 -49
- package/dist/markdown/pipeline/frontmatter.d.ts +0 -127
- package/dist/markdown/pipeline/frontmatter.js +0 -438
- package/dist/markdown/pipeline/index.d.ts +0 -37
- package/dist/markdown/pipeline/index.js +0 -40
- package/dist/markdown/pipeline/parser.d.ts +0 -65
- package/dist/markdown/pipeline/parser.js +0 -106
- package/dist/markdown/pipeline/serializer.d.ts +0 -67
- package/dist/markdown/pipeline/serializer.js +0 -78
- package/dist/markdown/pipeline/strip-positions.d.ts +0 -20
- package/dist/markdown/pipeline/strip-positions.js +0 -28
- package/dist/markdown/pipeline/types.d.ts +0 -116
- package/dist/markdown/pipeline/types.js +0 -8
- package/dist/markdown/rendering/extract-code-blocks.d.ts +0 -16
- package/dist/markdown/rendering/extract-code-blocks.js +0 -27
- package/dist/markdown/rendering/highlighter.d.ts +0 -109
- package/dist/markdown/rendering/highlighter.js +0 -251
- package/dist/markdown/rendering/index.d.ts +0 -41
- package/dist/markdown/rendering/index.js +0 -46
- package/dist/markdown/rendering/mermaid-cache.d.ts +0 -55
- package/dist/markdown/rendering/mermaid-cache.js +0 -123
- package/dist/markdown/rendering/rehype-shiki-sync.d.ts +0 -57
- package/dist/markdown/rendering/rehype-shiki-sync.js +0 -354
- package/dist/markdown/rendering/render-async.d.ts +0 -43
- package/dist/markdown/rendering/render-async.js +0 -114
- package/dist/markdown/rendering/render-streaming.d.ts +0 -33
- package/dist/markdown/rendering/render-streaming.js +0 -123
- package/dist/markdown/rendering/render-worker.d.ts +0 -19
- package/dist/markdown/rendering/render-worker.js +0 -35
- package/dist/markdown/rendering/render.d.ts +0 -123
- package/dist/markdown/rendering/render.js +0 -477
- package/dist/markdown/rendering/sanitize-schema.d.ts +0 -24
- package/dist/markdown/rendering/sanitize-schema.js +0 -105
- package/dist/markdown/rendering/transform-urls.d.ts +0 -37
- package/dist/markdown/rendering/transform-urls.js +0 -51
- package/dist/markdown/rendering/types.d.ts +0 -51
- package/dist/markdown/rendering/types.js +0 -8
- package/dist/markdown/rendering/worker-dom-shim.d.ts +0 -87
- package/dist/markdown/rendering/worker-dom-shim.js +0 -50
- package/dist/markdown/utilities/safe-url.d.ts +0 -100
- package/dist/markdown/utilities/safe-url.js +0 -236
- package/dist/markdown/utilities/sort-keys.d.ts +0 -19
- package/dist/markdown/utilities/sort-keys.js +0 -33
- package/dist/server/commentary/anchor-decorations.js +0 -490
- package/dist/server/commentary/anchoring.js +0 -157
- package/dist/server/commentary/comments/index.js +0 -14
- package/dist/server/commentary/comments/mentions.js +0 -65
- package/dist/server/commentary/comments/reanchor.js +0 -220
- package/dist/server/commentary/comments/types.js +0 -83
- package/dist/server/commentary/comments/updates.js +0 -226
- package/dist/server/commentary/export/comments-export.js +0 -258
- package/dist/server/commentary/export/index.js +0 -12
- package/dist/server/commentary/export/markdown-summary.js +0 -218
- package/dist/server/commentary/export/types.js +0 -7
- package/dist/server/commentary/export/unified-diff.js +0 -250
- package/dist/server/commentary/index.js +0 -6
- package/dist/server/commentary/session/index.js +0 -14
- package/dist/server/commentary/session/persistence.js +0 -253
- package/dist/server/commentary/session/types.js +0 -26
- package/dist/server/commentary/session/updates.js +0 -362
- package/dist/server/commentary/shared/anchor-types.js +0 -9
- package/dist/server/components/diff-viewer/index.js +0 -33
- package/dist/server/components/markdown-editor/index.js +0 -52
- package/dist/server/components/review-editor/index.js +0 -3493
- package/dist/server/diff/index.js +0 -1
- package/dist/server/diff/line-diff.js +0 -372
- package/dist/server/diff/types.js +0 -1
- package/dist/server/editor/attach.js +0 -86
- package/dist/server/editor/bridge.js +0 -260
- package/dist/server/editor/clipboard.js +0 -189
- package/dist/server/editor/commands.js +0 -728
- package/dist/server/editor/component-runtime.js +0 -20
- package/dist/server/editor/editor.js +0 -256
- package/dist/server/editor/index.js +0 -42
- package/dist/server/editor/keymap-plugin.js +0 -157
- package/dist/server/editor/link-input-rule.js +0 -26
- package/dist/server/editor/milkdown-plugin-runtime.js +0 -43
- package/dist/server/editor/placeholder-security.js +0 -36
- package/dist/server/editor/placeholder.js +0 -56
- package/dist/server/editor/sanitize-html.js +0 -111
- package/dist/server/editor/template-completion-plugin.js +0 -615
- package/dist/server/editor/template-invalid-decoration-plugin.js +0 -155
- package/dist/server/editor/template-placeholders.js +0 -355
- package/dist/server/editor/template-position-utilities.js +0 -63
- package/dist/server/editor/template-render.js +0 -45
- package/dist/server/editor/test-utilities.js +0 -93
- package/dist/server/editor/types.js +0 -8
- package/dist/server/index.server-25wmev4e.js +0 -2
- package/dist/server/index.server-2c56kqws.js +0 -187
- package/dist/server/index.server-45n4s30n.js +0 -35
- package/dist/server/index.server-4jkqgp17.js +0 -1026
- package/dist/server/index.server-8nm871y8.js +0 -176
- package/dist/server/index.server-d04aj37r.js +0 -62
- package/dist/server/index.server-dg19y3m7.js +0 -9
- package/dist/server/index.server-g3726bja.js +0 -9
- package/dist/server/index.server-gyzmkrnz.js +0 -2
- package/dist/server/index.server-jp19145t.js +0 -9
- package/dist/server/index.server-mzj20rfz.js +0 -77
- package/dist/server/index.server-n4jxy52q.js +0 -2
- package/dist/server/index.server-sghkqw5x.js +0 -421
- package/dist/server/index.server-w6am2dxc.js +0 -12
- package/dist/server/index.server-x66zvjfc.js +0 -1163
- package/dist/server/index.server-zdhv33ph.js +0 -124
- package/dist/server/index.server-zke5zt13.js +0 -9
- package/dist/server/markdown/diff/compute.js +0 -250
- package/dist/server/markdown/diff/frontmatter.js +0 -135
- package/dist/server/markdown/diff/index.js +0 -28
- package/dist/server/markdown/diff/line-diff.js +0 -1
- package/dist/server/markdown/diff/positions.js +0 -147
- package/dist/server/markdown/diff/types.js +0 -7
- package/dist/server/markdown/index.js +0 -8
- package/dist/server/markdown/pipeline/ast.js +0 -417
- package/dist/server/markdown/pipeline/errors.js +0 -49
- package/dist/server/markdown/pipeline/frontmatter.js +0 -438
- package/dist/server/markdown/pipeline/index.js +0 -40
- package/dist/server/markdown/pipeline/parser.js +0 -106
- package/dist/server/markdown/pipeline/serializer.js +0 -78
- package/dist/server/markdown/pipeline/strip-positions.js +0 -28
- package/dist/server/markdown/pipeline/types.js +0 -8
- package/dist/server/markdown/rendering/extract-code-blocks.js +0 -27
- package/dist/server/markdown/rendering/highlighter.js +0 -251
- package/dist/server/markdown/rendering/index.js +0 -46
- package/dist/server/markdown/rendering/mermaid-cache.js +0 -123
- package/dist/server/markdown/rendering/rehype-shiki-sync.js +0 -354
- package/dist/server/markdown/rendering/render-async.js +0 -114
- package/dist/server/markdown/rendering/render-streaming.js +0 -123
- package/dist/server/markdown/rendering/render-worker.js +0 -35
- package/dist/server/markdown/rendering/render.js +0 -477
- package/dist/server/markdown/rendering/sanitize-schema.js +0 -105
- package/dist/server/markdown/rendering/transform-urls.js +0 -51
- package/dist/server/markdown/rendering/types.js +0 -8
- package/dist/server/markdown/rendering/worker-dom-shim.js +0 -50
- package/dist/server/markdown/utilities/safe-url.js +0 -236
- package/dist/server/markdown/utilities/sort-keys.js +0 -33
- package/src/components/diff-viewer/diff-controller.svelte.ts +0 -250
- package/src/components/diff-viewer/diff-front-matter.svelte +0 -52
- package/src/components/diff-viewer/diff-line.svelte +0 -340
- package/src/components/diff-viewer/diff-summary-bar.svelte +0 -106
- package/src/components/diff-viewer/diff-toolbar.svelte +0 -182
- package/src/components/diff-viewer/diff-viewer.examples.json +0 -25
- package/src/components/diff-viewer/diff-viewer.schema.json +0 -61
- package/src/components/diff-viewer/diff-viewer.schema.ts +0 -70
- package/src/components/diff-viewer/diff-viewer.svelte +0 -400
- package/src/components/diff-viewer/diff-viewer.types.ts +0 -56
- package/src/components/diff-viewer/front-matter-header.svelte +0 -137
- package/src/components/diff-viewer/index.ts +0 -5
- package/src/components/markdown-editor/editor-skeleton.svelte +0 -85
- package/src/components/markdown-editor/editor-toolbar/editor-toolbar.svelte +0 -318
- package/src/components/markdown-editor/editor-toolbar/index.ts +0 -18
- package/src/components/markdown-editor/editor-toolbar/link-popover.svelte +0 -314
- package/src/components/markdown-editor/editor-toolbar/toolbar-button.svelte +0 -97
- package/src/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte +0 -106
- package/src/components/markdown-editor/editor-toolbar/toolbar-separator.svelte +0 -30
- package/src/components/markdown-editor/editor-toolbar/types.ts +0 -15
- package/src/components/markdown-editor/index.ts +0 -10
- package/src/components/markdown-editor/markdown-editor.examples.json +0 -19
- package/src/components/markdown-editor/markdown-editor.schema.json +0 -111
- package/src/components/markdown-editor/markdown-editor.schema.ts +0 -122
- package/src/components/markdown-editor/markdown-editor.svelte +0 -872
- package/src/components/markdown-editor/markdown-editor.types.ts +0 -124
- package/src/components/markdown-editor/markdown-editor.variables.json +0 -1
- package/src/components/markdown-editor/markdown-editor.variables.ts +0 -3
- package/src/components/markdown-editor/prosemirror.css +0 -76
- package/src/components/review-editor/comment-composer.svelte +0 -271
- package/src/components/review-editor/comment-list.svelte +0 -311
- package/src/components/review-editor/comment-sidebar.svelte +0 -449
- package/src/components/review-editor/export-actions.svelte +0 -188
- package/src/components/review-editor/focus-navigation.ts +0 -220
- package/src/components/review-editor/front-matter-fields.svelte +0 -159
- package/src/components/review-editor/index.ts +0 -59
- package/src/components/review-editor/live-region.svelte +0 -109
- package/src/components/review-editor/review-editor-anchors.svelte.ts +0 -219
- package/src/components/review-editor/review-editor-controls.svelte +0 -201
- package/src/components/review-editor/review-editor-exports.ts +0 -145
- package/src/components/review-editor/review-editor-front-matter.ts +0 -237
- package/src/components/review-editor/review-editor-impl.svelte +0 -1509
- package/src/components/review-editor/review-editor-selection-geometry.ts +0 -31
- package/src/components/review-editor/review-editor-selection-types.ts +0 -68
- package/src/components/review-editor/review-editor-selection.svelte.ts +0 -292
- package/src/components/review-editor/review-editor-state.svelte.ts +0 -117
- package/src/components/review-editor/review-editor-threads.svelte.ts +0 -435
- package/src/components/review-editor/review-editor.css +0 -273
- package/src/components/review-editor/review-editor.examples.json +0 -19
- package/src/components/review-editor/review-editor.schema.json +0 -83
- package/src/components/review-editor/review-editor.schema.ts +0 -88
- package/src/components/review-editor/review-editor.svelte +0 -18
- package/src/components/review-editor/review-editor.types.ts +0 -92
- package/src/components/review-editor/review-editor.variables.json +0 -1
- package/src/components/review-editor/review-editor.variables.ts +0 -3
- package/src/components/review-editor/thread-popover.svelte +0 -261
- /package/dist/components/{review-editor/review-editor.css.d.ts → json-editor/json-editor.css.d.ts} +0 -0
- /package/dist/components/{diff-viewer/diff-viewer.schema.d.ts → json-editor/json-editor.schema.d.ts} +0 -0
- /package/dist/components/{diff-viewer/diff-viewer.variables.d.ts → json-editor/json-editor.variables.d.ts} +0 -0
- /package/src/components/{diff-viewer/diff-viewer.variables.json → json-editor/json-editor.variables.json} +0 -0
- /package/src/components/{diff-viewer/diff-viewer.variables.ts → json-editor/json-editor.variables.ts} +0 -0
package/dist/editor/bridge.js
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridge between ProseMirror positions and text offsets.
|
|
3
|
-
*
|
|
4
|
-
* This module provides position mapping utilities needed for:
|
|
5
|
-
* - DEP-39: Comment anchoring (map selection to persistable positions)
|
|
6
|
-
* - DEP-43: Suggested edits (map stored positions back to editor)
|
|
7
|
-
*
|
|
8
|
-
* The bridge maintains the invariant that positions can round-trip
|
|
9
|
-
* between ProseMirror and text offset coordinate systems.
|
|
10
|
-
*
|
|
11
|
-
* Key insight: ProseMirror positions include structural characters
|
|
12
|
-
* (node boundaries), while text offsets (from doc.textBetween()) only
|
|
13
|
-
* count text content plus block separators ('\n' between blocks).
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* WeakMap cache for offset maps, keyed by document instance.
|
|
17
|
-
* Automatically garbage collected when document is no longer referenced.
|
|
18
|
-
*/
|
|
19
|
-
const offsetMapCache = new WeakMap();
|
|
20
|
-
/**
|
|
21
|
-
* Build bidirectional offset map matching doc.textBetween() semantics.
|
|
22
|
-
*
|
|
23
|
-
* textBetween inserts blockSeparator (default '\n') between block nodes.
|
|
24
|
-
* This function mirrors that behavior exactly by walking the document
|
|
25
|
-
* and tracking when we transition between blocks.
|
|
26
|
-
*
|
|
27
|
-
* Key insight: textBetween adds separator BETWEEN consecutive block content,
|
|
28
|
-
* not at every block boundary. We track this by noting when we exit one
|
|
29
|
-
* block's text content and enter another's.
|
|
30
|
-
*
|
|
31
|
-
* @param doc - ProseMirror document node
|
|
32
|
-
* @returns Cached bidirectional position map
|
|
33
|
-
*/
|
|
34
|
-
export function buildTextToProseMirrorPositionMap(doc) {
|
|
35
|
-
const cached = offsetMapCache.get(doc);
|
|
36
|
-
if (cached)
|
|
37
|
-
return cached;
|
|
38
|
-
const textToPm = new Map();
|
|
39
|
-
const pmToText = new Map();
|
|
40
|
-
let textOffset = 0;
|
|
41
|
-
let hasEmittedContent = false;
|
|
42
|
-
/**
|
|
43
|
-
* Walk document in order, tracking block boundaries.
|
|
44
|
-
*
|
|
45
|
-
* Key insight: doc.textBetween() adds separators between TEXT BLOCKS
|
|
46
|
-
* (paragraph, heading, code_block), not wrapper blocks (list, blockquote,
|
|
47
|
-
* list_item). Using isTextblock instead of isBlock ensures we only add
|
|
48
|
-
* separators where textBetween would.
|
|
49
|
-
*/
|
|
50
|
-
function walk(node, pos) {
|
|
51
|
-
// For text blocks (not wrapper blocks), add separator
|
|
52
|
-
// before their content if we've already emitted content
|
|
53
|
-
// isTextblock = true for paragraph, heading, code_block
|
|
54
|
-
// isTextblock = false for bullet_list, list_item, blockquote
|
|
55
|
-
if (node.isTextblock && hasEmittedContent && pos > 0) {
|
|
56
|
-
// This is where textBetween would insert '\n'
|
|
57
|
-
textToPm.set(textOffset, pos);
|
|
58
|
-
pmToText.set(pos, textOffset);
|
|
59
|
-
textOffset += 1;
|
|
60
|
-
}
|
|
61
|
-
if (node.isText && node.text) {
|
|
62
|
-
for (let i = 0; i < node.text.length; i++) {
|
|
63
|
-
textToPm.set(textOffset + i, pos + i);
|
|
64
|
-
pmToText.set(pos + i, textOffset + i);
|
|
65
|
-
}
|
|
66
|
-
textOffset += node.text.length;
|
|
67
|
-
// Map the exclusive end position (for slice semantics)
|
|
68
|
-
// This ensures textOffsetToProseMirrorPosition works for end-of-quote offsets
|
|
69
|
-
textToPm.set(textOffset, pos + node.text.length);
|
|
70
|
-
pmToText.set(pos + node.text.length, textOffset);
|
|
71
|
-
hasEmittedContent = true;
|
|
72
|
-
}
|
|
73
|
-
else if (node.isLeaf && !node.isText) {
|
|
74
|
-
// Atom nodes (images, hard breaks, etc.)
|
|
75
|
-
// textBetween uses leafText spec or empty string
|
|
76
|
-
const leafText = node.type.spec.leafText?.(node) ?? '';
|
|
77
|
-
if (leafText.length > 0) {
|
|
78
|
-
for (let i = 0; i < leafText.length; i++) {
|
|
79
|
-
textToPm.set(textOffset + i, pos);
|
|
80
|
-
pmToText.set(pos, textOffset + i);
|
|
81
|
-
}
|
|
82
|
-
textOffset += leafText.length;
|
|
83
|
-
// Map the exclusive end position for leaf nodes too
|
|
84
|
-
textToPm.set(textOffset, pos + 1);
|
|
85
|
-
pmToText.set(pos + 1, textOffset);
|
|
86
|
-
hasEmittedContent = true;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Recurse into children
|
|
90
|
-
// Each node's content starts 1 position after the node's start
|
|
91
|
-
// But for inline content within textblocks, children don't add extra positions
|
|
92
|
-
if (node.isTextblock) {
|
|
93
|
-
// For textblocks (paragraph, heading, code_block), content starts at pos + 1
|
|
94
|
-
const childPos = pos + 1;
|
|
95
|
-
node.forEach((child, offset) => {
|
|
96
|
-
walk(child, childPos + offset);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
else if (!node.isLeaf) {
|
|
100
|
-
// For container blocks (doc, list, blockquote, list_item), content starts at pos + 1
|
|
101
|
-
const childPos = pos + 1;
|
|
102
|
-
node.forEach((child, offset) => {
|
|
103
|
-
walk(child, childPos + offset);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
// Start walking from doc's children
|
|
108
|
-
// Doc's content starts at position 0 (doc has no opening token in positions)
|
|
109
|
-
const docChildPos = 0;
|
|
110
|
-
doc.forEach((child, offset) => {
|
|
111
|
-
walk(child, docChildPos + offset);
|
|
112
|
-
});
|
|
113
|
-
const map = { textToPm, pmToText };
|
|
114
|
-
offsetMapCache.set(doc, map);
|
|
115
|
-
return map;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Convert a text offset (from doc.textBetween()) to a ProseMirror position.
|
|
119
|
-
*
|
|
120
|
-
* @param doc - ProseMirror document node
|
|
121
|
-
* @param offset - Text offset (0-based)
|
|
122
|
-
* @returns ProseMirror position or null if offset not found
|
|
123
|
-
*/
|
|
124
|
-
export function textOffsetToProseMirrorPosition(doc, offset) {
|
|
125
|
-
const map = buildTextToProseMirrorPositionMap(doc);
|
|
126
|
-
return map.textToPm.get(offset) ?? null;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Convert a ProseMirror position to a text offset (as from doc.textBetween()).
|
|
130
|
-
*
|
|
131
|
-
* @param doc - ProseMirror document node
|
|
132
|
-
* @param pos - ProseMirror position
|
|
133
|
-
* @returns Text offset or 0 if position not found
|
|
134
|
-
*/
|
|
135
|
-
export function proseMirrorPositionToTextOffset(doc, pos) {
|
|
136
|
-
const map = buildTextToProseMirrorPositionMap(doc);
|
|
137
|
-
return map.pmToText.get(pos) ?? 0;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Compute line and column from a text offset within the document text.
|
|
141
|
-
*
|
|
142
|
-
* Unlike mapPosToSource (which maps to markdown source positions), this function
|
|
143
|
-
* computes line/column within the document's text content (doc.textBetween semantics).
|
|
144
|
-
* This is useful for originalPosition storage where we want coordinates that match
|
|
145
|
-
* the text offset coordinate system.
|
|
146
|
-
*
|
|
147
|
-
* @param doc - ProseMirror document node
|
|
148
|
-
* @param textOffset - Text offset (0-based, from doc.textBetween)
|
|
149
|
-
* @returns SourcePosition with offset, line, and column
|
|
150
|
-
*/
|
|
151
|
-
export function textOffsetToLineColumn(doc, textOffset) {
|
|
152
|
-
// Extract full document text using textBetween semantics
|
|
153
|
-
const docText = doc.textBetween(0, doc.content.size, '\n');
|
|
154
|
-
// Count lines and columns within the document text
|
|
155
|
-
let line = 1;
|
|
156
|
-
let column = 1;
|
|
157
|
-
const clampedOffset = Math.max(0, Math.min(textOffset, docText.length));
|
|
158
|
-
for (let i = 0; i < clampedOffset; i++) {
|
|
159
|
-
if (docText[i] === '\n') {
|
|
160
|
-
line++;
|
|
161
|
-
column = 1;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
column++;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
offset: clampedOffset,
|
|
169
|
-
line,
|
|
170
|
-
column,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// ============================================================================
|
|
174
|
-
// Markdown Source Position Mapping (Legacy)
|
|
175
|
-
// ============================================================================
|
|
176
|
-
/**
|
|
177
|
-
* Map a ProseMirror position to an mdast source position.
|
|
178
|
-
*
|
|
179
|
-
* This enables persisting selection/anchor positions in a format
|
|
180
|
-
* that survives editor remounts and document changes.
|
|
181
|
-
*
|
|
182
|
-
* @param pmPos - ProseMirror document position
|
|
183
|
-
* @param markdown - Current markdown content
|
|
184
|
-
* @returns Source position or null if mapping fails
|
|
185
|
-
*
|
|
186
|
-
* @remarks
|
|
187
|
-
* This direct mapping is used when the current markdown string is the only
|
|
188
|
-
* available source of truth. Use the ProseMirror document helpers above when
|
|
189
|
-
* mapping from an instantiated editor document.
|
|
190
|
-
*/
|
|
191
|
-
export function mapPosToSource(pmPos, markdown) {
|
|
192
|
-
if (pmPos < 0 || pmPos > markdown.length) {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
// Count lines and columns from the markdown string
|
|
196
|
-
let line = 1;
|
|
197
|
-
let column = 1;
|
|
198
|
-
for (let i = 0; i < pmPos && i < markdown.length; i++) {
|
|
199
|
-
if (markdown[i] === '\n') {
|
|
200
|
-
line++;
|
|
201
|
-
column = 1;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
column++;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
line,
|
|
209
|
-
column,
|
|
210
|
-
offset: pmPos,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Map an mdast source position to a ProseMirror position.
|
|
215
|
-
*
|
|
216
|
-
* This enables jumping to stored positions (comments, suggestions)
|
|
217
|
-
* when the editor loads.
|
|
218
|
-
*
|
|
219
|
-
* @param sourcePos - mdast source position
|
|
220
|
-
* @param markdown - Current markdown content
|
|
221
|
-
* @returns ProseMirror position or null if mapping fails
|
|
222
|
-
*
|
|
223
|
-
* @remarks
|
|
224
|
-
* This direct mapping is used when a stored markdown offset is available. Use
|
|
225
|
-
* the ProseMirror document helpers above when translating through an
|
|
226
|
-
* instantiated editor document.
|
|
227
|
-
*/
|
|
228
|
-
export function mapSourceToPos(sourcePos, markdown) {
|
|
229
|
-
if (sourcePos.offset !== undefined && sourcePos.offset >= 0) {
|
|
230
|
-
return Math.min(sourcePos.offset, markdown.length);
|
|
231
|
-
}
|
|
232
|
-
// Fall back to line/column calculation
|
|
233
|
-
let offset = 0;
|
|
234
|
-
let currentLine = 1;
|
|
235
|
-
for (let i = 0; i < markdown.length; i++) {
|
|
236
|
-
if (currentLine === sourcePos.line) {
|
|
237
|
-
// Found the line, add column offset
|
|
238
|
-
return Math.min(offset + sourcePos.column - 1, markdown.length);
|
|
239
|
-
}
|
|
240
|
-
if (markdown[i] === '\n') {
|
|
241
|
-
currentLine++;
|
|
242
|
-
}
|
|
243
|
-
offset++;
|
|
244
|
-
}
|
|
245
|
-
// Line not found
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Enrich an editor selection with source position information.
|
|
250
|
-
*
|
|
251
|
-
* @param selection - Editor selection state
|
|
252
|
-
* @param markdown - Current markdown content
|
|
253
|
-
* @returns Selection with sourcePosition field populated
|
|
254
|
-
*/
|
|
255
|
-
export function enrichSelectionWithSource(selection, markdown) {
|
|
256
|
-
return {
|
|
257
|
-
...selection,
|
|
258
|
-
sourcePosition: mapPosToSource(selection.from, markdown),
|
|
259
|
-
};
|
|
260
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom clipboard behavior for Milkdown (DEP-45).
|
|
3
|
-
*
|
|
4
|
-
* Paste rules:
|
|
5
|
-
* - **Code (VSCode)**: Detect `vscode-editor-data` and insert a fenced code block (with language if available).
|
|
6
|
-
* - **Markdown**: If clipboard provides `text/markdown` or `text/x-markdown`, parse and insert structured content.
|
|
7
|
-
* - **HTML**: Sanitize (DEP-47) then parse and insert.
|
|
8
|
-
* - **Plain text**: Let the default ProseMirror behavior insert as-is.
|
|
9
|
-
*
|
|
10
|
-
* Copy behavior:
|
|
11
|
-
* - Serialize selection to Markdown via Milkdown serializer
|
|
12
|
-
* - Normalize via DEP-35 `normalize()` before writing to the clipboard
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Milkdown plugin wrapper for the ProseMirror clipboard plugin.
|
|
18
|
-
*/
|
|
19
|
-
export declare const clipboardPlugin: import("./milkdown-plugin-runtime.js").LazyProsePlugin;
|
package/dist/editor/clipboard.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom clipboard behavior for Milkdown (DEP-45).
|
|
3
|
-
*
|
|
4
|
-
* Paste rules:
|
|
5
|
-
* - **Code (VSCode)**: Detect `vscode-editor-data` and insert a fenced code block (with language if available).
|
|
6
|
-
* - **Markdown**: If clipboard provides `text/markdown` or `text/x-markdown`, parse and insert structured content.
|
|
7
|
-
* - **HTML**: Sanitize (DEP-47) then parse and insert.
|
|
8
|
-
* - **Plain text**: Let the default ProseMirror behavior insert as-is.
|
|
9
|
-
*
|
|
10
|
-
* Copy behavior:
|
|
11
|
-
* - Serialize selection to Markdown via Milkdown serializer
|
|
12
|
-
* - Normalize via DEP-35 `normalize()` before writing to the clipboard
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
import { normalize } from '../markdown/pipeline/index.js';
|
|
17
|
-
import { DOMParser, DOMSerializer, } from 'prosemirror-model';
|
|
18
|
-
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state';
|
|
19
|
-
import { createLazyProsePlugin } from './milkdown-plugin-runtime.js';
|
|
20
|
-
import { sanitizeHtml } from './sanitize-html.js';
|
|
21
|
-
function isVscodeClipboardPayload(value) {
|
|
22
|
-
return value !== null && typeof value === 'object';
|
|
23
|
-
}
|
|
24
|
-
function normalizeMarkdownSafely(markdown) {
|
|
25
|
-
try {
|
|
26
|
-
return normalize(markdown);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.warn('Failed to normalize clipboard markdown:', error);
|
|
30
|
-
return markdown;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function getMarkdownFromClipboard(dataTransfer) {
|
|
34
|
-
// Prefer the markdown-specific clipboard types.
|
|
35
|
-
const markdown = dataTransfer.getData('text/markdown') || dataTransfer.getData('text/x-markdown') || '';
|
|
36
|
-
return markdown;
|
|
37
|
-
}
|
|
38
|
-
function getLanguageHintFromVscodeClipboard(dataTransfer) {
|
|
39
|
-
const vscodeData = dataTransfer.getData('vscode-editor-data');
|
|
40
|
-
if (!vscodeData)
|
|
41
|
-
return undefined;
|
|
42
|
-
try {
|
|
43
|
-
const parsed = JSON.parse(vscodeData);
|
|
44
|
-
return isVscodeClipboardPayload(parsed) && typeof parsed.mode === 'string'
|
|
45
|
-
? parsed.mode
|
|
46
|
-
: undefined;
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function getNodeFromSchema(type, schema) {
|
|
53
|
-
const nodeType = schema.nodes[type];
|
|
54
|
-
if (!nodeType) {
|
|
55
|
-
throw new Error(`Missing ProseMirror node type: ${type}`);
|
|
56
|
-
}
|
|
57
|
-
return nodeType;
|
|
58
|
-
}
|
|
59
|
-
function isTextOnlySlice(slice) {
|
|
60
|
-
if (slice.content.childCount !== 1)
|
|
61
|
-
return false;
|
|
62
|
-
const node = slice.content.firstChild;
|
|
63
|
-
if (node?.type.name === 'text' && node.marks.length === 0)
|
|
64
|
-
return node;
|
|
65
|
-
if (node?.type.name === 'paragraph' && node.childCount === 1) {
|
|
66
|
-
const firstChild = node.firstChild;
|
|
67
|
-
if (firstChild?.type.name === 'text' && firstChild.marks.length === 0)
|
|
68
|
-
return firstChild;
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Milkdown plugin wrapper for the ProseMirror clipboard plugin.
|
|
74
|
-
*/
|
|
75
|
-
export const clipboardPlugin = createLazyProsePlugin(async (ctx) => {
|
|
76
|
-
const { editorViewOptionsCtx, parserCtx, schemaCtx, serializerCtx } = await import('@milkdown/kit/core');
|
|
77
|
-
const schema = ctx.get(schemaCtx);
|
|
78
|
-
// Ensure editable prop exists (Milkdown issue workaround).
|
|
79
|
-
ctx.update(editorViewOptionsCtx, (previous) => ({
|
|
80
|
-
...previous,
|
|
81
|
-
editable: previous.editable ?? (() => true),
|
|
82
|
-
}));
|
|
83
|
-
const key = new PluginKey('DEP_45_CLIPBOARD');
|
|
84
|
-
return new Plugin({
|
|
85
|
-
key,
|
|
86
|
-
props: {
|
|
87
|
-
handlePaste: (view, event) => {
|
|
88
|
-
const editable = view.props.editable?.(view.state);
|
|
89
|
-
const { clipboardData } = event;
|
|
90
|
-
if (!editable || !clipboardData)
|
|
91
|
-
return false;
|
|
92
|
-
const currentNode = view.state.selection.$from.node();
|
|
93
|
-
if (currentNode.type.spec.code)
|
|
94
|
-
return false;
|
|
95
|
-
const plainText = clipboardData.getData('text/plain');
|
|
96
|
-
// 1) VSCode paste → code block
|
|
97
|
-
const vscodeEditorData = clipboardData.getData('vscode-editor-data');
|
|
98
|
-
if (vscodeEditorData && plainText) {
|
|
99
|
-
const language = getLanguageHintFromVscodeClipboard(clipboardData);
|
|
100
|
-
const codeBlockType = getNodeFromSchema('code_block', schema);
|
|
101
|
-
const transaction = view.state.tr;
|
|
102
|
-
// Create a code block node, with a language hint if available.
|
|
103
|
-
transaction.replaceSelectionWith(codeBlockType.create({ language }));
|
|
104
|
-
transaction
|
|
105
|
-
.setSelection(TextSelection.near(transaction.doc.resolve(Math.max(0, transaction.selection.from - 2))))
|
|
106
|
-
.insertText(plainText.replace(/\r\n?/g, '\n'));
|
|
107
|
-
view.dispatch(transaction);
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
// 2) Markdown clipboard type → parse and insert
|
|
111
|
-
const markdown = getMarkdownFromClipboard(clipboardData);
|
|
112
|
-
if (markdown) {
|
|
113
|
-
const parser = ctx.get(parserCtx);
|
|
114
|
-
const parsed = parser(markdown);
|
|
115
|
-
if (!parsed || typeof parsed === 'string') {
|
|
116
|
-
// If parsing fails, fall back to inserting as plain text.
|
|
117
|
-
view.dispatch(view.state.tr.insertText(markdown.replace(/\r\n?/g, '\n')));
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
const dom = DOMSerializer.fromSchema(schema).serializeFragment(parsed.content);
|
|
121
|
-
const slice = DOMParser.fromSchema(schema).parseSlice(dom);
|
|
122
|
-
const textOnlyNode = isTextOnlySlice(slice);
|
|
123
|
-
if (textOnlyNode) {
|
|
124
|
-
view.dispatch(view.state.tr.replaceSelectionWith(textOnlyNode, true));
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
view.dispatch(view.state.tr.replaceSelection(slice));
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
// 3) HTML → sanitize then parse and insert
|
|
136
|
-
const html = clipboardData.getData('text/html');
|
|
137
|
-
if (html) {
|
|
138
|
-
const sanitizedHtml = sanitizeHtml(html);
|
|
139
|
-
const template = document.createElement('template');
|
|
140
|
-
template.innerHTML = sanitizedHtml;
|
|
141
|
-
const dom = template.content.cloneNode(true);
|
|
142
|
-
template.remove();
|
|
143
|
-
const slice = DOMParser.fromSchema(schema).parseSlice(dom);
|
|
144
|
-
const textOnlyNode = isTextOnlySlice(slice);
|
|
145
|
-
if (textOnlyNode) {
|
|
146
|
-
view.dispatch(view.state.tr.replaceSelectionWith(textOnlyNode, true));
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
try {
|
|
150
|
-
view.dispatch(view.state.tr.replaceSelection(slice));
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
// If HTML parsing fails, fall back to plain text (safe).
|
|
155
|
-
if (plainText) {
|
|
156
|
-
view.dispatch(view.state.tr.insertText(plainText.replace(/\r\n?/g, '\n')));
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// 4) Plain text → default ProseMirror behavior (insert as-is)
|
|
163
|
-
return false;
|
|
164
|
-
},
|
|
165
|
-
clipboardTextSerializer: (slice) => {
|
|
166
|
-
const serializer = ctx.get(serializerCtx);
|
|
167
|
-
// Try to serialize as a valid doc node first.
|
|
168
|
-
let doc = schema.topNodeType.createAndFill(undefined, slice.content);
|
|
169
|
-
// If the slice is inline-only (common for partial selections), wrap it in a paragraph.
|
|
170
|
-
if (!doc) {
|
|
171
|
-
const paragraphType = schema.nodes['paragraph'];
|
|
172
|
-
if (paragraphType) {
|
|
173
|
-
const paragraph = paragraphType.createAndFill(undefined, slice.content);
|
|
174
|
-
if (paragraph) {
|
|
175
|
-
doc = schema.topNodeType.createAndFill(undefined, paragraph);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
// Fallback to plain text if we can't build a valid document.
|
|
180
|
-
if (!doc) {
|
|
181
|
-
const plain = slice.content.textBetween(0, slice.content.size, '\n\n');
|
|
182
|
-
return normalizeMarkdownSafely(plain);
|
|
183
|
-
}
|
|
184
|
-
const markdown = serializer(doc);
|
|
185
|
-
return normalizeMarkdownSafely(markdown);
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
});
|
|
189
|
-
});
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command registry for the Milkdown editor.
|
|
3
|
-
*
|
|
4
|
-
* This module provides functions to execute editor commands and query editor state.
|
|
5
|
-
* Used by the toolbar and keyboard shortcuts.
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: Uses Milkdown's command system (callCommand) to ensure
|
|
8
|
-
* commands respect Milkdown contexts and work correctly.
|
|
9
|
-
*/
|
|
10
|
-
import type { CmdKey } from '@milkdown/kit/core';
|
|
11
|
-
import type { Ctx } from '@milkdown/kit/ctx';
|
|
12
|
-
import type { MarkType } from '@milkdown/kit/prose/model';
|
|
13
|
-
import type { EditorView } from '@milkdown/kit/prose/view';
|
|
14
|
-
/** Load Milkdown command modules before synchronous command handlers run. */
|
|
15
|
-
export declare function preloadCommandRuntime(): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Active marks at the current selection.
|
|
18
|
-
*/
|
|
19
|
-
export interface ActiveMarks {
|
|
20
|
-
bold: boolean;
|
|
21
|
-
italic: boolean;
|
|
22
|
-
code: boolean;
|
|
23
|
-
strikethrough: boolean;
|
|
24
|
-
link: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Current block type at the selection.
|
|
28
|
-
*
|
|
29
|
-
* Uses a discriminated union to ensure type safety - you can't have
|
|
30
|
-
* a paragraph with a headingLevel or a blockquote with a listType.
|
|
31
|
-
*/
|
|
32
|
-
export type ActiveBlockType = {
|
|
33
|
-
type: 'paragraph';
|
|
34
|
-
} | {
|
|
35
|
-
type: 'heading';
|
|
36
|
-
headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
37
|
-
} | {
|
|
38
|
-
type: 'blockquote';
|
|
39
|
-
} | {
|
|
40
|
-
type: 'codeBlock';
|
|
41
|
-
} | {
|
|
42
|
-
type: 'listItem';
|
|
43
|
-
listType?: 'bullet' | 'ordered' | 'task';
|
|
44
|
-
} | {
|
|
45
|
-
type: 'unknown';
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Run a Milkdown command and refocus the editor.
|
|
49
|
-
*/
|
|
50
|
-
export declare function runCommand<T>(ctx: Ctx, commandKey: CmdKey<T> | string, payload?: T): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Toggle bold (strong) mark on the current selection.
|
|
53
|
-
*/
|
|
54
|
-
export declare function toggleBold(ctx: Ctx): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Toggle italic (emphasis) mark on the current selection.
|
|
57
|
-
*/
|
|
58
|
-
export declare function toggleItalic(ctx: Ctx): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Toggle inline code mark on the current selection.
|
|
61
|
-
*/
|
|
62
|
-
export declare function toggleCode(ctx: Ctx): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Toggle strikethrough mark on the current selection.
|
|
65
|
-
*/
|
|
66
|
-
export declare function toggleStrikethrough(ctx: Ctx): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Set the current block to a heading at the specified level.
|
|
69
|
-
*/
|
|
70
|
-
export declare function setHeading(ctx: Ctx, level: 1 | 2 | 3 | 4 | 5 | 6): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Convert the current block to a paragraph (remove heading/list/etc).
|
|
73
|
-
*/
|
|
74
|
-
export declare function setParagraph(ctx: Ctx): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Toggle bullet list on the current block.
|
|
77
|
-
*/
|
|
78
|
-
export declare function toggleBulletList(ctx: Ctx): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Toggle ordered list on the current block.
|
|
81
|
-
*/
|
|
82
|
-
export declare function toggleOrderedList(ctx: Ctx): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Toggle blockquote on the current block.
|
|
85
|
-
*/
|
|
86
|
-
export declare function toggleBlockquote(ctx: Ctx): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Indent a list item (sink).
|
|
89
|
-
*/
|
|
90
|
-
export declare function indentListItem(ctx: Ctx): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Outdent a list item (lift).
|
|
93
|
-
*/
|
|
94
|
-
export declare function outdentListItem(ctx: Ctx): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Insert a horizontal rule.
|
|
97
|
-
*/
|
|
98
|
-
export declare function insertHorizontalRule(ctx: Ctx): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Undo the last action.
|
|
101
|
-
*/
|
|
102
|
-
export declare function undo(ctx: Ctx): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Redo the last undone action.
|
|
105
|
-
*/
|
|
106
|
-
export declare function redo(ctx: Ctx): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Insert a link at the current cursor position (when no selection).
|
|
109
|
-
* This inserts text and applies the link mark in a single transaction.
|
|
110
|
-
*/
|
|
111
|
-
export declare function insertLinkAtCursor(ctx: Ctx, text: string, url: string): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Apply a link mark to the current selection.
|
|
114
|
-
*/
|
|
115
|
-
export declare function applyLinkToSelection(ctx: Ctx, url: string): boolean;
|
|
116
|
-
/**
|
|
117
|
-
* Update an existing link at the cursor position.
|
|
118
|
-
* Replaces the text and URL of the link the cursor is inside.
|
|
119
|
-
* Used when editing a link (cursor inside link, no selection).
|
|
120
|
-
*/
|
|
121
|
-
export declare function updateLinkAtCursor(ctx: Ctx, text: string, url: string): boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Remove link mark from the current selection or a specified range.
|
|
124
|
-
*
|
|
125
|
-
* @param ctx - Milkdown editor context
|
|
126
|
-
* @param range - Optional pre-computed range [from, to] to remove link from.
|
|
127
|
-
* If not provided, uses current selection (or finds link at cursor).
|
|
128
|
-
* Pass this when the editor may have lost focus (e.g., popover interactions).
|
|
129
|
-
*/
|
|
130
|
-
export declare function removeLink(ctx: Ctx, range?: [number, number]): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Get the link URL at the current cursor position, if any.
|
|
133
|
-
*/
|
|
134
|
-
export declare function getLinkAtCursor(ctx: Ctx): string | null;
|
|
135
|
-
/**
|
|
136
|
-
* Get the link text at the current cursor position, if cursor is inside a link.
|
|
137
|
-
* Returns the full link text even when selection is collapsed.
|
|
138
|
-
*/
|
|
139
|
-
export declare function getLinkTextAtCursor(ctx: Ctx): string | null;
|
|
140
|
-
/**
|
|
141
|
-
* Get the link range at the current cursor position.
|
|
142
|
-
* Returns [from, to] if cursor is inside a link, null otherwise.
|
|
143
|
-
*
|
|
144
|
-
* Use this to capture the link range before focus leaves the editor
|
|
145
|
-
* (e.g., when opening a popover), then pass the range to removeLink.
|
|
146
|
-
*/
|
|
147
|
-
export declare function getLinkRangeAtCursor(ctx: Ctx): [number, number] | null;
|
|
148
|
-
/**
|
|
149
|
-
* Check if a mark type is active at the current selection.
|
|
150
|
-
*/
|
|
151
|
-
export declare function isMarkActive(view: EditorView, markType: MarkType): boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Get all active marks at the current selection.
|
|
154
|
-
*/
|
|
155
|
-
export declare function getActiveMarks(ctx: Ctx): ActiveMarks;
|
|
156
|
-
/**
|
|
157
|
-
* Get the active block type at the current selection.
|
|
158
|
-
*/
|
|
159
|
-
export declare function getActiveBlockType(ctx: Ctx): ActiveBlockType;
|
|
160
|
-
/**
|
|
161
|
-
* Check if the current selection is collapsed (cursor only, no selection).
|
|
162
|
-
*/
|
|
163
|
-
export declare function isSelectionCollapsed(ctx: Ctx): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Get the selected text, if any.
|
|
166
|
-
*/
|
|
167
|
-
export declare function getSelectedText(ctx: Ctx): string;
|