@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
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session persistence helpers for review sessions.
|
|
3
|
-
*
|
|
4
|
-
* All functions are SSR-safe (check `browser` before accessing storage).
|
|
5
|
-
* Sessions are stored in sessionStorage with document-scoped keys.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import { fromPersistedSession, toPersistedSession } from './updates.js';
|
|
10
|
-
/** SSR guard — evaluated lazily so tests can stub `window` after module load. */
|
|
11
|
-
const isBrowser = () => typeof window !== 'undefined';
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Constants
|
|
14
|
-
// ============================================================================
|
|
15
|
-
/**
|
|
16
|
-
* Storage key prefix for review sessions.
|
|
17
|
-
* Full key format: `review-session-{documentId}`
|
|
18
|
-
*/
|
|
19
|
-
export const STORAGE_KEY_PREFIX = 'review-session-';
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// Schema Validation
|
|
22
|
-
// ============================================================================
|
|
23
|
-
/**
|
|
24
|
-
* Validate that a value is a non-null object.
|
|
25
|
-
*/
|
|
26
|
-
function isObject(value) {
|
|
27
|
-
return typeof value === 'object' && value !== null;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Validate that a value is a string.
|
|
31
|
-
*/
|
|
32
|
-
function isString(value) {
|
|
33
|
-
return typeof value === 'string';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Validate that a value is an array.
|
|
37
|
-
*/
|
|
38
|
-
function isArray(value) {
|
|
39
|
-
return Array.isArray(value);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Validate persisted session schema.
|
|
43
|
-
*
|
|
44
|
-
* Returns true if the data has all required fields with correct types.
|
|
45
|
-
* Does not deeply validate nested structures (anchor details, etc.)
|
|
46
|
-
* to allow for forward compatibility with schema changes.
|
|
47
|
-
*
|
|
48
|
-
* @param data - Unknown data to validate
|
|
49
|
-
* @returns True if data matches PersistedReviewSession shape
|
|
50
|
-
*/
|
|
51
|
-
export function validateSessionSchema(data) {
|
|
52
|
-
if (!isObject(data))
|
|
53
|
-
return false;
|
|
54
|
-
const id = data['id'];
|
|
55
|
-
const status = data['status'];
|
|
56
|
-
const startedAt = data['startedAt'];
|
|
57
|
-
const updatedAt = data['updatedAt'];
|
|
58
|
-
const outcome = data['outcome'];
|
|
59
|
-
const draftComments = data['draftComments'];
|
|
60
|
-
const submittedAt = data['submittedAt'];
|
|
61
|
-
// Required string fields
|
|
62
|
-
if (!isString(id))
|
|
63
|
-
return false;
|
|
64
|
-
if (!isString(status))
|
|
65
|
-
return false;
|
|
66
|
-
if (!isString(startedAt))
|
|
67
|
-
return false;
|
|
68
|
-
if (!isString(updatedAt))
|
|
69
|
-
return false;
|
|
70
|
-
// Status must be valid
|
|
71
|
-
if (status !== 'drafting' && status !== 'submitted')
|
|
72
|
-
return false;
|
|
73
|
-
// Optional outcome must be a valid string if present (reject null)
|
|
74
|
-
if (outcome !== undefined) {
|
|
75
|
-
if (typeof outcome !== 'string')
|
|
76
|
-
return false;
|
|
77
|
-
if (outcome !== 'approve' && outcome !== 'request_changes' && outcome !== 'comment') {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// Required arrays
|
|
82
|
-
if (!isArray(draftComments))
|
|
83
|
-
return false;
|
|
84
|
-
// Note: draftSuggestions was removed from the schema. Old persisted
|
|
85
|
-
// sessions may still have this field - we allow it for backward
|
|
86
|
-
// compatibility but don't require it.
|
|
87
|
-
// Optional submittedAt must be string if present
|
|
88
|
-
if (submittedAt !== undefined && !isString(submittedAt))
|
|
89
|
-
return false;
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
// ============================================================================
|
|
93
|
-
// Storage Operations
|
|
94
|
-
// ============================================================================
|
|
95
|
-
/**
|
|
96
|
-
* Build the full storage key for a document.
|
|
97
|
-
*
|
|
98
|
-
* @param key - Document identifier (usually documentId)
|
|
99
|
-
* @returns Full storage key
|
|
100
|
-
*/
|
|
101
|
-
export function getStorageKey(key) {
|
|
102
|
-
return `${STORAGE_KEY_PREFIX}${key}`;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Save a review session to sessionStorage.
|
|
106
|
-
*
|
|
107
|
-
* SSR-safe: Returns false immediately when not in browser.
|
|
108
|
-
*
|
|
109
|
-
* @param key - Document identifier for storage key
|
|
110
|
-
* @param session - The session to persist
|
|
111
|
-
* @returns True if save succeeded, false otherwise
|
|
112
|
-
*/
|
|
113
|
-
export function saveSession(key, session) {
|
|
114
|
-
if (!isBrowser())
|
|
115
|
-
return false;
|
|
116
|
-
try {
|
|
117
|
-
const persisted = toPersistedSession(session);
|
|
118
|
-
const storageKey = getStorageKey(key);
|
|
119
|
-
sessionStorage.setItem(storageKey, JSON.stringify(persisted));
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
console.warn('Failed to persist review session:', error);
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Load a review session from sessionStorage.
|
|
129
|
-
*
|
|
130
|
-
* SSR-safe: Returns null immediately when not in browser.
|
|
131
|
-
*
|
|
132
|
-
* Returns null if:
|
|
133
|
-
* - Not in browser
|
|
134
|
-
* - Key doesn't exist
|
|
135
|
-
* - JSON parse fails
|
|
136
|
-
* - Schema validation fails (corrupted data is cleared)
|
|
137
|
-
* - Session status is 'submitted' (stale sessions are cleared)
|
|
138
|
-
*
|
|
139
|
-
* @param key - Document identifier for storage key
|
|
140
|
-
* @returns The restored session, or null if not found/invalid
|
|
141
|
-
*/
|
|
142
|
-
export function loadSession(key) {
|
|
143
|
-
if (!isBrowser())
|
|
144
|
-
return null;
|
|
145
|
-
const storageKey = getStorageKey(key);
|
|
146
|
-
try {
|
|
147
|
-
const raw = sessionStorage.getItem(storageKey);
|
|
148
|
-
if (!raw)
|
|
149
|
-
return null;
|
|
150
|
-
const data = JSON.parse(raw);
|
|
151
|
-
// Validate schema
|
|
152
|
-
if (!validateSessionSchema(data)) {
|
|
153
|
-
console.warn('Review session schema validation failed, clearing corrupted data');
|
|
154
|
-
clearPersistedSession(key);
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
// Clear stale submitted sessions
|
|
158
|
-
if (data.status === 'submitted') {
|
|
159
|
-
console.info('Clearing stale submitted review session');
|
|
160
|
-
clearPersistedSession(key);
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
return fromPersistedSession(data);
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
console.warn('Failed to load review session:', error);
|
|
167
|
-
// Clear potentially corrupted data
|
|
168
|
-
clearPersistedSession(key);
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Clear a persisted session from sessionStorage.
|
|
174
|
-
*
|
|
175
|
-
* SSR-safe: No-op when not in browser.
|
|
176
|
-
*
|
|
177
|
-
* @param key - Document identifier for storage key
|
|
178
|
-
*/
|
|
179
|
-
export function clearPersistedSession(key) {
|
|
180
|
-
if (!isBrowser())
|
|
181
|
-
return;
|
|
182
|
-
try {
|
|
183
|
-
const storageKey = getStorageKey(key);
|
|
184
|
-
sessionStorage.removeItem(storageKey);
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
console.warn('Failed to clear review session:', error);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Check if a session exists in sessionStorage.
|
|
192
|
-
*
|
|
193
|
-
* SSR-safe: Returns false when not in browser.
|
|
194
|
-
* Does not validate schema, just checks if key exists.
|
|
195
|
-
*
|
|
196
|
-
* @param key - Document identifier for storage key
|
|
197
|
-
* @returns True if session exists
|
|
198
|
-
*/
|
|
199
|
-
export function hasPersistedSession(key) {
|
|
200
|
-
if (!isBrowser())
|
|
201
|
-
return false;
|
|
202
|
-
try {
|
|
203
|
-
const storageKey = getStorageKey(key);
|
|
204
|
-
return sessionStorage.getItem(storageKey) !== null;
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* List all review session keys in sessionStorage.
|
|
212
|
-
*
|
|
213
|
-
* SSR-safe: Returns empty array when not in browser.
|
|
214
|
-
* Returns document identifiers (without the prefix).
|
|
215
|
-
*
|
|
216
|
-
* @returns Array of document identifiers with persisted sessions
|
|
217
|
-
*/
|
|
218
|
-
export function listPersistedSessions() {
|
|
219
|
-
if (!isBrowser())
|
|
220
|
-
return [];
|
|
221
|
-
try {
|
|
222
|
-
const keys = [];
|
|
223
|
-
for (let i = 0; i < sessionStorage.length; i++) {
|
|
224
|
-
const key = sessionStorage.key(i);
|
|
225
|
-
if (key?.startsWith(STORAGE_KEY_PREFIX)) {
|
|
226
|
-
keys.push(key.slice(STORAGE_KEY_PREFIX.length));
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return keys;
|
|
230
|
-
}
|
|
231
|
-
catch {
|
|
232
|
-
return [];
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Clear all review sessions from sessionStorage.
|
|
237
|
-
*
|
|
238
|
-
* SSR-safe: No-op when not in browser.
|
|
239
|
-
* Useful for cleanup on logout or session reset.
|
|
240
|
-
*/
|
|
241
|
-
export function clearAllPersistedSessions() {
|
|
242
|
-
if (!isBrowser())
|
|
243
|
-
return;
|
|
244
|
-
try {
|
|
245
|
-
const keys = listPersistedSessions();
|
|
246
|
-
for (const key of keys) {
|
|
247
|
-
clearPersistedSession(key);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
catch (error) {
|
|
251
|
-
console.warn('Failed to clear all review sessions:', error);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Review session types for batch review submission (DEP-44).
|
|
3
|
-
*
|
|
4
|
-
* These types support:
|
|
5
|
-
* - Draft comments that aren't visible until submission
|
|
6
|
-
* - Review outcomes (approve / request changes / comment-only)
|
|
7
|
-
* - Batch submission with all draft items
|
|
8
|
-
* - Session persistence across page navigations
|
|
9
|
-
*
|
|
10
|
-
* @module
|
|
11
|
-
*/
|
|
12
|
-
import type { CommentAnchor, PersistedAnchor } from '../shared/anchor-types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Review submission outcome, matching GitHub's review types.
|
|
15
|
-
*
|
|
16
|
-
* - 'approve': Approves the changes
|
|
17
|
-
* - 'request_changes': Requests changes before approval
|
|
18
|
-
* - 'comment': Comment-only (neither approve nor request changes)
|
|
19
|
-
*/
|
|
20
|
-
export type ReviewOutcome = 'approve' | 'request_changes' | 'comment';
|
|
21
|
-
/**
|
|
22
|
-
* Review session status lifecycle.
|
|
23
|
-
*
|
|
24
|
-
* - 'drafting': Session is active, accumulating draft items
|
|
25
|
-
* - 'submitted': Session has been submitted as a batch
|
|
26
|
-
*/
|
|
27
|
-
export type ReviewSessionStatus = 'drafting' | 'submitted';
|
|
28
|
-
/**
|
|
29
|
-
* A draft comment that hasn't been submitted yet.
|
|
30
|
-
*
|
|
31
|
-
* Draft comments can either:
|
|
32
|
-
* 1. Create a new thread (anchor is defined, threadId is undefined)
|
|
33
|
-
* 2. Reply to an existing thread (threadId is defined, anchor is undefined)
|
|
34
|
-
*/
|
|
35
|
-
export interface DraftComment {
|
|
36
|
-
/** Unique identifier (client-generated) */
|
|
37
|
-
id: string;
|
|
38
|
-
/**
|
|
39
|
-
* Parent thread ID when replying to an existing thread.
|
|
40
|
-
* Undefined when creating a new thread.
|
|
41
|
-
*/
|
|
42
|
-
threadId?: string | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Anchor for new threads.
|
|
45
|
-
* Required when threadId is undefined, otherwise undefined.
|
|
46
|
-
*/
|
|
47
|
-
anchor?: CommentAnchor | undefined;
|
|
48
|
-
/** Comment body (Markdown) */
|
|
49
|
-
body: string;
|
|
50
|
-
/** Author user ID */
|
|
51
|
-
authorId: string;
|
|
52
|
-
/** User IDs mentioned in the comment */
|
|
53
|
-
mentions?: string[] | undefined;
|
|
54
|
-
/** Creation timestamp (ISO 8601) */
|
|
55
|
-
createdAt: string;
|
|
56
|
-
/** Last update timestamp (ISO 8601) */
|
|
57
|
-
updatedAt: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Persisted form of DraftComment (strips runtime anchor positions).
|
|
61
|
-
*/
|
|
62
|
-
export interface PersistedDraftComment {
|
|
63
|
-
id: string;
|
|
64
|
-
threadId?: string | undefined;
|
|
65
|
-
anchor?: PersistedAnchor | undefined;
|
|
66
|
-
body: string;
|
|
67
|
-
authorId: string;
|
|
68
|
-
mentions?: string[] | undefined;
|
|
69
|
-
createdAt: string;
|
|
70
|
-
updatedAt: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Complete review session state.
|
|
74
|
-
*
|
|
75
|
-
* A session accumulates draft comments until the user submits the review
|
|
76
|
-
* as a batch. The session also tracks the selected review outcome
|
|
77
|
-
* (approve, request changes, or comment-only).
|
|
78
|
-
*/
|
|
79
|
-
export interface ReviewSession {
|
|
80
|
-
/** Session ID */
|
|
81
|
-
id: string;
|
|
82
|
-
/** Current session status */
|
|
83
|
-
status: ReviewSessionStatus;
|
|
84
|
-
/** Selected review outcome (set before submission) */
|
|
85
|
-
outcome?: ReviewOutcome | undefined;
|
|
86
|
-
/** Draft comments (new threads and replies to existing threads) */
|
|
87
|
-
draftComments: DraftComment[];
|
|
88
|
-
/** When the session started (ISO 8601) */
|
|
89
|
-
startedAt: string;
|
|
90
|
-
/** Last update timestamp for conflict resolution (ISO 8601) */
|
|
91
|
-
updatedAt: string;
|
|
92
|
-
/** When the session was submitted (ISO 8601), if status is 'submitted' */
|
|
93
|
-
submittedAt?: string | undefined;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Persisted form of ReviewSession (for storage).
|
|
97
|
-
* Uses persisted forms of draft items that strip runtime positions.
|
|
98
|
-
*/
|
|
99
|
-
export interface PersistedReviewSession {
|
|
100
|
-
id: string;
|
|
101
|
-
status: ReviewSessionStatus;
|
|
102
|
-
outcome?: ReviewOutcome | undefined;
|
|
103
|
-
draftComments: PersistedDraftComment[];
|
|
104
|
-
startedAt: string;
|
|
105
|
-
updatedAt: string;
|
|
106
|
-
submittedAt?: string | undefined;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Counts of pending draft items in a session.
|
|
110
|
-
*/
|
|
111
|
-
export interface DraftCounts {
|
|
112
|
-
/** Number of draft comments that create new threads */
|
|
113
|
-
threads: number;
|
|
114
|
-
/** Number of draft comments that reply to existing threads */
|
|
115
|
-
replies: number;
|
|
116
|
-
/** Total count of all draft items */
|
|
117
|
-
total: number;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Event payload when a draft thread is created.
|
|
121
|
-
* Emitted when user creates a new comment thread while a session is active.
|
|
122
|
-
*/
|
|
123
|
-
export interface DraftThreadCreateEvent {
|
|
124
|
-
/** Request ID for correlation */
|
|
125
|
-
requestId: string;
|
|
126
|
-
/** The anchor where the thread was created */
|
|
127
|
-
anchor: CommentAnchor;
|
|
128
|
-
/** The initial comment body */
|
|
129
|
-
body: string;
|
|
130
|
-
/** The author ID */
|
|
131
|
-
authorId: string;
|
|
132
|
-
/** User IDs mentioned in the comment */
|
|
133
|
-
mentions?: string[];
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Event payload when a draft comment (reply) is created.
|
|
137
|
-
* Emitted when user replies to an existing thread while a session is active.
|
|
138
|
-
*/
|
|
139
|
-
export interface DraftCommentCreateEvent {
|
|
140
|
-
/** Request ID for correlation */
|
|
141
|
-
requestId: string;
|
|
142
|
-
/** The existing thread ID receiving the reply */
|
|
143
|
-
threadId: string;
|
|
144
|
-
/** The comment body */
|
|
145
|
-
body: string;
|
|
146
|
-
/** The author ID */
|
|
147
|
-
authorId: string;
|
|
148
|
-
/** User IDs mentioned in the comment */
|
|
149
|
-
mentions?: string[];
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Event payload when a draft comment is updated.
|
|
153
|
-
*/
|
|
154
|
-
export interface DraftCommentUpdateEvent {
|
|
155
|
-
/** The draft comment ID being updated */
|
|
156
|
-
commentId: string;
|
|
157
|
-
/** The new comment body */
|
|
158
|
-
body: string;
|
|
159
|
-
/** User IDs mentioned in the updated comment */
|
|
160
|
-
mentions?: string[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Event payload when a draft comment is deleted.
|
|
164
|
-
*/
|
|
165
|
-
export interface DraftCommentDeleteEvent {
|
|
166
|
-
/** The draft comment ID being deleted */
|
|
167
|
-
commentId: string;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Event payload when the review outcome is changed.
|
|
171
|
-
*/
|
|
172
|
-
export interface ReviewOutcomeChangeEvent {
|
|
173
|
-
/** The new outcome */
|
|
174
|
-
outcome: ReviewOutcome;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Event payload when a review is submitted.
|
|
178
|
-
* Contains the complete session with all draft items for batch processing.
|
|
179
|
-
*/
|
|
180
|
-
export interface ReviewSubmitEvent {
|
|
181
|
-
/** The complete session being submitted */
|
|
182
|
-
session: ReviewSession;
|
|
183
|
-
/** The selected review outcome */
|
|
184
|
-
outcome: ReviewOutcome;
|
|
185
|
-
/** Optional summary body for the review */
|
|
186
|
-
summaryBody?: string;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Event payload when a review is discarded.
|
|
190
|
-
*/
|
|
191
|
-
export interface ReviewDiscardEvent {
|
|
192
|
-
/** The session ID being discarded */
|
|
193
|
-
sessionId: string;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Check if a draft comment creates a new thread (has anchor, no threadId).
|
|
197
|
-
*/
|
|
198
|
-
export declare function isDraftThread(comment: DraftComment): comment is DraftComment & {
|
|
199
|
-
anchor: CommentAnchor;
|
|
200
|
-
threadId: undefined;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* Check if a draft comment is a reply to an existing thread (has threadId, no anchor).
|
|
204
|
-
*/
|
|
205
|
-
export declare function isDraftReply(comment: DraftComment): comment is DraftComment & {
|
|
206
|
-
threadId: string;
|
|
207
|
-
anchor: undefined;
|
|
208
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Review session types for batch review submission (DEP-44).
|
|
3
|
-
*
|
|
4
|
-
* These types support:
|
|
5
|
-
* - Draft comments that aren't visible until submission
|
|
6
|
-
* - Review outcomes (approve / request changes / comment-only)
|
|
7
|
-
* - Batch submission with all draft items
|
|
8
|
-
* - Session persistence across page navigations
|
|
9
|
-
*
|
|
10
|
-
* @module
|
|
11
|
-
*/
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Type Guards
|
|
14
|
-
// ============================================================================
|
|
15
|
-
/**
|
|
16
|
-
* Check if a draft comment creates a new thread (has anchor, no threadId).
|
|
17
|
-
*/
|
|
18
|
-
export function isDraftThread(comment) {
|
|
19
|
-
return comment.anchor !== undefined && comment.threadId === undefined;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Check if a draft comment is a reply to an existing thread (has threadId, no anchor).
|
|
23
|
-
*/
|
|
24
|
-
export function isDraftReply(comment) {
|
|
25
|
-
return comment.threadId !== undefined && comment.anchor === undefined;
|
|
26
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure update helpers for review session state management.
|
|
3
|
-
*
|
|
4
|
-
* All functions are pure (no side effects, no ID/timestamp generation).
|
|
5
|
-
* They return new objects for Svelte 5 reactivity.
|
|
6
|
-
* The `changed` flag indicates whether the operation had any effect.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import type { DraftComment, DraftCounts, PersistedDraftComment, PersistedReviewSession, ReviewOutcome, ReviewSession } from './types.js';
|
|
11
|
-
/**
|
|
12
|
-
* Result of a session update operation.
|
|
13
|
-
* @template T - Optional value type returned with the result
|
|
14
|
-
*/
|
|
15
|
-
export type SessionUpdateResult<T = undefined> = {
|
|
16
|
-
/** The updated session */
|
|
17
|
-
session: ReviewSession;
|
|
18
|
-
/** Whether the operation made any changes */
|
|
19
|
-
changed: boolean;
|
|
20
|
-
/** Optional value from the operation */
|
|
21
|
-
value?: T;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Add a draft comment to the session.
|
|
25
|
-
*
|
|
26
|
-
* The comment can either create a new thread (has anchor, no threadId)
|
|
27
|
-
* or reply to an existing thread (has threadId, no anchor).
|
|
28
|
-
*
|
|
29
|
-
* @param session - Current session
|
|
30
|
-
* @param comment - The draft comment to add (caller provides complete DraftComment)
|
|
31
|
-
*/
|
|
32
|
-
export declare function addDraftComment(session: ReviewSession, comment: DraftComment): SessionUpdateResult<{
|
|
33
|
-
comment: DraftComment;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Update a draft comment's body and mentions.
|
|
37
|
-
*
|
|
38
|
-
* No-op if comment does not exist.
|
|
39
|
-
*
|
|
40
|
-
* @param session - Current session
|
|
41
|
-
* @param commentId - ID of the draft comment to update
|
|
42
|
-
* @param update - The update with body, mentions, and updatedAt (caller provides timestamp)
|
|
43
|
-
*/
|
|
44
|
-
export declare function updateDraftComment(session: ReviewSession, commentId: string, update: {
|
|
45
|
-
body: string;
|
|
46
|
-
mentions?: string[];
|
|
47
|
-
updatedAt: string;
|
|
48
|
-
}): SessionUpdateResult;
|
|
49
|
-
/**
|
|
50
|
-
* Delete a draft comment from the session.
|
|
51
|
-
*
|
|
52
|
-
* No-op if comment does not exist.
|
|
53
|
-
*
|
|
54
|
-
* @param session - Current session
|
|
55
|
-
* @param commentId - ID of the draft comment to delete
|
|
56
|
-
* @param updatedAt - Timestamp for the update (caller provides)
|
|
57
|
-
*/
|
|
58
|
-
export declare function deleteDraftComment(session: ReviewSession, commentId: string, updatedAt: string): SessionUpdateResult;
|
|
59
|
-
/**
|
|
60
|
-
* Find a draft comment by ID.
|
|
61
|
-
*
|
|
62
|
-
* @param session - Current session
|
|
63
|
-
* @param commentId - ID of the draft comment to find
|
|
64
|
-
*/
|
|
65
|
-
export declare function findDraftComment(session: ReviewSession, commentId: string): DraftComment | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Set the review outcome.
|
|
68
|
-
*
|
|
69
|
-
* @param session - Current session
|
|
70
|
-
* @param outcome - The review outcome to set
|
|
71
|
-
* @param updatedAt - Timestamp for the update (caller provides)
|
|
72
|
-
*/
|
|
73
|
-
export declare function setReviewOutcome(session: ReviewSession, outcome: ReviewOutcome, updatedAt: string): SessionUpdateResult;
|
|
74
|
-
/**
|
|
75
|
-
* Clear the review outcome.
|
|
76
|
-
*
|
|
77
|
-
* @param session - Current session
|
|
78
|
-
* @param updatedAt - Timestamp for the update (caller provides)
|
|
79
|
-
*/
|
|
80
|
-
export declare function clearReviewOutcome(session: ReviewSession, updatedAt: string): SessionUpdateResult;
|
|
81
|
-
/**
|
|
82
|
-
* Get counts of draft items in the session.
|
|
83
|
-
*
|
|
84
|
-
* @param session - Current session
|
|
85
|
-
*/
|
|
86
|
-
export declare function getDraftCounts(session: ReviewSession): DraftCounts;
|
|
87
|
-
/**
|
|
88
|
-
* Get draft comments that create new threads (have anchor, no threadId).
|
|
89
|
-
*
|
|
90
|
-
* @param session - Current session
|
|
91
|
-
*/
|
|
92
|
-
export declare function getDraftThreads(session: ReviewSession): DraftComment[];
|
|
93
|
-
/**
|
|
94
|
-
* Get draft comments that are replies to existing threads (have threadId, no anchor).
|
|
95
|
-
*
|
|
96
|
-
* @param session - Current session
|
|
97
|
-
*/
|
|
98
|
-
export declare function getDraftReplies(session: ReviewSession): DraftComment[];
|
|
99
|
-
/**
|
|
100
|
-
* Get draft replies for a specific thread.
|
|
101
|
-
*
|
|
102
|
-
* @param session - Current session
|
|
103
|
-
* @param threadId - The thread ID to get replies for
|
|
104
|
-
*/
|
|
105
|
-
export declare function getDraftRepliesForThread(session: ReviewSession, threadId: string): DraftComment[];
|
|
106
|
-
/**
|
|
107
|
-
* Clear all drafts from the session.
|
|
108
|
-
*
|
|
109
|
-
* Removes all draft comments and resets outcome.
|
|
110
|
-
*
|
|
111
|
-
* @param session - Current session
|
|
112
|
-
* @param updatedAt - Timestamp for the update (caller provides)
|
|
113
|
-
*/
|
|
114
|
-
export declare function clearSession(session: ReviewSession, updatedAt: string): SessionUpdateResult;
|
|
115
|
-
/**
|
|
116
|
-
* Create a new empty session.
|
|
117
|
-
*
|
|
118
|
-
* @param id - Session ID (caller provides)
|
|
119
|
-
* @param startedAt - Start timestamp (caller provides)
|
|
120
|
-
*/
|
|
121
|
-
export declare function createSession(id: string, startedAt: string): ReviewSession;
|
|
122
|
-
/**
|
|
123
|
-
* Mark a session as submitted.
|
|
124
|
-
*
|
|
125
|
-
* @param session - Current session
|
|
126
|
-
* @param outcome - The final review outcome
|
|
127
|
-
* @param submittedAt - Submission timestamp (caller provides)
|
|
128
|
-
*/
|
|
129
|
-
export declare function submitSession(session: ReviewSession, outcome: ReviewOutcome, submittedAt: string): SessionUpdateResult;
|
|
130
|
-
/**
|
|
131
|
-
* Convert a draft comment to persisted format.
|
|
132
|
-
* Strips runtime anchor positions (from/to).
|
|
133
|
-
*
|
|
134
|
-
* @param comment - Runtime draft comment
|
|
135
|
-
*/
|
|
136
|
-
export declare function toPersistedDraftComment(comment: DraftComment): PersistedDraftComment;
|
|
137
|
-
/**
|
|
138
|
-
* Convert a session to persisted format for storage.
|
|
139
|
-
*
|
|
140
|
-
* @param session - Runtime session
|
|
141
|
-
*/
|
|
142
|
-
export declare function toPersistedSession(session: ReviewSession): PersistedReviewSession;
|
|
143
|
-
/**
|
|
144
|
-
* Convert a persisted draft comment back to runtime format.
|
|
145
|
-
* Initializes anchor positions to 0 (caller must re-anchor).
|
|
146
|
-
*
|
|
147
|
-
* @param persisted - Persisted draft comment
|
|
148
|
-
*/
|
|
149
|
-
export declare function fromPersistedDraftComment(persisted: PersistedDraftComment): DraftComment;
|
|
150
|
-
/**
|
|
151
|
-
* Convert a persisted session back to runtime format.
|
|
152
|
-
*
|
|
153
|
-
* @param persisted - Persisted session
|
|
154
|
-
*/
|
|
155
|
-
export declare function fromPersistedSession(persisted: PersistedReviewSession): ReviewSession;
|