@tai42/studio-sdk 15.0.0 → 16.0.1
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/dist/components/explorer-body.d.ts +49 -0
- package/dist/components/explorer-body.d.ts.map +1 -0
- package/dist/components/explorer-body.js +67 -0
- package/dist/components/explorer-body.js.map +1 -0
- package/dist/components/explorer-page-size.d.ts +4 -0
- package/dist/components/explorer-page-size.d.ts.map +1 -0
- package/dist/components/explorer-page-size.js +36 -0
- package/dist/components/explorer-page-size.js.map +1 -0
- package/dist/components/explorer-tag-filter.d.ts +17 -0
- package/dist/components/explorer-tag-filter.d.ts.map +1 -0
- package/dist/components/explorer-tag-filter.js +29 -0
- package/dist/components/explorer-tag-filter.js.map +1 -0
- package/dist/components/explorer-tags.d.ts +22 -0
- package/dist/components/explorer-tags.d.ts.map +1 -0
- package/dist/components/explorer-tags.js +51 -0
- package/dist/components/explorer-tags.js.map +1 -0
- package/dist/components/explorer-view.d.ts +3 -17
- package/dist/components/explorer-view.d.ts.map +1 -1
- package/dist/components/explorer-view.js +53 -170
- package/dist/components/explorer-view.js.map +1 -1
- package/dist/components/extension-combo-builder.d.ts +0 -5
- package/dist/components/extension-combo-builder.d.ts.map +1 -1
- package/dist/components/extension-combo-builder.js +4 -42
- package/dist/components/extension-combo-builder.js.map +1 -1
- package/dist/components/extension-combo-parts.d.ts +44 -0
- package/dist/components/extension-combo-parts.d.ts.map +1 -0
- package/dist/components/extension-combo-parts.js +57 -0
- package/dist/components/extension-combo-parts.js.map +1 -0
- package/dist/components/fleet-report.d.ts.map +1 -1
- package/dist/components/fleet-report.js +51 -37
- package/dist/components/fleet-report.js.map +1 -1
- package/dist/components/icons/chrome-marks.d.ts +50 -0
- package/dist/components/icons/chrome-marks.d.ts.map +1 -0
- package/dist/components/icons/chrome-marks.js +51 -0
- package/dist/components/icons/chrome-marks.js.map +1 -0
- package/dist/components/icons/icon-frame.d.ts +29 -0
- package/dist/components/icons/icon-frame.d.ts.map +1 -0
- package/dist/components/icons/icon-frame.js +19 -0
- package/dist/components/icons/icon-frame.js.map +1 -0
- package/dist/components/icons/index.d.ts +40 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/index.js +6 -0
- package/dist/components/icons/index.js.map +1 -0
- package/dist/components/icons/nav-map.d.ts +14 -0
- package/dist/components/icons/nav-map.d.ts.map +1 -0
- package/dist/components/icons/nav-map.js +28 -0
- package/dist/components/icons/nav-map.js.map +1 -0
- package/dist/components/icons/nav-marks.d.ts +44 -0
- package/dist/components/icons/nav-marks.d.ts.map +1 -0
- package/dist/components/icons/nav-marks.js +45 -0
- package/dist/components/icons/nav-marks.js.map +1 -0
- package/dist/components/icons/status-marks.d.ts +21 -0
- package/dist/components/icons/status-marks.d.ts.map +1 -0
- package/dist/components/icons/status-marks.js +22 -0
- package/dist/components/icons/status-marks.js.map +1 -0
- package/dist/components/icons/theme-marks.d.ts +9 -0
- package/dist/components/icons/theme-marks.d.ts.map +1 -0
- package/dist/components/icons/theme-marks.js +10 -0
- package/dist/components/icons/theme-marks.js.map +1 -0
- package/dist/components/json-diff.d.ts.map +1 -1
- package/dist/components/json-diff.js +1 -3
- package/dist/components/json-diff.js.map +1 -1
- package/dist/components/json-tree-context.d.ts +13 -0
- package/dist/components/json-tree-context.d.ts.map +1 -0
- package/dist/components/json-tree-context.js +15 -0
- package/dist/components/json-tree-context.js.map +1 -0
- package/dist/components/json-tree-model.d.ts +56 -0
- package/dist/components/json-tree-model.d.ts.map +1 -0
- package/dist/components/json-tree-model.js +125 -0
- package/dist/components/json-tree-model.js.map +1 -0
- package/dist/components/json-tree-nodes.d.ts +30 -0
- package/dist/components/json-tree-nodes.d.ts.map +1 -0
- package/dist/components/json-tree-nodes.js +118 -0
- package/dist/components/json-tree-nodes.js.map +1 -0
- package/dist/components/json-tree.d.ts.map +1 -1
- package/dist/components/json-tree.js +7 -295
- package/dist/components/json-tree.js.map +1 -1
- package/dist/components/json-value-format.d.ts +20 -0
- package/dist/components/json-value-format.d.ts.map +1 -0
- package/dist/components/json-value-format.js +63 -0
- package/dist/components/json-value-format.js.map +1 -0
- package/dist/components/markdown-blocks.d.ts +38 -0
- package/dist/components/markdown-blocks.d.ts.map +1 -0
- package/dist/components/markdown-blocks.js +168 -0
- package/dist/components/markdown-blocks.js.map +1 -0
- package/dist/components/markdown-inline.d.ts +24 -0
- package/dist/components/markdown-inline.d.ts.map +1 -0
- package/dist/components/markdown-inline.js +257 -0
- package/dist/components/markdown-inline.js.map +1 -0
- package/dist/components/markdown.d.ts +3 -52
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +4 -376
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/observer-registry.d.ts +38 -0
- package/dist/components/observer-registry.d.ts.map +1 -0
- package/dist/components/observer-registry.js +131 -0
- package/dist/components/observer-registry.js.map +1 -0
- package/dist/components/overflow-measure.d.ts +38 -0
- package/dist/components/overflow-measure.d.ts.map +1 -0
- package/dist/components/overflow-measure.js +54 -0
- package/dist/components/overflow-measure.js.map +1 -0
- package/dist/components/prose-regions.d.ts +81 -0
- package/dist/components/prose-regions.d.ts.map +1 -0
- package/dist/components/prose-regions.js +128 -0
- package/dist/components/prose-regions.js.map +1 -0
- package/dist/components/scroll-region.d.ts.map +1 -1
- package/dist/components/scroll-region.js +3 -298
- package/dist/components/scroll-region.js.map +1 -1
- package/dist/components/tab-stop-parse.d.ts +53 -0
- package/dist/components/tab-stop-parse.d.ts.map +1 -0
- package/dist/components/tab-stop-parse.js +202 -0
- package/dist/components/tab-stop-parse.js.map +1 -0
- package/dist/components/templated-text-field.d.ts.map +1 -1
- package/dist/components/templated-text-field.js +10 -148
- package/dist/components/templated-text-field.js.map +1 -1
- package/dist/components/templated-text-kwargs-editor.d.ts +24 -0
- package/dist/components/templated-text-kwargs-editor.d.ts.map +1 -0
- package/dist/components/templated-text-kwargs-editor.js +48 -0
- package/dist/components/templated-text-kwargs-editor.js.map +1 -0
- package/dist/components/templated-text-kwargs.d.ts +37 -0
- package/dist/components/templated-text-kwargs.d.ts.map +1 -0
- package/dist/components/templated-text-kwargs.js +66 -0
- package/dist/components/templated-text-kwargs.js.map +1 -0
- package/dist/components/templated-text-source.d.ts +33 -0
- package/dist/components/templated-text-source.d.ts.map +1 -0
- package/dist/components/templated-text-source.js +53 -0
- package/dist/components/templated-text-source.js.map +1 -0
- package/dist/components/tool-picker-parts.d.ts +39 -0
- package/dist/components/tool-picker-parts.d.ts.map +1 -0
- package/dist/components/tool-picker-parts.js +87 -0
- package/dist/components/tool-picker-parts.js.map +1 -0
- package/dist/components/tool-picker.d.ts +1 -2
- package/dist/components/tool-picker.d.ts.map +1 -1
- package/dist/components/tool-picker.js +4 -66
- package/dist/components/tool-picker.js.map +1 -1
- package/dist/components/version-history-panel.d.ts.map +1 -1
- package/dist/components/version-history-panel.js +7 -34
- package/dist/components/version-history-panel.js.map +1 -1
- package/dist/components/version-history-rows.d.ts +48 -0
- package/dist/components/version-history-rows.d.ts.map +1 -0
- package/dist/components/version-history-rows.js +51 -0
- package/dist/components/version-history-rows.js.map +1 -0
- package/dist/guards.d.ts +6 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +8 -0
- package/dist/guards.js.map +1 -0
- package/dist/hooks/interactions-connection.d.ts +43 -0
- package/dist/hooks/interactions-connection.d.ts.map +1 -0
- package/dist/hooks/interactions-connection.js +171 -0
- package/dist/hooks/interactions-connection.js.map +1 -0
- package/dist/hooks/interactions-stream.d.ts +80 -0
- package/dist/hooks/interactions-stream.d.ts.map +1 -0
- package/dist/hooks/interactions-stream.js +233 -0
- package/dist/hooks/interactions-stream.js.map +1 -0
- package/dist/hooks/useApi.d.ts +2409 -2293
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useSse.d.ts +3 -6
- package/dist/hooks/useSse.d.ts.map +1 -1
- package/dist/hooks/useSse.js +38 -451
- package/dist/hooks/useSse.js.map +1 -1
- package/dist/navigation/app-link.d.ts +25 -0
- package/dist/navigation/app-link.d.ts.map +1 -0
- package/dist/navigation/app-link.js +33 -0
- package/dist/navigation/app-link.js.map +1 -0
- package/dist/navigation/context.d.ts +3 -20
- package/dist/navigation/context.d.ts.map +1 -1
- package/dist/navigation/context.js +7 -267
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/entry-state.d.ts +23 -0
- package/dist/navigation/entry-state.d.ts.map +1 -0
- package/dist/navigation/entry-state.js +39 -0
- package/dist/navigation/entry-state.js.map +1 -0
- package/dist/navigation/guard-registry.d.ts +30 -0
- package/dist/navigation/guard-registry.d.ts.map +1 -0
- package/dist/navigation/guard-registry.js +46 -0
- package/dist/navigation/guard-registry.js.map +1 -0
- package/dist/navigation/guarded-navigation.d.ts +24 -0
- package/dist/navigation/guarded-navigation.d.ts.map +1 -0
- package/dist/navigation/guarded-navigation.js +102 -0
- package/dist/navigation/guarded-navigation.js.map +1 -0
- package/dist/navigation/index.d.ts +3 -2
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +2 -1
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/types.d.ts +8 -11
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/navigation/use-back-forward-guard.d.ts +5 -0
- package/dist/navigation/use-back-forward-guard.d.ts.map +1 -0
- package/dist/navigation/use-back-forward-guard.js +82 -0
- package/dist/navigation/use-back-forward-guard.js.map +1 -0
- package/dist/plugin/registry.d.ts +6 -15
- package/dist/plugin/registry.d.ts.map +1 -1
- package/dist/plugin/registry.js +83 -75
- package/dist/plugin/registry.js.map +1 -1
- package/dist/schema-editor/SchemaEditor.d.ts +8 -1
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -1
- package/dist/schema-editor/SchemaEditor.js +2 -2
- package/dist/schema-editor/SchemaEditor.js.map +1 -1
- package/dist/schema-form/SecretRefField.d.ts +2 -3
- package/dist/schema-form/SecretRefField.d.ts.map +1 -1
- package/dist/schema-form/SecretRefField.js +23 -12
- package/dist/schema-form/SecretRefField.js.map +1 -1
- package/dist/schema-form/classify.d.ts +1 -122
- package/dist/schema-form/classify.d.ts.map +1 -1
- package/dist/schema-form/classify.js +174 -237
- package/dist/schema-form/classify.js.map +1 -1
- package/dist/schema-form/default-value.d.ts.map +1 -1
- package/dist/schema-form/default-value.js +42 -19
- package/dist/schema-form/default-value.js.map +1 -1
- package/dist/schema-form/enum-field.d.ts +1 -1
- package/dist/schema-form/enum-field.d.ts.map +1 -1
- package/dist/schema-form/field-model.d.ts +121 -0
- package/dist/schema-form/field-model.d.ts.map +1 -0
- package/dist/schema-form/field-model.js +2 -0
- package/dist/schema-form/field-model.js.map +1 -0
- package/dist/schema-form/field-node.d.ts.map +1 -1
- package/dist/schema-form/field-node.js +25 -14
- package/dist/schema-form/field-node.js.map +1 -1
- package/dist/schema-form/media-field.d.ts +1 -1
- package/dist/schema-form/media-field.d.ts.map +1 -1
- package/dist/schema-form/media-field.js +47 -28
- package/dist/schema-form/media-field.js.map +1 -1
- package/dist/schema-form/string-annotations.d.ts +20 -0
- package/dist/schema-form/string-annotations.d.ts.map +1 -0
- package/dist/schema-form/string-annotations.js +105 -0
- package/dist/schema-form/string-annotations.js.map +1 -0
- package/dist/schema-form/string-field.d.ts +1 -1
- package/dist/schema-form/string-field.d.ts.map +1 -1
- package/dist/schema-form/union-field.d.ts +1 -1
- package/dist/schema-form/union-field.d.ts.map +1 -1
- package/dist/schema-form/union-field.js.map +1 -1
- package/dist/schema-form/union.d.ts +1 -1
- package/dist/schema-form/union.d.ts.map +1 -1
- package/dist/schema-form/validate.d.ts.map +1 -1
- package/dist/schema-form/validate.js +126 -105
- package/dist/schema-form/validate.js.map +1 -1
- package/dist/state-binding/AdapterMapping.d.ts.map +1 -1
- package/dist/state-binding/AdapterMapping.js +0 -0
- package/dist/state-binding/AdapterMapping.js.map +1 -1
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -1
- package/dist/state-binding/StateAttachRow.js +52 -36
- package/dist/state-binding/StateAttachRow.js.map +1 -1
- package/dist/state-binding/adapter-mapping-row.d.ts +17 -0
- package/dist/state-binding/adapter-mapping-row.d.ts.map +1 -0
- package/dist/state-binding/adapter-mapping-row.js +87 -0
- package/dist/state-binding/adapter-mapping-row.js.map +1 -0
- package/dist/structured-output/StructuredOutput.d.ts.map +1 -1
- package/dist/structured-output/StructuredOutput.js +1 -3
- package/dist/structured-output/StructuredOutput.js.map +1 -1
- package/package.json +2 -2
- package/src/components/explorer-body.tsx +239 -0
- package/src/components/explorer-page-size.ts +39 -0
- package/src/components/explorer-tag-filter.tsx +80 -0
- package/src/components/explorer-tags.ts +64 -0
- package/src/components/explorer-view.tsx +114 -366
- package/src/components/extension-combo-builder.tsx +35 -152
- package/src/components/extension-combo-parts.tsx +237 -0
- package/src/components/fleet-report.tsx +97 -54
- package/src/components/icons/chrome-marks.tsx +195 -0
- package/src/components/icons/icon-frame.tsx +50 -0
- package/src/components/icons/index.ts +84 -0
- package/src/components/icons/nav-map.ts +55 -0
- package/src/components/icons/nav-marks.tsx +205 -0
- package/src/components/icons/status-marks.tsx +46 -0
- package/src/components/icons/theme-marks.tsx +33 -0
- package/src/components/json-diff.tsx +1 -4
- package/src/components/json-tree-context.ts +26 -0
- package/src/components/json-tree-model.ts +139 -0
- package/src/components/json-tree-nodes.tsx +224 -0
- package/src/components/json-tree.tsx +15 -434
- package/src/components/json-value-format.ts +64 -0
- package/src/components/markdown-blocks.ts +198 -0
- package/src/components/markdown-inline.tsx +365 -0
- package/src/components/markdown.tsx +5 -471
- package/src/components/observer-registry.ts +139 -0
- package/src/components/overflow-measure.ts +69 -0
- package/src/components/prose-regions.ts +153 -0
- package/src/components/scroll-region.tsx +20 -360
- package/src/components/tab-stop-parse.ts +217 -0
- package/src/components/templated-text-field.tsx +38 -330
- package/src/components/templated-text-kwargs-editor.tsx +147 -0
- package/src/components/templated-text-kwargs.ts +92 -0
- package/src/components/templated-text-source.tsx +226 -0
- package/src/components/tool-picker-parts.tsx +184 -0
- package/src/components/tool-picker.tsx +22 -114
- package/src/components/version-history-panel.tsx +38 -142
- package/src/components/version-history-rows.tsx +220 -0
- package/src/guards.ts +7 -0
- package/src/hooks/interactions-connection.ts +227 -0
- package/src/hooks/interactions-stream.ts +274 -0
- package/src/hooks/useSse.ts +50 -477
- package/src/navigation/app-link.tsx +70 -0
- package/src/navigation/context.tsx +11 -330
- package/src/navigation/entry-state.ts +42 -0
- package/src/navigation/guard-registry.ts +65 -0
- package/src/navigation/guarded-navigation.ts +147 -0
- package/src/navigation/index.ts +2 -2
- package/src/navigation/types.ts +8 -11
- package/src/navigation/use-back-forward-guard.ts +90 -0
- package/src/plugin/registry.ts +111 -90
- package/src/schema-editor/SchemaEditor.tsx +9 -1
- package/src/schema-form/SecretRefField.tsx +121 -71
- package/src/schema-form/classify.ts +244 -395
- package/src/schema-form/default-value.ts +48 -17
- package/src/schema-form/enum-field.tsx +1 -1
- package/src/schema-form/field-model.ts +133 -0
- package/src/schema-form/field-node.tsx +94 -38
- package/src/schema-form/media-field.tsx +134 -65
- package/src/schema-form/string-annotations.ts +111 -0
- package/src/schema-form/string-field.tsx +1 -1
- package/src/schema-form/union-field.tsx +2 -1
- package/src/schema-form/union.ts +1 -1
- package/src/schema-form/validate.ts +184 -103
- package/src/state-binding/AdapterMapping.tsx +0 -0
- package/src/state-binding/StateAttachRow.tsx +222 -147
- package/src/state-binding/adapter-mapping-row.tsx +232 -0
- package/src/structured-output/StructuredOutput.tsx +1 -4
- package/dist/components/icons.d.ts +0 -160
- package/dist/components/icons.d.ts.map +0 -1
- package/dist/components/icons.js +0 -160
- package/dist/components/icons.js.map +0 -1
- package/src/components/icons.tsx +0 -586
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-blocks.js","sourceRoot":"","sources":["../../src/components/markdown-blocks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,8EAA8E;AAC9E,MAAM,UAAU,GAAG,qCAAqC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,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inline grammar for `Markdown`: locating code spans, links, images, strong
|
|
3
|
+
* and emphasis runs, and resolving them to escaped React nodes. A single
|
|
4
|
+
* forward-only cursor keeps the pass linear; a link is admitted only when
|
|
5
|
+
* `safeHttpUrl` accepts it, and an image contributes its `alt` text alone.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Resolves inline markup to React nodes. A cursor walks the text once; each rule
|
|
10
|
+
* caches its earliest match at or after the cursor and is rescanned only when the
|
|
11
|
+
* cursor passes that match, so the rules' rescans cover disjoint forward ranges
|
|
12
|
+
* and the pass is linear. Plain runs are pushed as text children that React
|
|
13
|
+
* escapes; a link is admitted only when `safeHttpUrl` accepts it, and an image
|
|
14
|
+
* contributes its `alt` text alone.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderInline(text: string, keyBase: string): ReactNode[];
|
|
17
|
+
/**
|
|
18
|
+
* Test-only entry point to the inline scanner. Resolves inline markup to React
|
|
19
|
+
* nodes exactly as `renderInline` does, but without mounting or serializing a
|
|
20
|
+
* DOM, so a test can time the scan itself in isolation from render cost. Not part
|
|
21
|
+
* of the public API.
|
|
22
|
+
*/
|
|
23
|
+
export declare function scanInline(text: string): ReactNode[];
|
|
24
|
+
//# sourceMappingURL=markdown-inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-inline.d.ts","sourceRoot":"","sources":["../../src/components/markdown-inline.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAwRvC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,CA+BvE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAEpD"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { safeHttpUrl } from './primitives';
|
|
3
|
+
// Single-character predicates, so the `\S` and `\w` classes decide flanking
|
|
4
|
+
// exactly — a non-breaking space is whitespace, an underscore a word character —
|
|
5
|
+
// rather than an open-coded space test getting those edges wrong.
|
|
6
|
+
const NON_SPACE = /\S/;
|
|
7
|
+
const WORD = /\w/;
|
|
8
|
+
/** Inline code: a run of backticks and its literal, unparsed content, on one line. */
|
|
9
|
+
const CODE_SPAN = /`([^`\n]+)`/g;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the marker ending at `j` closes the pending `opener`: at least one body
|
|
12
|
+
* character in, preceded by a non-space (and, for `_`, not followed by a word
|
|
13
|
+
* character on its outer edge).
|
|
14
|
+
*/
|
|
15
|
+
function isEmphasisCloser(text, j, opener, m, underscore) {
|
|
16
|
+
return (opener !== -1 &&
|
|
17
|
+
j >= opener + m + 1 &&
|
|
18
|
+
NON_SPACE.test(text[j - 1] ?? '') &&
|
|
19
|
+
(!underscore || j + m >= text.length || !WORD.test(text[j + m] ?? '')));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether the marker at `j` opens a run: no opener pending, followed by a
|
|
23
|
+
* non-space (and, for `_`, not abutting a word character on its left).
|
|
24
|
+
*/
|
|
25
|
+
function isEmphasisOpener(text, j, opener, m, underscore) {
|
|
26
|
+
return (opener === -1 &&
|
|
27
|
+
j + m < text.length &&
|
|
28
|
+
NON_SPACE.test(text[j + m] ?? '') &&
|
|
29
|
+
(!underscore || j === 0 || !WORD.test(text[j - 1] ?? '')));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The earliest run delimited by `marker` (`**`, `__`, `*` or `_`) at or after
|
|
33
|
+
* `from`. Walks once, holding one pending opener per line and closing it at the
|
|
34
|
+
* first marker a non-space away (and, for `_`, not abutting a word character on
|
|
35
|
+
* its outer edges). One pending opener per line reproduces the leftmost lazy
|
|
36
|
+
* match, quirks and all (`***a***` yields `***a**`, and `**a*` matches none); a
|
|
37
|
+
* newline drops the opener. O(1) per character.
|
|
38
|
+
*/
|
|
39
|
+
function findEmphasisSpan(text, from, marker) {
|
|
40
|
+
const m = marker.length;
|
|
41
|
+
const mark = marker[0];
|
|
42
|
+
const underscore = mark === '_';
|
|
43
|
+
let opener = -1;
|
|
44
|
+
for (let j = from; j + m <= text.length; j += 1) {
|
|
45
|
+
const ch = text[j];
|
|
46
|
+
if (ch === '\n') {
|
|
47
|
+
opener = -1;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (ch !== mark || (m === 2 && text[j + 1] !== mark))
|
|
51
|
+
continue;
|
|
52
|
+
if (isEmphasisCloser(text, j, opener, m, underscore)) {
|
|
53
|
+
return { index: opener, length: j + m - opener, content: text.slice(opener + m, j) };
|
|
54
|
+
}
|
|
55
|
+
if (isEmphasisOpener(text, j, opener, m, underscore))
|
|
56
|
+
opener = j;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The destination run of a bracketed construct: one-or-more non-`)`, non-space
|
|
62
|
+
* characters bounded by `)`. Forward-only cursor. See {@link DestinationScan} for
|
|
63
|
+
* `end`/`stop`.
|
|
64
|
+
*/
|
|
65
|
+
function scanDestination(text, start) {
|
|
66
|
+
let k = start;
|
|
67
|
+
while (k < text.length && text[k] !== ')' && NON_SPACE.test(text[k] ?? ''))
|
|
68
|
+
k += 1;
|
|
69
|
+
if (k > start && text[k] === ')')
|
|
70
|
+
return { end: k, stop: k };
|
|
71
|
+
// A failure halts at `k`: the whitespace that stopped the walk, or `text.length`
|
|
72
|
+
// when the run reached the end. Either way `[start, k)` holds no `)`.
|
|
73
|
+
return { end: -1, stop: k };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The closing `)` for the destination of the label ending at `close`, memoized on
|
|
77
|
+
* that `]`. A destination start inside a proven no-`)` span skips the scan.
|
|
78
|
+
*/
|
|
79
|
+
function resolveDestination(text, close, memo) {
|
|
80
|
+
if (memo.destKey === close)
|
|
81
|
+
return memo.destEnd;
|
|
82
|
+
memo.destKey = close;
|
|
83
|
+
const destStart = close + 2;
|
|
84
|
+
if (memo.deadUntil !== -1 && destStart < memo.deadUntil) {
|
|
85
|
+
memo.destEnd = -1;
|
|
86
|
+
return -1;
|
|
87
|
+
}
|
|
88
|
+
const scan = scanDestination(text, destStart);
|
|
89
|
+
memo.destEnd = scan.end;
|
|
90
|
+
if (scan.end === -1 && scan.stop > destStart)
|
|
91
|
+
memo.deadUntil = scan.stop;
|
|
92
|
+
return memo.destEnd;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The bracketed span opening at `bracket` (label `start` accounts for an image's
|
|
96
|
+
* `!`), or `null` when this candidate has no non-empty label followed by a
|
|
97
|
+
* `(dest)`. Requires `memo.close` already advanced to a live `]`.
|
|
98
|
+
*/
|
|
99
|
+
function matchAt(text, bracket, start, image, memo) {
|
|
100
|
+
const labelOk = image || memo.close > bracket + 1;
|
|
101
|
+
if (!labelOk || text[memo.close + 1] !== '(')
|
|
102
|
+
return null;
|
|
103
|
+
const destEnd = resolveDestination(text, memo.close, memo);
|
|
104
|
+
if (destEnd === -1)
|
|
105
|
+
return null;
|
|
106
|
+
return {
|
|
107
|
+
index: start,
|
|
108
|
+
length: destEnd + 1 - start,
|
|
109
|
+
content: text.slice(bracket + 1, memo.close),
|
|
110
|
+
extra: text.slice(memo.close + 2, destEnd),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The earliest `[label](dest)` (or, when `image`, ``) at or after
|
|
115
|
+
* `from`. A label runs from `[` to the first `]`; a link needs a non-empty label,
|
|
116
|
+
* an image admits an empty one. Linear: each `[` candidate reuses a forward-only
|
|
117
|
+
* `]` pointer and a destination memoized on that `]`, and `deadUntil` records a
|
|
118
|
+
* proven no-`)` span so later candidates starting inside it skip the scan.
|
|
119
|
+
*/
|
|
120
|
+
function findBracketed(text, from, image) {
|
|
121
|
+
const memo = { close: -1, destKey: -1, destEnd: -1, deadUntil: -1 };
|
|
122
|
+
let bracket = text.indexOf('[', from);
|
|
123
|
+
while (bracket !== -1) {
|
|
124
|
+
// An image opens at the `!` immediately before its `[`.
|
|
125
|
+
const start = image ? bracket - 1 : bracket;
|
|
126
|
+
if (!image || (start >= from && text[start] === '!')) {
|
|
127
|
+
if (memo.close < bracket + 1)
|
|
128
|
+
memo.close = text.indexOf(']', bracket + 1);
|
|
129
|
+
if (memo.close === -1)
|
|
130
|
+
return null;
|
|
131
|
+
const span = matchAt(text, bracket, start, image, memo);
|
|
132
|
+
if (span !== null)
|
|
133
|
+
return span;
|
|
134
|
+
}
|
|
135
|
+
bracket = text.indexOf('[', bracket + 1);
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
/** Inline code at or after `from`; the shared cursor is set immediately before the scan. */
|
|
140
|
+
function findCode(text, from) {
|
|
141
|
+
CODE_SPAN.lastIndex = from;
|
|
142
|
+
const match = CODE_SPAN.exec(text);
|
|
143
|
+
if (match === null)
|
|
144
|
+
return null;
|
|
145
|
+
return { kind: 'code', index: match.index, length: match[0].length, content: match[1] ?? '' };
|
|
146
|
+
}
|
|
147
|
+
/** Tags an emphasis span with its element kind, or passes `null` through. */
|
|
148
|
+
function asFound(kind, span) {
|
|
149
|
+
return span === null
|
|
150
|
+
? null
|
|
151
|
+
: { kind, index: span.index, length: span.length, content: span.content };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Inline constructs in tie-break order at a shared position: code, image, link,
|
|
155
|
+
* strong, emphasis — so `**` reads as one strong span, not two emphasis markers.
|
|
156
|
+
* Strong and emphasis are split per marker (`**`/`__`, `*`/`_`) so each marker
|
|
157
|
+
* caches its own exhaustion and the pass stays linear; star precedes underscore.
|
|
158
|
+
*/
|
|
159
|
+
const INLINE_RULES = [
|
|
160
|
+
{ kind: 'code', find: findCode },
|
|
161
|
+
{
|
|
162
|
+
kind: 'image',
|
|
163
|
+
find: (text, from) => {
|
|
164
|
+
const span = findBracketed(text, from, true);
|
|
165
|
+
return span === null ? null : { kind: 'image', ...span };
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
kind: 'link',
|
|
170
|
+
find: (text, from) => {
|
|
171
|
+
const span = findBracketed(text, from, false);
|
|
172
|
+
return span === null ? null : { kind: 'link', ...span };
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{ kind: 'strong', find: (text, from) => asFound('strong', findEmphasisSpan(text, from, '**')) },
|
|
176
|
+
{ kind: 'strong', find: (text, from) => asFound('strong', findEmphasisSpan(text, from, '__')) },
|
|
177
|
+
{
|
|
178
|
+
kind: 'emphasis',
|
|
179
|
+
find: (text, from) => asFound('emphasis', findEmphasisSpan(text, from, '*')),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
kind: 'emphasis',
|
|
183
|
+
find: (text, from) => asFound('emphasis', findEmphasisSpan(text, from, '_')),
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
/**
|
|
187
|
+
* Resolves inline markup to React nodes. A cursor walks the text once; each rule
|
|
188
|
+
* caches its earliest match at or after the cursor and is rescanned only when the
|
|
189
|
+
* cursor passes that match, so the rules' rescans cover disjoint forward ranges
|
|
190
|
+
* and the pass is linear. Plain runs are pushed as text children that React
|
|
191
|
+
* escapes; a link is admitted only when `safeHttpUrl` accepts it, and an image
|
|
192
|
+
* contributes its `alt` text alone.
|
|
193
|
+
*/
|
|
194
|
+
export function renderInline(text, keyBase) {
|
|
195
|
+
const nodes = [];
|
|
196
|
+
// Per rule: `undefined` not yet scanned, `null` no match through the end
|
|
197
|
+
// (final), otherwise the pending match to reuse until the cursor passes it.
|
|
198
|
+
const cache = INLINE_RULES.map(() => undefined);
|
|
199
|
+
let pos = 0;
|
|
200
|
+
while (pos < text.length) {
|
|
201
|
+
let best = null;
|
|
202
|
+
for (const [r, rule] of INLINE_RULES.entries()) {
|
|
203
|
+
let hit = cache[r];
|
|
204
|
+
if (hit === undefined || (hit !== null && hit.index < pos)) {
|
|
205
|
+
hit = rule.find(text, pos);
|
|
206
|
+
cache[r] = hit;
|
|
207
|
+
}
|
|
208
|
+
if (hit !== null && (best === null || hit.index < best.index)) {
|
|
209
|
+
best = hit;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (best === null) {
|
|
213
|
+
nodes.push(text.slice(pos));
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
if (best.index > pos) {
|
|
217
|
+
nodes.push(text.slice(pos, best.index));
|
|
218
|
+
}
|
|
219
|
+
nodes.push(renderInlineMatch(best, `${keyBase}-${String(best.index)}`));
|
|
220
|
+
pos = best.index + best.length;
|
|
221
|
+
}
|
|
222
|
+
return nodes;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Test-only entry point to the inline scanner. Resolves inline markup to React
|
|
226
|
+
* nodes exactly as `renderInline` does, but without mounting or serializing a
|
|
227
|
+
* DOM, so a test can time the scan itself in isolation from render cost. Not part
|
|
228
|
+
* of the public API.
|
|
229
|
+
*/
|
|
230
|
+
export function scanInline(text) {
|
|
231
|
+
return renderInline(text, 'k');
|
|
232
|
+
}
|
|
233
|
+
function renderInlineMatch(found, key) {
|
|
234
|
+
switch (found.kind) {
|
|
235
|
+
case 'code':
|
|
236
|
+
return _jsx("code", { children: found.content }, key);
|
|
237
|
+
case 'image':
|
|
238
|
+
// Images are not rendered: the alt text is all that survives, and no URL
|
|
239
|
+
// is fetched.
|
|
240
|
+
return found.content;
|
|
241
|
+
case 'link': {
|
|
242
|
+
const url = safeHttpUrl(found.extra ?? '');
|
|
243
|
+
const children = renderInline(found.content, `${key}-t`);
|
|
244
|
+
if (url === undefined) {
|
|
245
|
+
// A destination that is not an absolute http(s) URL never becomes a live
|
|
246
|
+
// anchor: the display text is rendered as plain text.
|
|
247
|
+
return _jsx("span", { children: children }, key);
|
|
248
|
+
}
|
|
249
|
+
return (_jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer external", children: children }, key));
|
|
250
|
+
}
|
|
251
|
+
case 'strong':
|
|
252
|
+
return _jsx("strong", { children: renderInline(found.content, `${key}-t`) }, key);
|
|
253
|
+
case 'emphasis':
|
|
254
|
+
return _jsx("em", { children: renderInline(found.content, `${key}-t`) }, key);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=markdown-inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-inline.js","sourceRoot":"","sources":["../../src/components/markdown-inline.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,4EAA4E;AAC5E,iFAAiF;AACjF,kEAAkE;AAClE,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,IAAI,GAAG,IAAI,CAAC;AAElB,sFAAsF;AACtF,MAAM,SAAS,GAAG,cAAc,CAAC;AAejC;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,IAAY,EACZ,CAAS,EACT,MAAc,EACd,CAAS,EACT,UAAmB;IAEnB,OAAO,CACL,MAAM,KAAK,CAAC,CAAC;QACb,CAAC,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC;QACnB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACjC,CAAC,CAAC,UAAU,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,C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AAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,yBAAiB,KAAK,CAAC,OAAO,IAAnB,GAAG,CAAwB,CAAC;QAChD,KAAK,OAAO;YACV,yEAAyE;YACzE,cAAc;YACd,OAAO,KAAK,CAAC,OAAO,CAAC;QACvB,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC;YACzD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,yEAAyE;gBACzE,sDAAsD;gBACtD,OAAO,yBAAiB,QAAQ,IAAd,GAAG,CAAmB,CAAC;YAC3C,CAAC;YACD,OAAO,CACL,YAAa,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,8BAA8B,YACvE,QAAQ,IADH,GAAG,CAEP,CACL,CAAC;QACJ,CAAC;QACD,KAAK,QAAQ;YACX,OAAO,2BAAmB,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC,IAA7C,GAAG,CAAoD,CAAC;QAC9E,KAAK,UAAU;YACb,OAAO,uBAAe,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC,IAA7C,GAAG,CAAgD,CAAC;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -1,60 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* emphasis, lists, blockquotes, thematic breaks, links, inline and fenced code),
|
|
5
|
-
* rendered entirely through React elements and text children.
|
|
6
|
-
*
|
|
7
|
-
* SAFETY: never an HTML sink — no `dangerouslySetInnerHTML`, no raw-HTML
|
|
8
|
-
* passthrough, no network. A link is admitted only when `safeHttpUrl` accepts an
|
|
9
|
-
* absolute `http(s)` URL; every other spelling renders as plain link text.
|
|
10
|
-
* `` collapses to its `alt` text, so no source URL is fetched. Fenced
|
|
11
|
-
* code goes to `CodeBlock`, itself text-only.
|
|
12
|
-
*/
|
|
13
|
-
import { type ReactNode } from 'react';
|
|
14
|
-
/** The heading levels ATX syntax can express, `#` through `######`. */
|
|
15
|
-
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
16
|
-
/** A parsed block. Inline markup inside `text` is resolved at render time. */
|
|
17
|
-
export type MarkdownBlock = {
|
|
18
|
-
readonly type: 'heading';
|
|
19
|
-
readonly level: HeadingLevel;
|
|
20
|
-
readonly text: string;
|
|
21
|
-
} | {
|
|
22
|
-
readonly type: 'paragraph';
|
|
23
|
-
readonly text: string;
|
|
24
|
-
} | {
|
|
25
|
-
readonly type: 'code';
|
|
26
|
-
readonly language: string | undefined;
|
|
27
|
-
readonly code: string;
|
|
28
|
-
} | {
|
|
29
|
-
readonly type: 'list';
|
|
30
|
-
readonly ordered: boolean;
|
|
31
|
-
readonly items: readonly string[];
|
|
32
|
-
/** The first item's number on an ordered list, so the render can offset `<ol start>`. */
|
|
33
|
-
readonly start?: number;
|
|
34
|
-
} | {
|
|
35
|
-
readonly type: 'blockquote';
|
|
36
|
-
readonly children: readonly MarkdownBlock[];
|
|
37
|
-
} | {
|
|
38
|
-
readonly type: 'thematicBreak';
|
|
39
|
-
};
|
|
1
|
+
export type { HeadingLevel, MarkdownBlock } from './markdown-blocks';
|
|
2
|
+
export { parseMarkdown } from './markdown-blocks';
|
|
3
|
+
export { scanInline } from './markdown-inline';
|
|
40
4
|
export interface MarkdownProps {
|
|
41
5
|
/** The markdown source. Rendered as an escaped-by-construction React tree. */
|
|
42
6
|
readonly markdown: string;
|
|
43
7
|
/** Appended to `tai-prose` so a caller can position the block without losing its paint. */
|
|
44
8
|
readonly className?: string;
|
|
45
9
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Folds markdown source into an ordered list of blocks. Pure and total: any
|
|
48
|
-
* string parses, and text that matches no block construct becomes a paragraph
|
|
49
|
-
* rather than being discarded.
|
|
50
|
-
*/
|
|
51
|
-
export declare function parseMarkdown(markdown: string): MarkdownBlock[];
|
|
52
|
-
/**
|
|
53
|
-
* Test-only entry point to the inline scanner. Resolves inline markup to React
|
|
54
|
-
* nodes exactly as `renderInline` does, but without mounting or serializing a
|
|
55
|
-
* DOM, so a test can time the scan itself in isolation from render cost. Not part
|
|
56
|
-
* of the public API.
|
|
57
|
-
*/
|
|
58
|
-
export declare function scanInline(text: string): ReactNode[];
|
|
59
10
|
export declare function Markdown({ markdown, className }: MarkdownProps): import("react").JSX.Element;
|
|
60
11
|
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":"AAkBA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2FAA2F;IAC3F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAkDD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,+BAQ9D"}
|