@lostgradient/cinder 0.16.1 → 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 +185 -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/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/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 +15347 -16138
- 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 +2 -2
- 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 +2 -2
- 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 +105 -115
- package/dist/server/{index.server-7yfz2t73.js → index.server-003t81xk.js} +1 -1
- package/dist/server/{index.server-gwgm8gqg.js → index.server-032p855q.js} +4 -4
- 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-wasj5rbh.js → index.server-q5gvb174.js} +4 -4
- 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-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/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-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
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comment and thread types for the Markdown Review Editor.
|
|
3
|
-
*
|
|
4
|
-
* These types support:
|
|
5
|
-
* - TextQuoteSelector-style anchoring (survives edits via quote + context)
|
|
6
|
-
* - Runtime position tracking (ProseMirror positions)
|
|
7
|
-
* - Serialization for persistence
|
|
8
|
-
*
|
|
9
|
-
* Threads have no lifecycle status - they exist until deleted.
|
|
10
|
-
* When anchor text is deleted, threads are automatically removed.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
|
-
import type { PersistedReviewSession } from '../session/types.js';
|
|
15
|
-
import type { AnchorStatus, CommentAnchor, PersistedAnchor, TextQuoteAnchor } from '../shared/anchor-types.js';
|
|
16
|
-
export type { AnchorStatus, AnchorType, CommentAnchor, PersistedAnchor, RuntimeAnchor, TextQuoteAnchor, } from '../shared/anchor-types.js';
|
|
17
|
-
/**
|
|
18
|
-
* A single comment within a thread.
|
|
19
|
-
*/
|
|
20
|
-
export interface Comment {
|
|
21
|
-
/** Unique identifier */
|
|
22
|
-
id: string;
|
|
23
|
-
/** Parent thread ID */
|
|
24
|
-
threadId: string;
|
|
25
|
-
/** Author user ID */
|
|
26
|
-
authorId: string;
|
|
27
|
-
/** Comment content (Markdown) */
|
|
28
|
-
body: string;
|
|
29
|
-
/** Creation timestamp (ISO 8601) */
|
|
30
|
-
createdAt: string;
|
|
31
|
-
/** Last edit timestamp (ISO 8601), if edited */
|
|
32
|
-
editedAt?: string | undefined;
|
|
33
|
-
/** User IDs mentioned in the comment */
|
|
34
|
-
mentions?: string[] | undefined;
|
|
35
|
-
/** Soft delete timestamp (ISO 8601), if deleted */
|
|
36
|
-
deletedAt?: string | undefined;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Input for creating a new comment.
|
|
40
|
-
*/
|
|
41
|
-
export type CreateCommentInput = Pick<Comment, 'body' | 'authorId'> & {
|
|
42
|
-
mentions?: string[];
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Input for updating an existing comment.
|
|
46
|
-
*/
|
|
47
|
-
export type UpdateCommentInput = Pick<Comment, 'body'> & {
|
|
48
|
-
mentions?: string[];
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* A comment thread anchored to a document location.
|
|
52
|
-
*
|
|
53
|
-
* Threads have no status - they exist until deleted.
|
|
54
|
-
* There is no "resolved" state; to dismiss a thread, delete it.
|
|
55
|
-
*/
|
|
56
|
-
export interface Thread {
|
|
57
|
-
/** Unique identifier */
|
|
58
|
-
id: string;
|
|
59
|
-
/** Anchor to document location */
|
|
60
|
-
anchor: CommentAnchor;
|
|
61
|
-
/** Comments in chronological order */
|
|
62
|
-
comments: Comment[];
|
|
63
|
-
/** Creation timestamp (ISO 8601) */
|
|
64
|
-
createdAt: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Thread data for persistence (uses persisted anchor).
|
|
68
|
-
*/
|
|
69
|
-
export interface PersistedThread extends Omit<Thread, 'anchor'> {
|
|
70
|
-
anchor: PersistedAnchor;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Input for creating a new thread.
|
|
74
|
-
*/
|
|
75
|
-
export interface CreateThreadInput {
|
|
76
|
-
/** Anchor location */
|
|
77
|
-
anchor: CommentAnchor;
|
|
78
|
-
/** Initial comment */
|
|
79
|
-
initialComment: CreateCommentInput;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Complete review state for serialization.
|
|
83
|
-
*
|
|
84
|
-
* This is the top-level type for persisting and hydrating review sessions.
|
|
85
|
-
*
|
|
86
|
-
* Schema versions:
|
|
87
|
-
* - v1: Original schema (DEP-39)
|
|
88
|
-
* - v2: Added soft-delete support (DEP-40)
|
|
89
|
-
* - v3: Reserved (previously suggestions)
|
|
90
|
-
* - v4: Added reviewSession for batch review submission (DEP-44), front matter support (DEP-61)
|
|
91
|
-
*/
|
|
92
|
-
export interface ReviewState {
|
|
93
|
-
/** Schema version for migrations (all versions are additive, no breaking changes) */
|
|
94
|
-
schemaVersion: 1 | 2 | 3 | 4;
|
|
95
|
-
/** Current document content as full Markdown, including front matter when present */
|
|
96
|
-
content: string;
|
|
97
|
-
/** Original/baseline content for diff comparison */
|
|
98
|
-
original?: string | undefined;
|
|
99
|
-
/** All threads in the review (includes soft-deleted comments for audit trail) */
|
|
100
|
-
threads: PersistedThread[];
|
|
101
|
-
/**
|
|
102
|
-
* Review session for batch submission mode (v4+).
|
|
103
|
-
* Contains draft comments that are submitted as a batch
|
|
104
|
-
* with a review outcome (approve / request changes / comment-only).
|
|
105
|
-
* When undefined or missing, treated as no active session for backwards compatibility.
|
|
106
|
-
*/
|
|
107
|
-
reviewSession?: PersistedReviewSession | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* Parsed front matter data (v4+).
|
|
110
|
-
* When undefined or null, document has no front matter.
|
|
111
|
-
*/
|
|
112
|
-
frontMatter?: Record<string, unknown> | null | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Raw front matter YAML string without delimiters (v4+).
|
|
115
|
-
* Preserved for round-trip fidelity when data is unchanged.
|
|
116
|
-
*/
|
|
117
|
-
frontMatterRaw?: string | null | undefined;
|
|
118
|
-
/** Last modified timestamp (ISO 8601) */
|
|
119
|
-
updatedAt: string;
|
|
120
|
-
}
|
|
121
|
-
export type { PersistedReviewSession } from '../session/types.js';
|
|
122
|
-
/**
|
|
123
|
-
* Event payload when a new thread is created.
|
|
124
|
-
* Parent uses requestId to correlate optimistic updates with backend responses.
|
|
125
|
-
*/
|
|
126
|
-
export interface ThreadCreateEvent {
|
|
127
|
-
/** Unique request ID for correlating optimistic updates */
|
|
128
|
-
requestId: string;
|
|
129
|
-
/** The anchor where the thread was created */
|
|
130
|
-
anchor: CommentAnchor;
|
|
131
|
-
/** The initial comment body */
|
|
132
|
-
body: string;
|
|
133
|
-
/** The author ID */
|
|
134
|
-
authorId: string;
|
|
135
|
-
/** User IDs mentioned in the initial comment */
|
|
136
|
-
mentions?: string[] | undefined;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Event payload when a thread is deleted.
|
|
140
|
-
*/
|
|
141
|
-
export interface ThreadDeleteEvent {
|
|
142
|
-
/** The thread ID being deleted */
|
|
143
|
-
threadId: string;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Event payload when a comment is added to an existing thread.
|
|
147
|
-
* Parent uses requestId to correlate optimistic updates with backend responses.
|
|
148
|
-
*/
|
|
149
|
-
export interface CommentCreateEvent {
|
|
150
|
-
/** Unique request ID for correlating optimistic updates */
|
|
151
|
-
requestId: string;
|
|
152
|
-
/** The thread ID receiving the comment */
|
|
153
|
-
threadId: string;
|
|
154
|
-
/** The comment body */
|
|
155
|
-
body: string;
|
|
156
|
-
/** The author ID */
|
|
157
|
-
authorId: string;
|
|
158
|
-
/** User IDs mentioned in the comment */
|
|
159
|
-
mentions?: string[] | undefined;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Event payload when a comment is updated.
|
|
163
|
-
*/
|
|
164
|
-
export interface CommentUpdateEvent {
|
|
165
|
-
/** The thread ID containing the comment */
|
|
166
|
-
threadId: string;
|
|
167
|
-
/** The comment ID being updated */
|
|
168
|
-
commentId: string;
|
|
169
|
-
/** The new comment body */
|
|
170
|
-
body: string;
|
|
171
|
-
/** User IDs mentioned in the updated comment */
|
|
172
|
-
mentions?: string[] | undefined;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Event payload when a comment is deleted.
|
|
176
|
-
*/
|
|
177
|
-
export interface CommentDeleteEvent {
|
|
178
|
-
/** The thread ID containing the comment */
|
|
179
|
-
threadId: string;
|
|
180
|
-
/** The comment ID being deleted */
|
|
181
|
-
commentId: string;
|
|
182
|
-
/** True for soft delete (sets deletedAt), false for hard delete */
|
|
183
|
-
soft: boolean;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Update payload from anchor plugin to ReviewEditor.
|
|
187
|
-
* Sent when anchor positions or status change due to document edits.
|
|
188
|
-
*/
|
|
189
|
-
export interface AnchorUpdate {
|
|
190
|
-
/** Thread ID this update is for */
|
|
191
|
-
threadId: string;
|
|
192
|
-
/** New ProseMirror start position */
|
|
193
|
-
from: number;
|
|
194
|
-
/** New ProseMirror end position */
|
|
195
|
-
to: number;
|
|
196
|
-
/** Updated quote text (follows edits inside the anchor) */
|
|
197
|
-
quote: string;
|
|
198
|
-
/** Updated prefix context */
|
|
199
|
-
prefix: string;
|
|
200
|
-
/** Updated suffix context */
|
|
201
|
-
suffix: string;
|
|
202
|
-
/** Current anchor status */
|
|
203
|
-
status: AnchorStatus;
|
|
204
|
-
/** Updated text offset for disambiguation */
|
|
205
|
-
lastKnownOffset?: number;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Result of re-anchoring a quote in a document.
|
|
209
|
-
* Returned by the reanchorQuote algorithm.
|
|
210
|
-
*
|
|
211
|
-
* When `found` is false, the quote could not be located in the document
|
|
212
|
-
* and the thread should be deleted.
|
|
213
|
-
*/
|
|
214
|
-
export interface ReanchorResult {
|
|
215
|
-
/** Whether the quote was found in the document */
|
|
216
|
-
found: boolean;
|
|
217
|
-
/** Text offset of anchor start (in doc.textBetween() coordinates). Only valid when found=true. */
|
|
218
|
-
from: number;
|
|
219
|
-
/** Text offset of anchor end (in doc.textBetween() coordinates). Only valid when found=true. */
|
|
220
|
-
to: number;
|
|
221
|
-
/** Confidence score (0-1) of the match. 0 when not found. */
|
|
222
|
-
confidence: number;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Generate a unique ID for threads and comments.
|
|
226
|
-
* Uses crypto.randomUUID() when available, falls back to timestamp + random.
|
|
227
|
-
*/
|
|
228
|
-
export declare function generateId(): string;
|
|
229
|
-
/**
|
|
230
|
-
* Get current ISO timestamp.
|
|
231
|
-
*/
|
|
232
|
-
export declare function timestamp(): string;
|
|
233
|
-
/**
|
|
234
|
-
* Context length for TextQuoteSelector prefix/suffix.
|
|
235
|
-
*/
|
|
236
|
-
export declare const ANCHOR_CONTEXT_LENGTH = 50;
|
|
237
|
-
/**
|
|
238
|
-
* Create a TextQuoteAnchor from a selection.
|
|
239
|
-
*
|
|
240
|
-
* @param quote - The selected text
|
|
241
|
-
* @param documentText - The full document text
|
|
242
|
-
* @param startOffset - Character offset of selection start
|
|
243
|
-
* @param endOffset - Character offset of selection end
|
|
244
|
-
*/
|
|
245
|
-
export declare function createTextQuoteAnchor(quote: string, documentText: string, startOffset: number, endOffset: number): TextQuoteAnchor;
|
|
246
|
-
/**
|
|
247
|
-
* Create a document-level anchor (not anchored to specific text).
|
|
248
|
-
*
|
|
249
|
-
* Document-level comments are for general feedback about the entire document,
|
|
250
|
-
* not tied to a specific text selection.
|
|
251
|
-
*/
|
|
252
|
-
export declare function createDocumentAnchor(): CommentAnchor;
|
|
253
|
-
/**
|
|
254
|
-
* Check if an anchor is a document-level anchor.
|
|
255
|
-
*/
|
|
256
|
-
export declare function isDocumentAnchor(anchor: CommentAnchor | PersistedAnchor): boolean;
|
|
257
|
-
/**
|
|
258
|
-
* Check if an anchor is a text anchor (explicit 'text' type or undefined for backwards compat).
|
|
259
|
-
*/
|
|
260
|
-
export declare function isTextAnchor(anchor: CommentAnchor | PersistedAnchor): boolean;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comment and thread types for the Markdown Review Editor.
|
|
3
|
-
*
|
|
4
|
-
* These types support:
|
|
5
|
-
* - TextQuoteSelector-style anchoring (survives edits via quote + context)
|
|
6
|
-
* - Runtime position tracking (ProseMirror positions)
|
|
7
|
-
* - Serialization for persistence
|
|
8
|
-
*
|
|
9
|
-
* Threads have no lifecycle status - they exist until deleted.
|
|
10
|
-
* When anchor text is deleted, threads are automatically removed.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
|
-
// ============================================================================
|
|
15
|
-
// Utility Types
|
|
16
|
-
// ============================================================================
|
|
17
|
-
/**
|
|
18
|
-
* Generate a unique ID for threads and comments.
|
|
19
|
-
* Uses crypto.randomUUID() when available, falls back to timestamp + random.
|
|
20
|
-
*/
|
|
21
|
-
export function generateId() {
|
|
22
|
-
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
23
|
-
return crypto.randomUUID();
|
|
24
|
-
}
|
|
25
|
-
// Fallback for environments without crypto.randomUUID
|
|
26
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get current ISO timestamp.
|
|
30
|
-
*/
|
|
31
|
-
export function timestamp() {
|
|
32
|
-
return new Date().toISOString();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Context length for TextQuoteSelector prefix/suffix.
|
|
36
|
-
*/
|
|
37
|
-
export const ANCHOR_CONTEXT_LENGTH = 50;
|
|
38
|
-
/**
|
|
39
|
-
* Create a TextQuoteAnchor from a selection.
|
|
40
|
-
*
|
|
41
|
-
* @param quote - The selected text
|
|
42
|
-
* @param documentText - The full document text
|
|
43
|
-
* @param startOffset - Character offset of selection start
|
|
44
|
-
* @param endOffset - Character offset of selection end
|
|
45
|
-
*/
|
|
46
|
-
export function createTextQuoteAnchor(quote, documentText, startOffset, endOffset) {
|
|
47
|
-
const prefixStart = Math.max(0, startOffset - ANCHOR_CONTEXT_LENGTH);
|
|
48
|
-
const suffixEnd = Math.min(documentText.length, endOffset + ANCHOR_CONTEXT_LENGTH);
|
|
49
|
-
return {
|
|
50
|
-
quote,
|
|
51
|
-
prefix: documentText.slice(prefixStart, startOffset),
|
|
52
|
-
suffix: documentText.slice(endOffset, suffixEnd),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Create a document-level anchor (not anchored to specific text).
|
|
57
|
-
*
|
|
58
|
-
* Document-level comments are for general feedback about the entire document,
|
|
59
|
-
* not tied to a specific text selection.
|
|
60
|
-
*/
|
|
61
|
-
export function createDocumentAnchor() {
|
|
62
|
-
return {
|
|
63
|
-
type: 'document',
|
|
64
|
-
quote: '',
|
|
65
|
-
prefix: '',
|
|
66
|
-
suffix: '',
|
|
67
|
-
from: 0,
|
|
68
|
-
to: 0,
|
|
69
|
-
status: 'anchored',
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Check if an anchor is a document-level anchor.
|
|
74
|
-
*/
|
|
75
|
-
export function isDocumentAnchor(anchor) {
|
|
76
|
-
return anchor.type === 'document';
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Check if an anchor is a text anchor (explicit 'text' type or undefined for backwards compat).
|
|
80
|
-
*/
|
|
81
|
-
export function isTextAnchor(anchor) {
|
|
82
|
-
return anchor.type === 'text' || anchor.type === undefined;
|
|
83
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure update helpers for thread and comment state management.
|
|
3
|
-
*
|
|
4
|
-
* All functions are pure (no side effects, no ID/timestamp generation).
|
|
5
|
-
* They return new arrays/objects for Svelte 5 reactivity.
|
|
6
|
-
* The `changed` flag indicates whether the operation had any effect.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import type { Comment, Thread } from './types.js';
|
|
11
|
-
/**
|
|
12
|
-
* Result of an update operation.
|
|
13
|
-
* @template T - Optional value type returned with the result
|
|
14
|
-
*/
|
|
15
|
-
export type UpdateResult<T = undefined> = {
|
|
16
|
-
/** The updated threads array */
|
|
17
|
-
threads: Thread[];
|
|
18
|
-
/** Whether the operation made any changes */
|
|
19
|
-
changed: boolean;
|
|
20
|
-
/** Optional value from the operation (e.g., created comment) */
|
|
21
|
-
value?: T;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Check if a comment is visible (not soft-deleted).
|
|
25
|
-
*/
|
|
26
|
-
export declare function isCommentVisible(comment: Comment): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Get visible (non-deleted) comments from a thread.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getVisibleComments(thread: Thread): Comment[];
|
|
31
|
-
/**
|
|
32
|
-
* Add a new thread to the threads array.
|
|
33
|
-
*
|
|
34
|
-
* @param threads - Current threads array
|
|
35
|
-
* @param thread - The thread to add (caller provides complete Thread with ID/timestamps)
|
|
36
|
-
*/
|
|
37
|
-
export declare function addThread(threads: Thread[], thread: Thread): UpdateResult;
|
|
38
|
-
/**
|
|
39
|
-
* Delete a thread from the threads array.
|
|
40
|
-
*
|
|
41
|
-
* No-op if thread does not exist.
|
|
42
|
-
*
|
|
43
|
-
* @param threads - Current threads array
|
|
44
|
-
* @param threadId - ID of the thread to delete
|
|
45
|
-
*/
|
|
46
|
-
export declare function deleteThread(threads: Thread[], threadId: string): UpdateResult;
|
|
47
|
-
/**
|
|
48
|
-
* Add a comment to an existing thread.
|
|
49
|
-
*
|
|
50
|
-
* No-op if thread does not exist.
|
|
51
|
-
*
|
|
52
|
-
* @param threads - Current threads array
|
|
53
|
-
* @param threadId - ID of the thread to add the comment to
|
|
54
|
-
* @param comment - The comment to add (caller provides complete Comment with ID/timestamps)
|
|
55
|
-
*/
|
|
56
|
-
export declare function addComment(threads: Thread[], threadId: string, comment: Comment): UpdateResult<{
|
|
57
|
-
comment: Comment;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Update an existing comment's body and mentions.
|
|
61
|
-
*
|
|
62
|
-
* No-op if thread/comment does not exist or comment is deleted.
|
|
63
|
-
*
|
|
64
|
-
* @param threads - Current threads array
|
|
65
|
-
* @param threadId - ID of the thread containing the comment
|
|
66
|
-
* @param commentId - ID of the comment to update
|
|
67
|
-
* @param update - The update with body, mentions, and editedAt (caller provides timestamp)
|
|
68
|
-
*/
|
|
69
|
-
export declare function updateComment(threads: Thread[], threadId: string, commentId: string, update: {
|
|
70
|
-
body: string;
|
|
71
|
-
mentions?: string[];
|
|
72
|
-
editedAt: string;
|
|
73
|
-
}): UpdateResult;
|
|
74
|
-
/**
|
|
75
|
-
* Delete a comment from a thread.
|
|
76
|
-
*
|
|
77
|
-
* Soft delete sets deletedAt timestamp.
|
|
78
|
-
* Hard delete removes the comment from the array.
|
|
79
|
-
*
|
|
80
|
-
* No-op if thread/comment does not exist, or if soft-deleting an already deleted comment.
|
|
81
|
-
*
|
|
82
|
-
* @param threads - Current threads array
|
|
83
|
-
* @param threadId - ID of the thread containing the comment
|
|
84
|
-
* @param commentId - ID of the comment to delete
|
|
85
|
-
* @param options - Delete options with soft flag and deletedAt timestamp (for soft delete)
|
|
86
|
-
*/
|
|
87
|
-
export declare function deleteComment(threads: Thread[], threadId: string, commentId: string, options: {
|
|
88
|
-
soft: boolean;
|
|
89
|
-
deletedAt?: string;
|
|
90
|
-
}): UpdateResult;
|
|
91
|
-
/**
|
|
92
|
-
* Restore a soft-deleted comment.
|
|
93
|
-
*
|
|
94
|
-
* Removes the deletedAt timestamp.
|
|
95
|
-
*
|
|
96
|
-
* No-op if thread/comment does not exist or comment is not deleted.
|
|
97
|
-
*
|
|
98
|
-
* @param threads - Current threads array
|
|
99
|
-
* @param threadId - ID of the thread containing the comment
|
|
100
|
-
* @param commentId - ID of the comment to restore
|
|
101
|
-
*/
|
|
102
|
-
export declare function restoreComment(threads: Thread[], threadId: string, commentId: string): UpdateResult;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure update helpers for thread and comment state management.
|
|
3
|
-
*
|
|
4
|
-
* All functions are pure (no side effects, no ID/timestamp generation).
|
|
5
|
-
* They return new arrays/objects for Svelte 5 reactivity.
|
|
6
|
-
* The `changed` flag indicates whether the operation had any effect.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
// ============================================================================
|
|
11
|
-
// Visibility Helpers
|
|
12
|
-
// ============================================================================
|
|
13
|
-
/**
|
|
14
|
-
* Check if a comment is visible (not soft-deleted).
|
|
15
|
-
*/
|
|
16
|
-
export function isCommentVisible(comment) {
|
|
17
|
-
return !comment.deletedAt;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get visible (non-deleted) comments from a thread.
|
|
21
|
-
*/
|
|
22
|
-
export function getVisibleComments(thread) {
|
|
23
|
-
return thread.comments.filter(isCommentVisible);
|
|
24
|
-
}
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Thread Operations
|
|
27
|
-
// ============================================================================
|
|
28
|
-
/**
|
|
29
|
-
* Add a new thread to the threads array.
|
|
30
|
-
*
|
|
31
|
-
* @param threads - Current threads array
|
|
32
|
-
* @param thread - The thread to add (caller provides complete Thread with ID/timestamps)
|
|
33
|
-
*/
|
|
34
|
-
export function addThread(threads, thread) {
|
|
35
|
-
return {
|
|
36
|
-
threads: [...threads, thread],
|
|
37
|
-
changed: true,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Delete a thread from the threads array.
|
|
42
|
-
*
|
|
43
|
-
* No-op if thread does not exist.
|
|
44
|
-
*
|
|
45
|
-
* @param threads - Current threads array
|
|
46
|
-
* @param threadId - ID of the thread to delete
|
|
47
|
-
*/
|
|
48
|
-
export function deleteThread(threads, threadId) {
|
|
49
|
-
const exists = threads.some((t) => t.id === threadId);
|
|
50
|
-
if (!exists) {
|
|
51
|
-
return { threads, changed: false };
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
threads: threads.filter((t) => t.id !== threadId),
|
|
55
|
-
changed: true,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// ============================================================================
|
|
59
|
-
// Comment Operations
|
|
60
|
-
// ============================================================================
|
|
61
|
-
/**
|
|
62
|
-
* Add a comment to an existing thread.
|
|
63
|
-
*
|
|
64
|
-
* No-op if thread does not exist.
|
|
65
|
-
*
|
|
66
|
-
* @param threads - Current threads array
|
|
67
|
-
* @param threadId - ID of the thread to add the comment to
|
|
68
|
-
* @param comment - The comment to add (caller provides complete Comment with ID/timestamps)
|
|
69
|
-
*/
|
|
70
|
-
export function addComment(threads, threadId, comment) {
|
|
71
|
-
const exists = threads.some((t) => t.id === threadId);
|
|
72
|
-
if (!exists) {
|
|
73
|
-
return { threads, changed: false };
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
threads: threads.map((thread) => {
|
|
77
|
-
if (thread.id !== threadId)
|
|
78
|
-
return thread;
|
|
79
|
-
return {
|
|
80
|
-
...thread,
|
|
81
|
-
comments: [...thread.comments, comment],
|
|
82
|
-
};
|
|
83
|
-
}),
|
|
84
|
-
changed: true,
|
|
85
|
-
value: { comment },
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Update an existing comment's body and mentions.
|
|
90
|
-
*
|
|
91
|
-
* No-op if thread/comment does not exist or comment is deleted.
|
|
92
|
-
*
|
|
93
|
-
* @param threads - Current threads array
|
|
94
|
-
* @param threadId - ID of the thread containing the comment
|
|
95
|
-
* @param commentId - ID of the comment to update
|
|
96
|
-
* @param update - The update with body, mentions, and editedAt (caller provides timestamp)
|
|
97
|
-
*/
|
|
98
|
-
export function updateComment(threads, threadId, commentId, update) {
|
|
99
|
-
const thread = threads.find((t) => t.id === threadId);
|
|
100
|
-
if (!thread) {
|
|
101
|
-
return { threads, changed: false };
|
|
102
|
-
}
|
|
103
|
-
const comment = thread.comments.find((c) => c.id === commentId);
|
|
104
|
-
if (!comment || comment.deletedAt) {
|
|
105
|
-
return { threads, changed: false };
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
threads: threads.map((t) => {
|
|
109
|
-
if (t.id !== threadId)
|
|
110
|
-
return t;
|
|
111
|
-
return {
|
|
112
|
-
...t,
|
|
113
|
-
comments: t.comments.map((c) => {
|
|
114
|
-
if (c.id !== commentId)
|
|
115
|
-
return c;
|
|
116
|
-
const updatedComment = {
|
|
117
|
-
...c,
|
|
118
|
-
body: update.body,
|
|
119
|
-
editedAt: update.editedAt,
|
|
120
|
-
};
|
|
121
|
-
if (update.mentions !== undefined) {
|
|
122
|
-
updatedComment.mentions = update.mentions;
|
|
123
|
-
}
|
|
124
|
-
return updatedComment;
|
|
125
|
-
}),
|
|
126
|
-
};
|
|
127
|
-
}),
|
|
128
|
-
changed: true,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Delete a comment from a thread.
|
|
133
|
-
*
|
|
134
|
-
* Soft delete sets deletedAt timestamp.
|
|
135
|
-
* Hard delete removes the comment from the array.
|
|
136
|
-
*
|
|
137
|
-
* No-op if thread/comment does not exist, or if soft-deleting an already deleted comment.
|
|
138
|
-
*
|
|
139
|
-
* @param threads - Current threads array
|
|
140
|
-
* @param threadId - ID of the thread containing the comment
|
|
141
|
-
* @param commentId - ID of the comment to delete
|
|
142
|
-
* @param options - Delete options with soft flag and deletedAt timestamp (for soft delete)
|
|
143
|
-
*/
|
|
144
|
-
export function deleteComment(threads, threadId, commentId, options) {
|
|
145
|
-
const thread = threads.find((t) => t.id === threadId);
|
|
146
|
-
if (!thread) {
|
|
147
|
-
return { threads, changed: false };
|
|
148
|
-
}
|
|
149
|
-
const comment = thread.comments.find((c) => c.id === commentId);
|
|
150
|
-
if (!comment) {
|
|
151
|
-
return { threads, changed: false };
|
|
152
|
-
}
|
|
153
|
-
// For soft delete, no-op if already deleted or if deletedAt not provided
|
|
154
|
-
if (options.soft) {
|
|
155
|
-
if (comment.deletedAt || !options.deletedAt) {
|
|
156
|
-
return { threads, changed: false };
|
|
157
|
-
}
|
|
158
|
-
const { deletedAt } = options;
|
|
159
|
-
// Soft delete: set deletedAt
|
|
160
|
-
return {
|
|
161
|
-
threads: threads.map((t) => {
|
|
162
|
-
if (t.id !== threadId)
|
|
163
|
-
return t;
|
|
164
|
-
return {
|
|
165
|
-
...t,
|
|
166
|
-
comments: t.comments.map((c) => {
|
|
167
|
-
if (c.id !== commentId)
|
|
168
|
-
return c;
|
|
169
|
-
return { ...c, deletedAt };
|
|
170
|
-
}),
|
|
171
|
-
};
|
|
172
|
-
}),
|
|
173
|
-
changed: true,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
// Hard delete: remove from array
|
|
177
|
-
return {
|
|
178
|
-
threads: threads.map((t) => {
|
|
179
|
-
if (t.id !== threadId)
|
|
180
|
-
return t;
|
|
181
|
-
return {
|
|
182
|
-
...t,
|
|
183
|
-
comments: t.comments.filter((c) => c.id !== commentId),
|
|
184
|
-
};
|
|
185
|
-
}),
|
|
186
|
-
changed: true,
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Restore a soft-deleted comment.
|
|
191
|
-
*
|
|
192
|
-
* Removes the deletedAt timestamp.
|
|
193
|
-
*
|
|
194
|
-
* No-op if thread/comment does not exist or comment is not deleted.
|
|
195
|
-
*
|
|
196
|
-
* @param threads - Current threads array
|
|
197
|
-
* @param threadId - ID of the thread containing the comment
|
|
198
|
-
* @param commentId - ID of the comment to restore
|
|
199
|
-
*/
|
|
200
|
-
export function restoreComment(threads, threadId, commentId) {
|
|
201
|
-
const thread = threads.find((t) => t.id === threadId);
|
|
202
|
-
if (!thread) {
|
|
203
|
-
return { threads, changed: false };
|
|
204
|
-
}
|
|
205
|
-
const comment = thread.comments.find((c) => c.id === commentId);
|
|
206
|
-
if (!comment || !comment.deletedAt) {
|
|
207
|
-
return { threads, changed: false };
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
threads: threads.map((t) => {
|
|
211
|
-
if (t.id !== threadId)
|
|
212
|
-
return t;
|
|
213
|
-
return {
|
|
214
|
-
...t,
|
|
215
|
-
comments: t.comments.map((c) => {
|
|
216
|
-
if (c.id !== commentId)
|
|
217
|
-
return c;
|
|
218
|
-
// Remove deletedAt using delete for clean omission
|
|
219
|
-
const { deletedAt: _deletedAt, ...restored } = c;
|
|
220
|
-
return restored;
|
|
221
|
-
}),
|
|
222
|
-
};
|
|
223
|
-
}),
|
|
224
|
-
changed: true,
|
|
225
|
-
};
|
|
226
|
-
}
|