@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
|
@@ -5,27 +5,29 @@ export type SidebarProps = Omit<HTMLAttributes<HTMLElement>, 'aria-label' | 'ari
|
|
|
5
5
|
/**
|
|
6
6
|
* Whether the sidebar is collapsed. Bindable via `bind:collapsed`. Default `false`.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* icon-only mode.
|
|
8
|
+
* Above `mobileBreakpoint`, `collapsed=true` switches the sidebar to
|
|
9
|
+
* icon-only mode. At or below `mobileBreakpoint`, the sidebar renders inside a
|
|
10
10
|
* `<Drawer>` and `collapsed=true` means the drawer is closed.
|
|
11
11
|
*/
|
|
12
12
|
collapsed?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Accessible name for the outer landmark and the mobile drawer.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* by appending `' navigation'` so screen readers can distinguish the
|
|
18
|
-
* outer complementary region from the inner navigation region.
|
|
14
|
+
* Accessible name for the outer landmark and the mobile drawer. Defaults to
|
|
15
|
+
* `'Sidebar'` for convenience but must be unique per page. Navigation content
|
|
16
|
+
* owns its own accessible name; for example, use `SideNavigation.ariaLabel`.
|
|
19
17
|
*/
|
|
20
18
|
label?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Viewport width below which the sidebar switches from the inline aside to
|
|
21
|
+
* the mobile drawer. Accepts a simple CSS length such as `'47.99rem'` or
|
|
22
|
+
* `'1024px'`. Default `'47.99rem'`.
|
|
23
|
+
*/
|
|
24
|
+
mobileBreakpoint?: string;
|
|
21
25
|
/** Additional CSS class merged with `.cinder-sidebar`. */
|
|
22
26
|
class?: string;
|
|
23
|
-
/** Optional branding region rendered above the navigation. */
|
|
24
|
-
brand?: Snippet;
|
|
25
27
|
/**
|
|
26
|
-
* Navigation
|
|
27
|
-
*
|
|
28
|
-
* without a navigation list
|
|
28
|
+
* Navigation content. Typically a `<SideNavigation>` subtree, which owns the
|
|
29
|
+
* navigation landmark and its accessible name. Optional so the sidebar can
|
|
30
|
+
* serve as app chrome without a navigation list.
|
|
29
31
|
*/
|
|
30
32
|
navigation?: Snippet;
|
|
31
33
|
/** Optional footer region (e.g. user account, sign-out). */
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @tag code
|
|
9
9
|
* @useWhen Rendering source-code unified patches from agent output, Git operations, workspace changes, or review systems.
|
|
10
10
|
* @useWhen Showing operational patch output where file and hunk structure matters more than Markdown front matter or word-level prose review.
|
|
11
|
-
* @avoidWhen Comparing two Markdown documents with normalization, front-matter
|
|
11
|
+
* @avoidWhen Comparing two Markdown documents with normalization, front-matter, and revert affordances — use `DiffViewer` from `@lostgradient/editor`.
|
|
12
12
|
* @avoidWhen Showing syntax-highlighted code samples rather than patch output. | code-block
|
|
13
|
-
* @related diff-
|
|
13
|
+
* @related diff-statistics, code-block
|
|
14
14
|
*/
|
|
15
15
|
export type { SourceDiffFile, SourceDiffHunk, SourceDiffLine, SourceDiffLineKind, SourceDiffParseResult, SourceDiffViewerProps, } from './source-diff-viewer.types.ts';
|
|
16
16
|
export { getSourceDiffFileLabel, getSourceDiffLineLabel, parseUnifiedPatch, } from './source-diff-viewer.utilities.ts';
|
|
@@ -341,7 +341,6 @@ function createBarModel(options) {
|
|
|
341
341
|
assertValidChartNumber("bar-chart", "invalid-height", height, "height");
|
|
342
342
|
assertValidTickCount("bar-chart", xAxis);
|
|
343
343
|
assertValidTickCount("bar-chart", yAxis);
|
|
344
|
-
const geometry = createGeometry(width, height);
|
|
345
344
|
const categories = [];
|
|
346
345
|
const seenCategories = new Set;
|
|
347
346
|
const categoryKinds = new Set;
|
|
@@ -381,6 +380,9 @@ function createBarModel(options) {
|
|
|
381
380
|
throw new Error(`[cinder/bar-chart] rule=mixed-bar-category-kind key="${categoryKey}": category values must share one domain kind.`);
|
|
382
381
|
}
|
|
383
382
|
const sortedCategories = sortXValues(categories);
|
|
383
|
+
const categoryLabels = sortedCategories.map((category, index) => formatXValue(category, orientation === "vertical" ? xAxis : yAxis, { index }));
|
|
384
|
+
const horizontalCategoryLabelLayout = orientation === "horizontal" ? createHorizontalCategoryLabelLayout(categoryLabels, width) : undefined;
|
|
385
|
+
const geometry = createGeometry(width, height, horizontalCategoryLabelLayout?.marginLeft);
|
|
384
386
|
const valueDomain = createPaddedDomain(mode === "stacked" ? createStackedBarDomainValues(datumByKey, sortedCategories, visibleSeries) : visibleValues);
|
|
385
387
|
if (sortedCategories.length === 0) {
|
|
386
388
|
const tickAxis = orientation === "vertical" ? yAxis : xAxis;
|
|
@@ -403,8 +405,9 @@ function createBarModel(options) {
|
|
|
403
405
|
const categoryPosition = categoryScale(category.key) ?? 0;
|
|
404
406
|
return {
|
|
405
407
|
categoryKey: category.key,
|
|
406
|
-
label:
|
|
407
|
-
|
|
408
|
+
label: horizontalCategoryLabelLayout?.labels[index] ?? categoryLabels[index] ?? category.label,
|
|
409
|
+
fullLabel: categoryLabels[index] ?? category.label,
|
|
410
|
+
x: orientation === "vertical" ? categoryPosition + categoryScale.bandwidth() / 2 : -HORIZONTAL_CATEGORY_LABEL_GAP,
|
|
408
411
|
y: orientation === "vertical" ? geometry.plotHeight + 20 : categoryPosition + categoryScale.bandwidth() / 2
|
|
409
412
|
};
|
|
410
413
|
});
|
|
@@ -568,11 +571,15 @@ function nearestTarget(targets, x, y, axis = "x") {
|
|
|
568
571
|
function legendVisible(legendPosition, seriesCount) {
|
|
569
572
|
return legendPosition !== "none" && seriesCount > 0;
|
|
570
573
|
}
|
|
571
|
-
|
|
574
|
+
var DEFAULT_CHART_MARGIN_LEFT = 48;
|
|
575
|
+
var HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH = 12;
|
|
576
|
+
var HORIZONTAL_CATEGORY_LABEL_GAP = 8;
|
|
577
|
+
var HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING = 8;
|
|
578
|
+
var MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION = 0.4;
|
|
579
|
+
function createGeometry(width, height, marginLeft = DEFAULT_CHART_MARGIN_LEFT) {
|
|
572
580
|
const marginTop = 16;
|
|
573
581
|
const marginRight = 16;
|
|
574
582
|
const marginBottom = 36;
|
|
575
|
-
const marginLeft = 48;
|
|
576
583
|
return {
|
|
577
584
|
plotWidth: Math.max(1, width - marginLeft - marginRight),
|
|
578
585
|
plotHeight: Math.max(1, height - marginTop - marginBottom),
|
|
@@ -582,6 +589,33 @@ function createGeometry(width, height) {
|
|
|
582
589
|
marginLeft
|
|
583
590
|
};
|
|
584
591
|
}
|
|
592
|
+
function createHorizontalCategoryLabelLayout(labels, chartWidth) {
|
|
593
|
+
const maximumMarginLeft = Math.max(DEFAULT_CHART_MARGIN_LEFT, Math.floor(chartWidth * MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION));
|
|
594
|
+
let longestLabelWidth = 0;
|
|
595
|
+
for (const label of labels) {
|
|
596
|
+
longestLabelWidth = Math.max(longestLabelWidth, estimateHorizontalCategoryLabelWidth(label));
|
|
597
|
+
}
|
|
598
|
+
const requestedMarginLeft = longestLabelWidth + HORIZONTAL_CATEGORY_LABEL_GAP + HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING;
|
|
599
|
+
const marginLeft = Math.min(maximumMarginLeft, Math.max(DEFAULT_CHART_MARGIN_LEFT, requestedMarginLeft));
|
|
600
|
+
const availableLabelWidth = Math.max(0, marginLeft - HORIZONTAL_CATEGORY_LABEL_GAP - HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING);
|
|
601
|
+
return {
|
|
602
|
+
marginLeft,
|
|
603
|
+
labels: labels.map((label) => truncateHorizontalCategoryLabel(label, availableLabelWidth))
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function estimateHorizontalCategoryLabelWidth(label) {
|
|
607
|
+
return Array.from(label).length * HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH;
|
|
608
|
+
}
|
|
609
|
+
function truncateHorizontalCategoryLabel(label, availableWidth) {
|
|
610
|
+
if (estimateHorizontalCategoryLabelWidth(label) <= availableWidth)
|
|
611
|
+
return label;
|
|
612
|
+
const availableCharacterCount = Math.floor(availableWidth / HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH);
|
|
613
|
+
if (availableCharacterCount <= 0)
|
|
614
|
+
return "";
|
|
615
|
+
if (availableCharacterCount === 1)
|
|
616
|
+
return "…";
|
|
617
|
+
return `${Array.from(label).slice(0, availableCharacterCount - 1).join("")}…`;
|
|
618
|
+
}
|
|
585
619
|
function normalizeNumericValue(componentId, seriesId, xLabel, value) {
|
|
586
620
|
if (value === null || value === undefined)
|
|
587
621
|
return null;
|
|
@@ -1175,4 +1209,4 @@ export {
|
|
|
1175
1209
|
Spectrogram
|
|
1176
1210
|
};
|
|
1177
1211
|
|
|
1178
|
-
//# debugId=
|
|
1212
|
+
//# debugId=C04EEAF09C62213C64756E2164756E21
|
|
@@ -341,7 +341,6 @@ function createBarModel(options) {
|
|
|
341
341
|
assertValidChartNumber("bar-chart", "invalid-height", height, "height");
|
|
342
342
|
assertValidTickCount("bar-chart", xAxis);
|
|
343
343
|
assertValidTickCount("bar-chart", yAxis);
|
|
344
|
-
const geometry = createGeometry(width, height);
|
|
345
344
|
const categories = [];
|
|
346
345
|
const seenCategories = new Set;
|
|
347
346
|
const categoryKinds = new Set;
|
|
@@ -381,6 +380,9 @@ function createBarModel(options) {
|
|
|
381
380
|
throw new Error(`[cinder/bar-chart] rule=mixed-bar-category-kind key="${categoryKey}": category values must share one domain kind.`);
|
|
382
381
|
}
|
|
383
382
|
const sortedCategories = sortXValues(categories);
|
|
383
|
+
const categoryLabels = sortedCategories.map((category, index) => formatXValue(category, orientation === "vertical" ? xAxis : yAxis, { index }));
|
|
384
|
+
const horizontalCategoryLabelLayout = orientation === "horizontal" ? createHorizontalCategoryLabelLayout(categoryLabels, width) : undefined;
|
|
385
|
+
const geometry = createGeometry(width, height, horizontalCategoryLabelLayout?.marginLeft);
|
|
384
386
|
const valueDomain = createPaddedDomain(mode === "stacked" ? createStackedBarDomainValues(datumByKey, sortedCategories, visibleSeries) : visibleValues);
|
|
385
387
|
if (sortedCategories.length === 0) {
|
|
386
388
|
const tickAxis = orientation === "vertical" ? yAxis : xAxis;
|
|
@@ -403,8 +405,9 @@ function createBarModel(options) {
|
|
|
403
405
|
const categoryPosition = categoryScale(category.key) ?? 0;
|
|
404
406
|
return {
|
|
405
407
|
categoryKey: category.key,
|
|
406
|
-
label:
|
|
407
|
-
|
|
408
|
+
label: horizontalCategoryLabelLayout?.labels[index] ?? categoryLabels[index] ?? category.label,
|
|
409
|
+
fullLabel: categoryLabels[index] ?? category.label,
|
|
410
|
+
x: orientation === "vertical" ? categoryPosition + categoryScale.bandwidth() / 2 : -HORIZONTAL_CATEGORY_LABEL_GAP,
|
|
408
411
|
y: orientation === "vertical" ? geometry.plotHeight + 20 : categoryPosition + categoryScale.bandwidth() / 2
|
|
409
412
|
};
|
|
410
413
|
});
|
|
@@ -568,11 +571,15 @@ function nearestTarget(targets, x, y, axis = "x") {
|
|
|
568
571
|
function legendVisible(legendPosition, seriesCount) {
|
|
569
572
|
return legendPosition !== "none" && seriesCount > 0;
|
|
570
573
|
}
|
|
571
|
-
|
|
574
|
+
var DEFAULT_CHART_MARGIN_LEFT = 48;
|
|
575
|
+
var HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH = 12;
|
|
576
|
+
var HORIZONTAL_CATEGORY_LABEL_GAP = 8;
|
|
577
|
+
var HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING = 8;
|
|
578
|
+
var MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION = 0.4;
|
|
579
|
+
function createGeometry(width, height, marginLeft = DEFAULT_CHART_MARGIN_LEFT) {
|
|
572
580
|
const marginTop = 16;
|
|
573
581
|
const marginRight = 16;
|
|
574
582
|
const marginBottom = 36;
|
|
575
|
-
const marginLeft = 48;
|
|
576
583
|
return {
|
|
577
584
|
plotWidth: Math.max(1, width - marginLeft - marginRight),
|
|
578
585
|
plotHeight: Math.max(1, height - marginTop - marginBottom),
|
|
@@ -582,6 +589,33 @@ function createGeometry(width, height) {
|
|
|
582
589
|
marginLeft
|
|
583
590
|
};
|
|
584
591
|
}
|
|
592
|
+
function createHorizontalCategoryLabelLayout(labels, chartWidth) {
|
|
593
|
+
const maximumMarginLeft = Math.max(DEFAULT_CHART_MARGIN_LEFT, Math.floor(chartWidth * MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION));
|
|
594
|
+
let longestLabelWidth = 0;
|
|
595
|
+
for (const label of labels) {
|
|
596
|
+
longestLabelWidth = Math.max(longestLabelWidth, estimateHorizontalCategoryLabelWidth(label));
|
|
597
|
+
}
|
|
598
|
+
const requestedMarginLeft = longestLabelWidth + HORIZONTAL_CATEGORY_LABEL_GAP + HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING;
|
|
599
|
+
const marginLeft = Math.min(maximumMarginLeft, Math.max(DEFAULT_CHART_MARGIN_LEFT, requestedMarginLeft));
|
|
600
|
+
const availableLabelWidth = Math.max(0, marginLeft - HORIZONTAL_CATEGORY_LABEL_GAP - HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING);
|
|
601
|
+
return {
|
|
602
|
+
marginLeft,
|
|
603
|
+
labels: labels.map((label) => truncateHorizontalCategoryLabel(label, availableLabelWidth))
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function estimateHorizontalCategoryLabelWidth(label) {
|
|
607
|
+
return Array.from(label).length * HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH;
|
|
608
|
+
}
|
|
609
|
+
function truncateHorizontalCategoryLabel(label, availableWidth) {
|
|
610
|
+
if (estimateHorizontalCategoryLabelWidth(label) <= availableWidth)
|
|
611
|
+
return label;
|
|
612
|
+
const availableCharacterCount = Math.floor(availableWidth / HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH);
|
|
613
|
+
if (availableCharacterCount <= 0)
|
|
614
|
+
return "";
|
|
615
|
+
if (availableCharacterCount === 1)
|
|
616
|
+
return "…";
|
|
617
|
+
return `${Array.from(label).slice(0, availableCharacterCount - 1).join("")}…`;
|
|
618
|
+
}
|
|
585
619
|
function normalizeNumericValue(componentId, seriesId, xLabel, value) {
|
|
586
620
|
if (value === null || value === undefined)
|
|
587
621
|
return null;
|
|
@@ -1075,4 +1109,4 @@ export {
|
|
|
1075
1109
|
Spectrum_chart as SpectrumChart
|
|
1076
1110
|
};
|
|
1077
1111
|
|
|
1078
|
-
//# debugId=
|
|
1112
|
+
//# debugId=3C3D829E8BA4B78564756E2164756E21
|
|
@@ -446,14 +446,70 @@ var rest_excludes4 = new Set([
|
|
|
446
446
|
"stickyHeader",
|
|
447
447
|
"density",
|
|
448
448
|
"selectable",
|
|
449
|
+
"scrollable",
|
|
450
|
+
"scrollContainerProps",
|
|
449
451
|
"class",
|
|
450
452
|
"children"
|
|
451
453
|
]);
|
|
452
454
|
var root5 = $7.from_html(`<caption class="cinder-table__caption"> </caption>`);
|
|
453
455
|
var root_13 = $7.from_html(`<table><!><!></table>`);
|
|
456
|
+
var root_22 = $7.from_html(`<div><!></div>`);
|
|
454
457
|
function Table($$anchor, $$props) {
|
|
455
458
|
$7.push($$props, true);
|
|
456
|
-
|
|
459
|
+
const table = ($$anchor2) => {
|
|
460
|
+
var table_1 = root_13();
|
|
461
|
+
$7.attribute_effect(table_1, ($0) => ({
|
|
462
|
+
...rest,
|
|
463
|
+
class: $0,
|
|
464
|
+
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
465
|
+
"data-cinder-density": density(),
|
|
466
|
+
"data-cinder-selectable": selectable() || undefined,
|
|
467
|
+
[$7.STYLE]: {
|
|
468
|
+
"--cinder-table-caption-height": $7.get(normalizedCaption) ? `${$7.get(captionHeight)}px` : undefined
|
|
469
|
+
}
|
|
470
|
+
}), [() => classNames("cinder-table", $$props.class)]);
|
|
471
|
+
var node = $7.child(table_1);
|
|
472
|
+
{
|
|
473
|
+
var consequent = ($$anchor3) => {
|
|
474
|
+
var caption_1 = root5();
|
|
475
|
+
var text = $7.child(caption_1, true);
|
|
476
|
+
$7.reset(caption_1);
|
|
477
|
+
$7.attach(caption_1, () => measureCaption);
|
|
478
|
+
$7.template_effect(() => $7.set_text(text, $7.get(normalizedCaption)));
|
|
479
|
+
$7.append($$anchor3, caption_1);
|
|
480
|
+
};
|
|
481
|
+
$7.if(node, ($$render) => {
|
|
482
|
+
if ($7.get(normalizedCaption))
|
|
483
|
+
$$render(consequent);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
var node_1 = $7.sibling(node);
|
|
487
|
+
$7.snippet(node_1, () => $$props.children);
|
|
488
|
+
$7.reset(table_1);
|
|
489
|
+
$7.append($$anchor2, table_1);
|
|
490
|
+
};
|
|
491
|
+
let sort = $7.prop($$props, "sort", 15), stickyHeader = $7.prop($$props, "stickyHeader", 3, false), density = $7.prop($$props, "density", 3, "comfortable"), selectable = $7.prop($$props, "selectable", 3, false), scrollable = $7.prop($$props, "scrollable", 3, false), rest = $7.rest_props($$props, rest_excludes4);
|
|
492
|
+
const wrapperClassName = $7.derived(() => $$props.scrollContainerProps?.class);
|
|
493
|
+
const wrapperAriaLabelledBy = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-labelledby"]));
|
|
494
|
+
const explicitWrapperAriaLabel = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-label"]));
|
|
495
|
+
const explicitWrapperRole = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.role));
|
|
496
|
+
const normalizedCaption = $7.derived(() => normalizeOptionalAttribute($$props.caption));
|
|
497
|
+
const wrapperAriaLabel = $7.derived(() => $7.get(explicitWrapperAriaLabel) ?? ($7.get(wrapperAriaLabelledBy) ? undefined : $7.get(normalizedCaption) ? `${$7.get(normalizedCaption)} table scroll area` : undefined));
|
|
498
|
+
const wrapperRole = $7.derived(() => $7.get(explicitWrapperRole) ?? ($7.get(wrapperAriaLabel) || $7.get(wrapperAriaLabelledBy) ? "region" : undefined));
|
|
499
|
+
const wrapperTabindex = $7.derived(() => normalizeOptionalTabindex($$props.scrollContainerProps?.tabindex) ?? 0);
|
|
500
|
+
function normalizeOptionalAttribute(value) {
|
|
501
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
502
|
+
}
|
|
503
|
+
function normalizeOptionalTabindex(value) {
|
|
504
|
+
if (typeof value === "number" && Number.isInteger(value))
|
|
505
|
+
return value;
|
|
506
|
+
if (typeof value !== "string")
|
|
507
|
+
return;
|
|
508
|
+
const normalizedValue = value.trim();
|
|
509
|
+
if (!/^-?\d+$/.test(normalizedValue))
|
|
510
|
+
return;
|
|
511
|
+
return Number(normalizedValue);
|
|
512
|
+
}
|
|
457
513
|
let captionHeight = $7.state(0);
|
|
458
514
|
const measureCaption = useResizeObserver((entries) => {
|
|
459
515
|
const entry = entries[0];
|
|
@@ -480,36 +536,37 @@ function Table($$anchor, $$props) {
|
|
|
480
536
|
},
|
|
481
537
|
onsortchange
|
|
482
538
|
});
|
|
483
|
-
var
|
|
484
|
-
$7.
|
|
485
|
-
...rest,
|
|
486
|
-
class: $0,
|
|
487
|
-
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
488
|
-
"data-cinder-density": density(),
|
|
489
|
-
"data-cinder-selectable": selectable() || undefined,
|
|
490
|
-
[$7.STYLE]: {
|
|
491
|
-
"--cinder-table-caption-height": $$props.caption ? `${$7.get(captionHeight)}px` : undefined
|
|
492
|
-
}
|
|
493
|
-
}), [() => classNames("cinder-table", $$props.class)]);
|
|
494
|
-
var node = $7.child(table);
|
|
539
|
+
var fragment = $7.comment();
|
|
540
|
+
var node_2 = $7.first_child(fragment);
|
|
495
541
|
{
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
542
|
+
var consequent_1 = ($$anchor2) => {
|
|
543
|
+
var div = root_22();
|
|
544
|
+
$7.attribute_effect(div, ($0) => ({
|
|
545
|
+
...$$props.scrollContainerProps,
|
|
546
|
+
class: $0,
|
|
547
|
+
role: $7.get(wrapperRole),
|
|
548
|
+
"aria-label": $7.get(wrapperAriaLabel),
|
|
549
|
+
"aria-labelledby": $7.get(wrapperAriaLabelledBy),
|
|
550
|
+
tabindex: $7.get(wrapperTabindex)
|
|
551
|
+
}), [
|
|
552
|
+
() => classNames("cinder-table-scroll", $7.get(wrapperClassName))
|
|
553
|
+
]);
|
|
554
|
+
var node_3 = $7.child(div);
|
|
555
|
+
table(node_3);
|
|
556
|
+
$7.reset(div);
|
|
557
|
+
$7.append($$anchor2, div);
|
|
503
558
|
};
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
559
|
+
var alternate = ($$anchor2) => {
|
|
560
|
+
table($$anchor2);
|
|
561
|
+
};
|
|
562
|
+
$7.if(node_2, ($$render) => {
|
|
563
|
+
if (scrollable())
|
|
564
|
+
$$render(consequent_1);
|
|
565
|
+
else
|
|
566
|
+
$$render(alternate, -1);
|
|
507
567
|
});
|
|
508
568
|
}
|
|
509
|
-
|
|
510
|
-
$7.snippet(node_1, () => $$props.children);
|
|
511
|
-
$7.reset(table);
|
|
512
|
-
$7.append($$anchor, table);
|
|
569
|
+
$7.append($$anchor, fragment);
|
|
513
570
|
$7.pop();
|
|
514
571
|
}
|
|
515
572
|
|
|
@@ -527,4 +584,4 @@ export {
|
|
|
527
584
|
Table2 as Table
|
|
528
585
|
};
|
|
529
586
|
|
|
530
|
-
//# debugId=
|
|
587
|
+
//# debugId=5ED75768E933CF7864756E2164756E21
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
min-inline-size: max-content;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.cinder-table-scroll:focus-visible {
|
|
40
|
+
outline: var(--cinder-ring-width) solid transparent;
|
|
41
|
+
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
.cinder-table__caption {
|
|
40
45
|
caption-side: top;
|
|
41
46
|
text-align: left;
|
|
@@ -163,6 +168,12 @@
|
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
@media (forced-colors: active) {
|
|
171
|
+
.cinder-table-scroll:focus-visible {
|
|
172
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
173
|
+
outline-offset: 3px;
|
|
174
|
+
box-shadow: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
166
177
|
.cinder-table__sort-button:focus-visible {
|
|
167
178
|
outline: var(--cinder-ring-width) solid ButtonText;
|
|
168
179
|
/* 2px is correct here: sort-button has border:none so there is no
|
|
@@ -72,6 +72,10 @@ var schema = {
|
|
|
72
72
|
type: "boolean",
|
|
73
73
|
description: "Enables the leading selection column on the entire table. When true:\n- The single `TableRow` inside `TableHeader` renders a leading `<th>`\n with a select-all checkbox sourced from the header's props.\n- Every `TableRow` inside `TableBody` renders a leading selection cell.\nSelection is strictly controlled — the consumer owns all selection state."
|
|
74
74
|
},
|
|
75
|
+
scrollable: {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
description: "When true, wraps the table in a `.cinder-table-scroll` container that\nenables horizontal overflow scrolling for dense or unknown-width tables.\nUse this instead of manually wrapping Table in `.cinder-table-scroll`.\n\nWhen combined with `stickyHeader`, the generated wrapper is the sticky\nheader's scroll container. Set a bounded block size on `scrollContainerProps`\nwhen the table should scroll vertically inside that wrapper."
|
|
78
|
+
},
|
|
75
79
|
class: {
|
|
76
80
|
type: "string",
|
|
77
81
|
description: "Additional class names merged with `.cinder-table`."
|
|
@@ -86,6 +90,11 @@ var schema = {
|
|
|
86
90
|
required: true,
|
|
87
91
|
description: "TableHeader, TableBody, etc."
|
|
88
92
|
},
|
|
93
|
+
{
|
|
94
|
+
name: "scrollContainerProps",
|
|
95
|
+
reason: "unknown-shape",
|
|
96
|
+
description: "Attributes forwarded to the generated `.cinder-table-scroll` wrapper when\n`scrollable` is true. The wrapper is focusable by default so keyboard users\ncan scroll read-only wide tables. When the table has a caption, or when\n`aria-label` or `aria-labelledby` is provided here, the wrapper becomes a\nnamed `region`; pass `role` or `tabindex` here to override those defaults."
|
|
97
|
+
},
|
|
89
98
|
{
|
|
90
99
|
name: "sort",
|
|
91
100
|
reason: "unknown-shape",
|
|
@@ -99,4 +108,4 @@ export {
|
|
|
99
108
|
table_schema_default as default
|
|
100
109
|
};
|
|
101
110
|
|
|
102
|
-
//# debugId=
|
|
111
|
+
//# debugId=F081B153ACEAE13964756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLTableAttributes } from 'svelte/elements';
|
|
2
|
+
import type { HTMLAttributes, HTMLTableAttributes } from 'svelte/elements';
|
|
3
3
|
/** Sort direction. */
|
|
4
4
|
export type SortDirection = 'ascending' | 'descending';
|
|
5
5
|
/** Bound sort state shape. */
|
|
@@ -40,6 +40,11 @@ export type TableContext = {
|
|
|
40
40
|
/** Mirror of Table.selectable. Set synchronously at construction time. */
|
|
41
41
|
readonly selectionEnabled?: boolean;
|
|
42
42
|
};
|
|
43
|
+
/** Attributes forwarded to Table's generated scroll wrapper. */
|
|
44
|
+
export type TableScrollContainerProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
|
|
45
|
+
/** Additional class names merged with `.cinder-table-scroll`. */
|
|
46
|
+
class?: string;
|
|
47
|
+
};
|
|
43
48
|
/**
|
|
44
49
|
* Props for the Table component.
|
|
45
50
|
*
|
|
@@ -75,6 +80,24 @@ export type TableProps = Omit<HTMLTableAttributes, 'class'> & {
|
|
|
75
80
|
* Selection is strictly controlled — the consumer owns all selection state.
|
|
76
81
|
*/
|
|
77
82
|
selectable?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* When true, wraps the table in a `.cinder-table-scroll` container that
|
|
85
|
+
* enables horizontal overflow scrolling for dense or unknown-width tables.
|
|
86
|
+
* Use this instead of manually wrapping Table in `.cinder-table-scroll`.
|
|
87
|
+
*
|
|
88
|
+
* When combined with `stickyHeader`, the generated wrapper is the sticky
|
|
89
|
+
* header's scroll container. Set a bounded block size on `scrollContainerProps`
|
|
90
|
+
* when the table should scroll vertically inside that wrapper.
|
|
91
|
+
*/
|
|
92
|
+
scrollable?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Attributes forwarded to the generated `.cinder-table-scroll` wrapper when
|
|
95
|
+
* `scrollable` is true. The wrapper is focusable by default so keyboard users
|
|
96
|
+
* can scroll read-only wide tables. When the table has a caption, or when
|
|
97
|
+
* `aria-label` or `aria-labelledby` is provided here, the wrapper becomes a
|
|
98
|
+
* named `region`; pass `role` or `tabindex` here to override those defaults.
|
|
99
|
+
*/
|
|
100
|
+
scrollContainerProps?: TableScrollContainerProps;
|
|
78
101
|
/** Additional class names merged with `.cinder-table`. */
|
|
79
102
|
class?: string;
|
|
80
103
|
/** TableHeader, TableBody, etc. */
|
|
@@ -67,8 +67,10 @@
|
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
position: relative;
|
|
69
69
|
display: inline-flex;
|
|
70
|
+
flex-shrink: 0;
|
|
70
71
|
align-items: center;
|
|
71
72
|
gap: var(--cinder-space-2);
|
|
73
|
+
white-space: nowrap;
|
|
72
74
|
border-radius: var(--cinder-radius-sm) var(--cinder-radius-sm) 0 0;
|
|
73
75
|
transition:
|
|
74
76
|
color var(--cinder-duration-fast) var(--cinder-ease-standard),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @useWhen Collecting multi-line prose such as comments, descriptions, or messages.
|
|
9
9
|
* @useWhen Surfacing a remaining-character counter as the user types against a maxlength.
|
|
10
10
|
* @avoidWhen Collecting a single short line of text — use input instead.
|
|
11
|
-
* @related input
|
|
11
|
+
* @related input
|
|
12
12
|
*/
|
|
13
13
|
export type { TextareaProps } from './textarea.types.ts';
|
|
14
14
|
import type { TextareaProps } from './textarea.types.ts';
|
|
@@ -380,7 +380,7 @@ function Toast_region($$anchor, $$props) {
|
|
|
380
380
|
let returnFocusElement = null;
|
|
381
381
|
let generationCounter = 0;
|
|
382
382
|
function isPolite(variant) {
|
|
383
|
-
return variant === "info" || variant === "success";
|
|
383
|
+
return variant === "info" || variant === "success" || variant === "warning";
|
|
384
384
|
}
|
|
385
385
|
function getCurrentStack(variant) {
|
|
386
386
|
return isPolite(variant) ? $2.get(politeStack) : $2.get(assertiveStack);
|
|
@@ -878,4 +878,4 @@ export {
|
|
|
878
878
|
Toast_region as ToastRegion
|
|
879
879
|
};
|
|
880
880
|
|
|
881
|
-
//# debugId=
|
|
881
|
+
//# debugId=77F4E221C75B7BFC64756E2164756E21
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
z-index: var(--cinder-z-toast);
|
|
16
16
|
pointer-events: none;
|
|
17
17
|
/* Stack the two aria-live channels in the same visual column. Each channel
|
|
18
|
-
* is independent — a polite
|
|
18
|
+
* is independent — a polite warning and an assertive danger toast may sit
|
|
19
19
|
* side-by-side visually but route to different SR-announcement queues. */
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -341,7 +341,6 @@ function createBarModel(options) {
|
|
|
341
341
|
assertValidChartNumber("bar-chart", "invalid-height", height, "height");
|
|
342
342
|
assertValidTickCount("bar-chart", xAxis);
|
|
343
343
|
assertValidTickCount("bar-chart", yAxis);
|
|
344
|
-
const geometry = createGeometry(width, height);
|
|
345
344
|
const categories = [];
|
|
346
345
|
const seenCategories = new Set;
|
|
347
346
|
const categoryKinds = new Set;
|
|
@@ -381,6 +380,9 @@ function createBarModel(options) {
|
|
|
381
380
|
throw new Error(`[cinder/bar-chart] rule=mixed-bar-category-kind key="${categoryKey}": category values must share one domain kind.`);
|
|
382
381
|
}
|
|
383
382
|
const sortedCategories = sortXValues(categories);
|
|
383
|
+
const categoryLabels = sortedCategories.map((category, index) => formatXValue(category, orientation === "vertical" ? xAxis : yAxis, { index }));
|
|
384
|
+
const horizontalCategoryLabelLayout = orientation === "horizontal" ? createHorizontalCategoryLabelLayout(categoryLabels, width) : undefined;
|
|
385
|
+
const geometry = createGeometry(width, height, horizontalCategoryLabelLayout?.marginLeft);
|
|
384
386
|
const valueDomain = createPaddedDomain(mode === "stacked" ? createStackedBarDomainValues(datumByKey, sortedCategories, visibleSeries) : visibleValues);
|
|
385
387
|
if (sortedCategories.length === 0) {
|
|
386
388
|
const tickAxis = orientation === "vertical" ? yAxis : xAxis;
|
|
@@ -403,8 +405,9 @@ function createBarModel(options) {
|
|
|
403
405
|
const categoryPosition = categoryScale(category.key) ?? 0;
|
|
404
406
|
return {
|
|
405
407
|
categoryKey: category.key,
|
|
406
|
-
label:
|
|
407
|
-
|
|
408
|
+
label: horizontalCategoryLabelLayout?.labels[index] ?? categoryLabels[index] ?? category.label,
|
|
409
|
+
fullLabel: categoryLabels[index] ?? category.label,
|
|
410
|
+
x: orientation === "vertical" ? categoryPosition + categoryScale.bandwidth() / 2 : -HORIZONTAL_CATEGORY_LABEL_GAP,
|
|
408
411
|
y: orientation === "vertical" ? geometry.plotHeight + 20 : categoryPosition + categoryScale.bandwidth() / 2
|
|
409
412
|
};
|
|
410
413
|
});
|
|
@@ -568,11 +571,15 @@ function nearestTarget(targets, x, y, axis = "x") {
|
|
|
568
571
|
function legendVisible(legendPosition, seriesCount) {
|
|
569
572
|
return legendPosition !== "none" && seriesCount > 0;
|
|
570
573
|
}
|
|
571
|
-
|
|
574
|
+
var DEFAULT_CHART_MARGIN_LEFT = 48;
|
|
575
|
+
var HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH = 12;
|
|
576
|
+
var HORIZONTAL_CATEGORY_LABEL_GAP = 8;
|
|
577
|
+
var HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING = 8;
|
|
578
|
+
var MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION = 0.4;
|
|
579
|
+
function createGeometry(width, height, marginLeft = DEFAULT_CHART_MARGIN_LEFT) {
|
|
572
580
|
const marginTop = 16;
|
|
573
581
|
const marginRight = 16;
|
|
574
582
|
const marginBottom = 36;
|
|
575
|
-
const marginLeft = 48;
|
|
576
583
|
return {
|
|
577
584
|
plotWidth: Math.max(1, width - marginLeft - marginRight),
|
|
578
585
|
plotHeight: Math.max(1, height - marginTop - marginBottom),
|
|
@@ -582,6 +589,33 @@ function createGeometry(width, height) {
|
|
|
582
589
|
marginLeft
|
|
583
590
|
};
|
|
584
591
|
}
|
|
592
|
+
function createHorizontalCategoryLabelLayout(labels, chartWidth) {
|
|
593
|
+
const maximumMarginLeft = Math.max(DEFAULT_CHART_MARGIN_LEFT, Math.floor(chartWidth * MAXIMUM_HORIZONTAL_CATEGORY_LABEL_FRACTION));
|
|
594
|
+
let longestLabelWidth = 0;
|
|
595
|
+
for (const label of labels) {
|
|
596
|
+
longestLabelWidth = Math.max(longestLabelWidth, estimateHorizontalCategoryLabelWidth(label));
|
|
597
|
+
}
|
|
598
|
+
const requestedMarginLeft = longestLabelWidth + HORIZONTAL_CATEGORY_LABEL_GAP + HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING;
|
|
599
|
+
const marginLeft = Math.min(maximumMarginLeft, Math.max(DEFAULT_CHART_MARGIN_LEFT, requestedMarginLeft));
|
|
600
|
+
const availableLabelWidth = Math.max(0, marginLeft - HORIZONTAL_CATEGORY_LABEL_GAP - HORIZONTAL_CATEGORY_LABEL_OUTER_PADDING);
|
|
601
|
+
return {
|
|
602
|
+
marginLeft,
|
|
603
|
+
labels: labels.map((label) => truncateHorizontalCategoryLabel(label, availableLabelWidth))
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function estimateHorizontalCategoryLabelWidth(label) {
|
|
607
|
+
return Array.from(label).length * HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH;
|
|
608
|
+
}
|
|
609
|
+
function truncateHorizontalCategoryLabel(label, availableWidth) {
|
|
610
|
+
if (estimateHorizontalCategoryLabelWidth(label) <= availableWidth)
|
|
611
|
+
return label;
|
|
612
|
+
const availableCharacterCount = Math.floor(availableWidth / HORIZONTAL_CATEGORY_LABEL_CHARACTER_WIDTH);
|
|
613
|
+
if (availableCharacterCount <= 0)
|
|
614
|
+
return "";
|
|
615
|
+
if (availableCharacterCount === 1)
|
|
616
|
+
return "…";
|
|
617
|
+
return `${Array.from(label).slice(0, availableCharacterCount - 1).join("")}…`;
|
|
618
|
+
}
|
|
585
619
|
function normalizeNumericValue(componentId, seriesId, xLabel, value) {
|
|
586
620
|
if (value === null || value === undefined)
|
|
587
621
|
return null;
|
|
@@ -1094,4 +1128,4 @@ export {
|
|
|
1094
1128
|
Waveform
|
|
1095
1129
|
};
|
|
1096
1130
|
|
|
1097
|
-
//# debugId=
|
|
1131
|
+
//# debugId=C74244E5C00154BB64756E2164756E21
|