@lapismd/mira 0.0.4 → 0.1.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 +39 -0
- package/dist/extensions/index.d.ts +13 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +13 -3
- package/dist/extensions/inline-links.d.ts +8 -0
- package/dist/extensions/inline-links.d.ts.map +1 -0
- package/dist/extensions/inline-links.js +120 -0
- package/dist/extensions/markdown-editing.d.ts +32 -0
- package/dist/extensions/markdown-editing.d.ts.map +1 -0
- package/dist/extensions/markdown-editing.js +1 -0
- package/dist/internal/codemirror/base/index.d.ts.map +1 -1
- package/dist/internal/codemirror/base/index.js +3 -0
- package/dist/internal/codemirror/markdown/index.d.ts.map +1 -1
- package/dist/internal/codemirror/markdown/index.js +2 -1
- package/dist/internal/codemirror/rich/block-controls.d.ts.map +1 -1
- package/dist/internal/codemirror/rich/block-controls.js +2 -0
- package/dist/internal/codemirror/rich/block-gutter-accessibility.d.ts +15 -0
- package/dist/internal/codemirror/rich/block-gutter-accessibility.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-gutter-accessibility.js +67 -0
- package/dist/internal/codemirror/rich/index.d.ts.map +1 -1
- package/dist/internal/codemirror/rich/index.js +43 -9
- package/dist/internal/codemirror/rich/utils/images.d.ts +6 -3
- package/dist/internal/codemirror/rich/utils/images.d.ts.map +1 -1
- package/dist/internal/codemirror/rich/utils/images.js +16 -29
- package/dist/internal/codemirror/rich/utils/references.d.ts +15 -0
- package/dist/internal/codemirror/rich/utils/references.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/references.js +86 -0
- package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts +3 -0
- package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts.map +1 -1
- package/dist/internal/codemirror/rich/widgets/preview-widgets.js +31 -3
- package/dist/internal/inline-links/icons.d.ts +115 -0
- package/dist/internal/inline-links/icons.d.ts.map +1 -0
- package/dist/internal/inline-links/icons.js +148 -0
- package/dist/internal/inline-links/live-preview.d.ts +5 -0
- package/dist/internal/inline-links/live-preview.d.ts.map +1 -0
- package/dist/internal/inline-links/live-preview.js +135 -0
- package/dist/internal/inline-links/registry.d.ts +44 -0
- package/dist/internal/inline-links/registry.d.ts.map +1 -0
- package/dist/internal/inline-links/registry.js +153 -0
- package/dist/mira.svelte.d.ts +1 -1
- package/dist/preview/asset-url-lease.d.ts +6 -0
- package/dist/preview/asset-url-lease.d.ts.map +1 -0
- package/dist/preview/asset-url-lease.js +28 -0
- package/dist/preview/components/embed.svelte +10 -5
- package/dist/preview/components/embed.svelte.d.ts.map +1 -1
- package/dist/preview/components/image.svelte +7 -2
- package/dist/preview/components/image.svelte.d.ts.map +1 -1
- package/dist/preview/components/inline-link.svelte +94 -0
- package/dist/preview/components/inline-link.svelte.d.ts +16 -0
- package/dist/preview/components/inline-link.svelte.d.ts.map +1 -0
- package/dist/preview/components/link-destination-tooltip.svelte +63 -0
- package/dist/preview/components/link-destination-tooltip.svelte.d.ts +7 -0
- package/dist/preview/components/link-destination-tooltip.svelte.d.ts.map +1 -0
- package/dist/preview/components/link-site-icon.svelte +39 -0
- package/dist/preview/components/link-site-icon.svelte.d.ts +10 -0
- package/dist/preview/components/link-site-icon.svelte.d.ts.map +1 -0
- package/dist/preview/components/link.svelte +19 -9
- package/dist/preview/components/link.svelte.d.ts.map +1 -1
- package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte +26 -10
- package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte.d.ts.map +1 -1
- package/dist/preview/editable-markdown-preview/editing-session.d.ts +15 -0
- package/dist/preview/editable-markdown-preview/editing-session.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/editing-session.js +103 -0
- package/dist/preview/editable-markdown-preview/editor-surface.svelte +13 -4
- package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts +1 -0
- package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts.map +1 -1
- package/dist/preview/editable-markdown-preview/serialized-writer.d.ts +10 -8
- package/dist/preview/editable-markdown-preview/serialized-writer.d.ts.map +1 -1
- package/dist/preview/editable-markdown-preview/serialized-writer.js +105 -6
- package/dist/preview/editable-markdown-preview.svelte +8 -6
- package/dist/preview/editable-markdown-preview.svelte.d.ts.map +1 -1
- package/dist/preview/index.d.ts +2 -0
- package/dist/preview/index.d.ts.map +1 -1
- package/dist/preview/index.js +2 -0
- package/dist/preview/markdown-preview.svelte +11 -0
- package/dist/preview/markdown-preview.svelte.d.ts.map +1 -1
- package/dist/preview/renderer/utils.js +0 -2
- package/dist/preview/styles/inline-links.css +38 -0
- package/dist/preview/styles/links-embeds-tags.css +2 -2
- package/dist/preview/styles/mermaid-highlight.css +4 -3
- package/dist/preview/styles/references.css +72 -0
- package/dist/preview/styles.css +2 -0
- package/dist/tables/editor-column.svelte +20 -7
- package/dist/tables/editor-column.svelte.d.ts +2 -0
- package/dist/tables/editor-column.svelte.d.ts.map +1 -1
- package/dist/tables/editor-table.svelte +4 -0
- package/dist/tables/editor-table.svelte.d.ts +2 -0
- package/dist/tables/editor-table.svelte.d.ts.map +1 -1
- package/dist/tables/grid-editor-column.svelte +6 -2
- package/dist/tables/grid-editor-column.svelte.d.ts +2 -0
- package/dist/tables/grid-editor-column.svelte.d.ts.map +1 -1
- package/dist/tables/grid-editor-table.svelte +4 -0
- package/dist/tables/grid-editor-table.svelte.d.ts +2 -0
- package/dist/tables/grid-editor-table.svelte.d.ts.map +1 -1
- package/dist/tables/index.d.ts +1 -0
- package/dist/tables/index.d.ts.map +1 -1
- package/dist/tables/index.js +1 -0
- package/dist/tables/markdown-table-data-cell.svelte +4 -0
- package/dist/tables/markdown-table-data-cell.svelte.d.ts +2 -0
- package/dist/tables/markdown-table-data-cell.svelte.d.ts.map +1 -1
- package/dist/tables/table-reader.svelte +101 -0
- package/dist/tables/table-reader.svelte.d.ts +21 -0
- package/dist/tables/table-reader.svelte.d.ts.map +1 -0
- package/dist/tables/types.d.ts +2 -0
- package/dist/tables/types.d.ts.map +1 -1
- package/dist/tables/widgets/grid-table-widget.d.ts +1 -1
- package/dist/tables/widgets/grid-table-widget.d.ts.map +1 -1
- package/dist/tables/widgets/grid-table-widget.js +5 -2
- package/dist/tables/widgets/lifecycle.d.ts +4 -0
- package/dist/tables/widgets/lifecycle.d.ts.map +1 -0
- package/dist/tables/widgets/lifecycle.js +13 -0
- package/dist/tables/widgets/pipe-table-widget.d.ts +1 -1
- package/dist/tables/widgets/pipe-table-widget.d.ts.map +1 -1
- package/dist/tables/widgets/pipe-table-widget.js +5 -2
- package/dist/ui/context-menu/context-menu-radio-group.svelte.d.ts +1 -1
- package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
- package/dist/ui/toolbar/toolbar-group.svelte.d.ts +1 -1
- package/inline-links-NOTICE.md +31 -0
- package/package.json +6 -2
- package/dist/core/code-mirror.test.d.ts +0 -2
- package/dist/core/code-mirror.test.d.ts.map +0 -1
- package/dist/core/code-mirror.test.js +0 -68
- package/dist/core/images.test.d.ts +0 -2
- package/dist/core/images.test.d.ts.map +0 -1
- package/dist/core/images.test.js +0 -109
- package/dist/core/index.test.d.ts +0 -2
- package/dist/core/index.test.d.ts.map +0 -1
- package/dist/core/index.test.js +0 -11
- package/dist/core/markdown-actions.test.d.ts +0 -2
- package/dist/core/markdown-actions.test.d.ts.map +0 -1
- package/dist/core/markdown-actions.test.js +0 -182
- package/dist/extensions/doodle-dividers.test.d.ts +0 -2
- package/dist/extensions/doodle-dividers.test.d.ts.map +0 -1
- package/dist/extensions/doodle-dividers.test.js +0 -296
- package/dist/extensions/index.test.d.ts +0 -2
- package/dist/extensions/index.test.d.ts.map +0 -1
- package/dist/extensions/index.test.js +0 -283
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -64
- package/dist/internal/appearance-context.test.d.ts +0 -2
- package/dist/internal/appearance-context.test.d.ts.map +0 -1
- package/dist/internal/appearance-context.test.js +0 -31
- package/dist/internal/codemirror/base/index.test.d.ts +0 -2
- package/dist/internal/codemirror/base/index.test.d.ts.map +0 -1
- package/dist/internal/codemirror/base/index.test.js +0 -303
- package/dist/internal/codemirror/base/search.test.d.ts +0 -2
- package/dist/internal/codemirror/base/search.test.d.ts.map +0 -1
- package/dist/internal/codemirror/base/search.test.js +0 -155
- package/dist/internal/codemirror/base/selection-toolbar.test.d.ts +0 -2
- package/dist/internal/codemirror/base/selection-toolbar.test.d.ts.map +0 -1
- package/dist/internal/codemirror/base/selection-toolbar.test.js +0 -149
- package/dist/internal/codemirror/markdown/authoring.test.d.ts +0 -2
- package/dist/internal/codemirror/markdown/authoring.test.d.ts.map +0 -1
- package/dist/internal/codemirror/markdown/authoring.test.js +0 -222
- package/dist/internal/codemirror/markdown/index.test.d.ts +0 -2
- package/dist/internal/codemirror/markdown/index.test.d.ts.map +0 -1
- package/dist/internal/codemirror/markdown/index.test.js +0 -158
- package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts +0 -2
- package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts.map +0 -1
- package/dist/internal/codemirror/markdown/showcase-fixture.test.js +0 -50
- package/dist/internal/codemirror/rich/block-controls.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/block-controls.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/block-controls.test.js +0 -401
- package/dist/internal/codemirror/rich/block-ranges.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/block-ranges.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/block-ranges.test.js +0 -310
- package/dist/internal/codemirror/rich/block-toolbar.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/block-toolbar.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/block-toolbar.test.js +0 -178
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.js +0 -8
- package/dist/internal/codemirror/rich/index.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/index.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/index.test.js +0 -607
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.js +0 -82
- package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/fenced-code.test.js +0 -12
- package/dist/internal/codemirror/rich/utils/headings.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/headings.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/headings.test.js +0 -27
- package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/height-estimates.test.js +0 -10
- package/dist/internal/codemirror/rich/utils/images.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/images.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/images.test.js +0 -37
- package/dist/internal/codemirror/rich/utils/indent.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/indent.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/indent.test.js +0 -169
- package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/inline-math.test.js +0 -15
- package/dist/internal/codemirror/rich/utils/links.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/links.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/links.test.js +0 -28
- package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/list-callouts.test.js +0 -47
- package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/measured-indent.test.js +0 -102
- package/dist/internal/codemirror/rich/utils/ranges.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/ranges.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/ranges.test.js +0 -22
- package/dist/internal/codemirror/rich/utils/tasks.test.d.ts +0 -2
- package/dist/internal/codemirror/rich/utils/tasks.test.d.ts.map +0 -1
- package/dist/internal/codemirror/rich/utils/tasks.test.js +0 -57
- package/dist/internal/task-states.test.d.ts +0 -2
- package/dist/internal/task-states.test.d.ts.map +0 -1
- package/dist/internal/task-states.test.js +0 -36
- package/dist/mira-code-editor.test.d.ts +0 -2
- package/dist/mira-code-editor.test.d.ts.map +0 -1
- package/dist/mira-code-editor.test.js +0 -93
- package/dist/mode-position.test.d.ts +0 -2
- package/dist/mode-position.test.d.ts.map +0 -1
- package/dist/mode-position.test.js +0 -60
- package/dist/preview/code-language.test.d.ts +0 -2
- package/dist/preview/code-language.test.d.ts.map +0 -1
- package/dist/preview/code-language.test.js +0 -12
- package/dist/preview/components/icon.test.d.ts +0 -2
- package/dist/preview/components/icon.test.d.ts.map +0 -1
- package/dist/preview/components/icon.test.js +0 -20
- package/dist/preview/editable-markdown-preview/behavior.test.d.ts +0 -2
- package/dist/preview/editable-markdown-preview/behavior.test.d.ts.map +0 -1
- package/dist/preview/editable-markdown-preview/behavior.test.js +0 -36
- package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts +0 -2
- package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts.map +0 -1
- package/dist/preview/editable-markdown-preview/serialized-writer.test.js +0 -59
- package/dist/preview/embed-target.test.d.ts +0 -2
- package/dist/preview/embed-target.test.d.ts.map +0 -1
- package/dist/preview/embed-target.test.js +0 -78
- package/dist/preview/frontmatter/frontmatter.test.d.ts +0 -2
- package/dist/preview/frontmatter/frontmatter.test.d.ts.map +0 -1
- package/dist/preview/frontmatter/frontmatter.test.js +0 -190
- package/dist/preview/frontmatter/suggestions.test.d.ts +0 -2
- package/dist/preview/frontmatter/suggestions.test.d.ts.map +0 -1
- package/dist/preview/frontmatter/suggestions.test.js +0 -45
- package/dist/preview/outline.test.d.ts +0 -2
- package/dist/preview/outline.test.d.ts.map +0 -1
- package/dist/preview/outline.test.js +0 -98
- package/dist/preview/portable-surfaces.test.d.ts +0 -2
- package/dist/preview/portable-surfaces.test.d.ts.map +0 -1
- package/dist/preview/portable-surfaces.test.js +0 -513
- package/dist/preview/preview.test.d.ts +0 -2
- package/dist/preview/preview.test.d.ts.map +0 -1
- package/dist/preview/preview.test.js +0 -154
- package/dist/preview/remark/callouts.test.d.ts +0 -2
- package/dist/preview/remark/callouts.test.d.ts.map +0 -1
- package/dist/preview/remark/callouts.test.js +0 -23
- package/dist/preview/remark/custom-checklists.test.d.ts +0 -2
- package/dist/preview/remark/custom-checklists.test.d.ts.map +0 -1
- package/dist/preview/remark/custom-checklists.test.js +0 -51
- package/dist/preview/remark/links.test.d.ts +0 -2
- package/dist/preview/remark/links.test.d.ts.map +0 -1
- package/dist/preview/remark/links.test.js +0 -62
- package/dist/preview/remark/parity.test.d.ts +0 -2
- package/dist/preview/remark/parity.test.d.ts.map +0 -1
- package/dist/preview/remark/parity.test.js +0 -105
- package/dist/preview/styles/frontmatter-properties.test.d.ts +0 -2
- package/dist/preview/styles/frontmatter-properties.test.d.ts.map +0 -1
- package/dist/preview/styles/frontmatter-properties.test.js +0 -57
- package/dist/preview/styles/source-mode.test.d.ts +0 -2
- package/dist/preview/styles/source-mode.test.d.ts.map +0 -1
- package/dist/preview/styles/source-mode.test.js +0 -28
- package/dist/tables/extension.test.d.ts +0 -2
- package/dist/tables/extension.test.d.ts.map +0 -1
- package/dist/tables/extension.test.js +0 -100
- package/dist/tables/grid-editor-column.test.d.ts +0 -2
- package/dist/tables/grid-editor-column.test.d.ts.map +0 -1
- package/dist/tables/grid-editor-column.test.js +0 -27
- package/dist/tables/grid-table.test.d.ts +0 -2
- package/dist/tables/grid-table.test.d.ts.map +0 -1
- package/dist/tables/grid-table.test.js +0 -140
- package/dist/tables/index.test.d.ts +0 -2
- package/dist/tables/index.test.d.ts.map +0 -1
- package/dist/tables/index.test.js +0 -7
- package/dist/tables/inline-editor-extensions.test.d.ts +0 -2
- package/dist/tables/inline-editor-extensions.test.d.ts.map +0 -1
- package/dist/tables/inline-editor-extensions.test.js +0 -23
- package/dist/tables/pipe-table.test.d.ts +0 -2
- package/dist/tables/pipe-table.test.d.ts.map +0 -1
- package/dist/tables/pipe-table.test.js +0 -13
- package/dist/tables/table-node.test.d.ts +0 -2
- package/dist/tables/table-node.test.d.ts.map +0 -1
- package/dist/tables/table-node.test.js +0 -167
- package/dist/tables/widgets/source-button.test.d.ts +0 -2
- package/dist/tables/widgets/source-button.test.d.ts.map +0 -1
- package/dist/tables/widgets/source-button.test.js +0 -11
- package/dist/themes/theme-contract.test.d.ts +0 -2
- package/dist/themes/theme-contract.test.d.ts.map +0 -1
- package/dist/themes/theme-contract.test.js +0 -88
- package/dist/ui/index.test.d.ts +0 -2
- package/dist/ui/index.test.d.ts.map +0 -1
- package/dist/ui/index.test.js +0 -7
- package/dist/ui/styles.test.d.ts +0 -2
- package/dist/ui/styles.test.d.ts.map +0 -1
- package/dist/ui/styles.test.js +0 -26
- package/dist/ui/table-dnd/table-dnd-utils.test.d.ts +0 -2
- package/dist/ui/table-dnd/table-dnd-utils.test.d.ts.map +0 -1
- package/dist/ui/table-dnd/table-dnd-utils.test.js +0 -46
|
@@ -8,7 +8,8 @@ import { codeBlockLineDecorations } from "./utils/code-block-lines";
|
|
|
8
8
|
import { getFencedCodeLanguage } from "./utils/fenced-code";
|
|
9
9
|
import { getAtxHeadingMarkerRange, selectionTouchesLine, } from "./utils/headings";
|
|
10
10
|
import { getTaskMarkerRange, selectionTouchesTaskMarker } from "./utils/tasks";
|
|
11
|
-
import { findMarkdownImageRanges, isStandaloneMarkdownImageLine, resolveMarkdownImageWidgetSource, } from "./utils/images";
|
|
11
|
+
import { findMarkdownImageRanges, isStandaloneMarkdownImageLine, resolveMarkdownImageWidgetSource, markdownImageReferenceLabel, } from "./utils/images";
|
|
12
|
+
import { markdownReferenceDefinitions } from "./utils/references";
|
|
12
13
|
import { findInlineCodeRanges, isPositionInsideRanges, } from "./utils/inline-code";
|
|
13
14
|
import { findInlineMathRanges } from "./utils/inline-math";
|
|
14
15
|
import { indentGuideDecorations } from "./utils/indent";
|
|
@@ -231,6 +232,26 @@ function buildBlockPreviewDecorations(state, options) {
|
|
|
231
232
|
return false;
|
|
232
233
|
},
|
|
233
234
|
});
|
|
235
|
+
for (const reference of markdownReferenceDefinitions(state.doc)) {
|
|
236
|
+
const from = state.doc.lineAt(reference.from).from;
|
|
237
|
+
const to = state.doc.lineAt(reference.to).to;
|
|
238
|
+
if (rangeContainsSelectionCursor(state, from, to) ||
|
|
239
|
+
replacedRanges.some((range) => rangesOverlap(range, { from, to })))
|
|
240
|
+
continue;
|
|
241
|
+
ranges.push(Decoration.replace({
|
|
242
|
+
block: true,
|
|
243
|
+
widget: new BlockPreviewWidget({
|
|
244
|
+
from,
|
|
245
|
+
to,
|
|
246
|
+
markdown: reference.markdown,
|
|
247
|
+
nodeName: "ReferenceDefinition",
|
|
248
|
+
referenceLabel: reference.label,
|
|
249
|
+
referenceImage: reference.image,
|
|
250
|
+
options,
|
|
251
|
+
}),
|
|
252
|
+
}).range(from, to));
|
|
253
|
+
replacedRanges.push({ from, to });
|
|
254
|
+
}
|
|
234
255
|
for (let lineNumber = 1; lineNumber <= state.doc.lines; lineNumber += 1) {
|
|
235
256
|
const line = state.doc.line(lineNumber);
|
|
236
257
|
const standaloneEmbed = isStandaloneEmbedLine(line.text);
|
|
@@ -246,7 +267,7 @@ function buildBlockPreviewDecorations(state, options) {
|
|
|
246
267
|
}
|
|
247
268
|
const markdown = standaloneEmbed
|
|
248
269
|
? line.text.trim()
|
|
249
|
-
: resolveMarkdownImageWidgetSource(line.text, state.doc
|
|
270
|
+
: resolveMarkdownImageWidgetSource(line.text, state.doc);
|
|
250
271
|
if (!markdown) {
|
|
251
272
|
continue;
|
|
252
273
|
}
|
|
@@ -257,6 +278,9 @@ function buildBlockPreviewDecorations(state, options) {
|
|
|
257
278
|
to,
|
|
258
279
|
markdown,
|
|
259
280
|
nodeName: standaloneEmbed ? "EmbedLink" : "Image",
|
|
281
|
+
referenceLabel: standaloneImage
|
|
282
|
+
? markdownImageReferenceLabel(line.text, state.doc)
|
|
283
|
+
: undefined,
|
|
260
284
|
options,
|
|
261
285
|
}),
|
|
262
286
|
}).range(from, to));
|
|
@@ -397,6 +421,10 @@ function decorateInlineSyntax(view, ranges, hiddenRanges, activeSourceRanges) {
|
|
|
397
421
|
from: visibleRange.from,
|
|
398
422
|
to: visibleRange.to,
|
|
399
423
|
enter(node) {
|
|
424
|
+
if (node.name === "LinkReference") {
|
|
425
|
+
activeSourceRanges.push({ from: node.from, to: node.to });
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
400
428
|
const parent = node.node.parent;
|
|
401
429
|
const parentName = parent?.name;
|
|
402
430
|
const parentFrom = parent?.from ?? node.from;
|
|
@@ -468,7 +496,7 @@ function decorateInlineMarkdownWidgets(text, lineStart, ranges, options, state)
|
|
|
468
496
|
}),
|
|
469
497
|
}).range(from, to));
|
|
470
498
|
}
|
|
471
|
-
for (const image of findMarkdownImageRanges(text, state.doc
|
|
499
|
+
for (const image of findMarkdownImageRanges(text, state.doc)) {
|
|
472
500
|
const from = lineStart + image.from;
|
|
473
501
|
const to = lineStart + image.to;
|
|
474
502
|
if (rangeContainsSelectionCursor(state, from, to) ||
|
|
@@ -481,6 +509,7 @@ function decorateInlineMarkdownWidgets(text, lineStart, ranges, options, state)
|
|
|
481
509
|
from,
|
|
482
510
|
to,
|
|
483
511
|
markdown: image.source,
|
|
512
|
+
referenceLabel: image.referenceLabel,
|
|
484
513
|
options,
|
|
485
514
|
}),
|
|
486
515
|
}).range(from, to));
|
|
@@ -524,12 +553,17 @@ function decorateInlineTokenElement(view, name, from, to, ranges) {
|
|
|
524
553
|
}
|
|
525
554
|
function decorateInlineTokenPart(view, name, from, to, source, parentName, ranges) {
|
|
526
555
|
if (name === "URL") {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
556
|
+
if (parentName === "Link") {
|
|
557
|
+
ranges.push(linkTargetMark.range(from, to));
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (!isExternalMarkdownLink(source)) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
ranges.push(externalLinkMark.range(from, to));
|
|
564
|
+
const textRange = getMarkdownLinkTextRange(source, from, to);
|
|
565
|
+
if (textRange) {
|
|
566
|
+
ranges.push(linkTextMark.range(textRange.from, textRange.to));
|
|
533
567
|
}
|
|
534
568
|
return;
|
|
535
569
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { RangeBoundary } from "./ranges";
|
|
2
|
+
import type { Text } from "@codemirror/state";
|
|
2
3
|
export type MarkdownImageRange = RangeBoundary & {
|
|
3
|
-
/**
|
|
4
|
+
/** Complete preview fragment, including the definition for a reference. */
|
|
4
5
|
source: string;
|
|
6
|
+
referenceLabel?: string;
|
|
5
7
|
};
|
|
8
|
+
export declare function markdownImageReferenceLabel(markdown: string, documentText?: string | Text): string | undefined;
|
|
6
9
|
export declare function isStandaloneMarkdownImageLine(text: string): boolean;
|
|
7
|
-
export declare function resolveMarkdownImageWidgetSource(imageMarkdown: string, documentText: string): string | null;
|
|
8
|
-
export declare function findMarkdownImageRanges(text: string, documentText?: string): MarkdownImageRange[];
|
|
10
|
+
export declare function resolveMarkdownImageWidgetSource(imageMarkdown: string, documentText: string | Text): string | null;
|
|
11
|
+
export declare function findMarkdownImageRanges(text: string, documentText?: string | Text): MarkdownImageRange[];
|
|
9
12
|
//# sourceMappingURL=images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/images.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/images.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAeF,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,MAAM,GAAG,IAAe,GACrC,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBnE;AAED,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GAAG,IAAI,GAC1B,MAAM,GAAG,IAAI,CAsBf;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,YAAY,GAAE,MAAM,GAAG,IAAW,GACjC,kBAAkB,EAAE,CAgDtB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { findInlineCodeRanges, isPositionInsideRanges } from "./inline-code";
|
|
2
|
+
import { markdownReferenceTarget } from "./references";
|
|
2
3
|
/**
|
|
3
4
|
* Inline Markdown image with a parenthetical destination:
|
|
4
5
|
* `` / ``.
|
|
@@ -6,8 +7,15 @@ import { findInlineCodeRanges, isPositionInsideRanges } from "./inline-code";
|
|
|
6
7
|
* Does not match wiki embeds (`![[note]]`).
|
|
7
8
|
*/
|
|
8
9
|
const MARKDOWN_DESTINATION_IMAGE_PATTERN = /!\[((?:\\.|[^\]\\])*)\]\(((?:\\.|[^)\\])*)\)/gu;
|
|
9
|
-
/**
|
|
10
|
-
const MARKDOWN_REFERENCE_IMAGE_PATTERN = /!\[((?:\\.|[^\]\\])*)\]
|
|
10
|
+
/** Full, collapsed and shortcut references; rendering still requires a definition. */
|
|
11
|
+
const MARKDOWN_REFERENCE_IMAGE_PATTERN = /!\[((?:\\.|[^\]\\])*)\](?:\[([^\]]*)\])?/gu;
|
|
12
|
+
export function markdownImageReferenceLabel(markdown, documentText = markdown) {
|
|
13
|
+
MARKDOWN_REFERENCE_IMAGE_PATTERN.lastIndex = 0;
|
|
14
|
+
const match = MARKDOWN_REFERENCE_IMAGE_PATTERN.exec(markdown.trim());
|
|
15
|
+
return match && match[0] === markdown.trim()
|
|
16
|
+
? markdownReferenceTarget(documentText, match[2] || match[1] || "")?.label
|
|
17
|
+
: undefined;
|
|
18
|
+
}
|
|
11
19
|
export function isStandaloneMarkdownImageLine(text) {
|
|
12
20
|
const trimmed = text.trim();
|
|
13
21
|
if (!trimmed.startsWith("![")) {
|
|
@@ -34,19 +42,17 @@ export function resolveMarkdownImageWidgetSource(imageMarkdown, documentText) {
|
|
|
34
42
|
if (!reference || reference[0] !== trimmed) {
|
|
35
43
|
return null;
|
|
36
44
|
}
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const definition = findMarkdownLinkDefinition(documentText, label);
|
|
45
|
+
const label = reference[2] || reference[1] || "";
|
|
46
|
+
const definition = markdownReferenceTarget(documentText, label);
|
|
40
47
|
if (!definition) {
|
|
41
48
|
return null;
|
|
42
49
|
}
|
|
43
|
-
return definition.
|
|
44
|
-
? ``
|
|
45
|
-
: ``;
|
|
50
|
+
return `${trimmed}\n\n${definition.definition}`;
|
|
46
51
|
}
|
|
47
52
|
export function findMarkdownImageRanges(text, documentText = text) {
|
|
48
53
|
const ranges = [];
|
|
49
54
|
const codeRanges = findInlineCodeRanges(text);
|
|
55
|
+
MARKDOWN_DESTINATION_IMAGE_PATTERN.lastIndex = 0;
|
|
50
56
|
for (const match of text.matchAll(MARKDOWN_DESTINATION_IMAGE_PATTERN)) {
|
|
51
57
|
const localFrom = match.index ?? 0;
|
|
52
58
|
const localTo = localFrom + match[0].length;
|
|
@@ -60,6 +66,7 @@ export function findMarkdownImageRanges(text, documentText = text) {
|
|
|
60
66
|
source: match[0],
|
|
61
67
|
});
|
|
62
68
|
}
|
|
69
|
+
MARKDOWN_REFERENCE_IMAGE_PATTERN.lastIndex = 0;
|
|
63
70
|
for (const match of text.matchAll(MARKDOWN_REFERENCE_IMAGE_PATTERN)) {
|
|
64
71
|
const localFrom = match.index ?? 0;
|
|
65
72
|
const localTo = localFrom + match[0].length;
|
|
@@ -76,28 +83,8 @@ export function findMarkdownImageRanges(text, documentText = text) {
|
|
|
76
83
|
from: localFrom,
|
|
77
84
|
to: localTo,
|
|
78
85
|
source: resolved,
|
|
86
|
+
referenceLabel: markdownImageReferenceLabel(match[0], documentText),
|
|
79
87
|
});
|
|
80
88
|
}
|
|
81
89
|
return ranges;
|
|
82
90
|
}
|
|
83
|
-
function findMarkdownLinkDefinition(documentText, label) {
|
|
84
|
-
const normalizedLabel = normalizeReferenceLabel(label);
|
|
85
|
-
const definitionPattern = /^\s*\[([^\]]+)\]:\s*<?([^\s>]+)>?(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?\s*$/gm;
|
|
86
|
-
for (const match of documentText.matchAll(definitionPattern)) {
|
|
87
|
-
if (normalizeReferenceLabel(match[1] ?? "") !== normalizedLabel) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const destination = match[2] ?? "";
|
|
91
|
-
if (!destination) {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
destination,
|
|
96
|
-
title: match[3] ?? match[4] ?? match[5] ?? null,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
function normalizeReferenceLabel(label) {
|
|
102
|
-
return label.trim().replace(/\s+/g, " ").toLowerCase();
|
|
103
|
-
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Text } from "@codemirror/state";
|
|
2
|
+
export type MarkdownReferenceDefinition = Readonly<{
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
label: string;
|
|
6
|
+
image: boolean;
|
|
7
|
+
markdown: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function markdownReferenceTarget(doc: Text | string, label: string): {
|
|
10
|
+
definition: string;
|
|
11
|
+
label: string;
|
|
12
|
+
} | null;
|
|
13
|
+
/** Definitions are document syntax, not opening-bracket patterns in prose. */
|
|
14
|
+
export declare function markdownReferenceDefinitions(doc: Text): readonly MarkdownReferenceDefinition[];
|
|
15
|
+
//# sourceMappingURL=references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAkB9C,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAGH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,IAAI,GAAG,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiB9C;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,IAAI,GACR,SAAS,2BAA2B,EAAE,CA6CxC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { unified } from "unified";
|
|
2
|
+
import remarkParse from "remark-parse";
|
|
3
|
+
import { toMarkdown } from "mdast-util-to-markdown";
|
|
4
|
+
const parser = unified().use(remarkParse);
|
|
5
|
+
const trees = new WeakMap();
|
|
6
|
+
function referenceTree(doc) {
|
|
7
|
+
if (typeof doc === "string")
|
|
8
|
+
return parser.parse(doc);
|
|
9
|
+
let tree = trees.get(doc);
|
|
10
|
+
if (!tree) {
|
|
11
|
+
tree = parser.parse(doc.toString());
|
|
12
|
+
trees.set(doc, tree);
|
|
13
|
+
}
|
|
14
|
+
return tree;
|
|
15
|
+
}
|
|
16
|
+
const cache = new WeakMap();
|
|
17
|
+
const normalize = (id) => id.trim().replace(/\s+/gu, " ").toUpperCase();
|
|
18
|
+
export function markdownReferenceTarget(doc, label) {
|
|
19
|
+
let result = null;
|
|
20
|
+
function walk(node) {
|
|
21
|
+
if (result)
|
|
22
|
+
return;
|
|
23
|
+
if (node.type === "definition" &&
|
|
24
|
+
normalize(node.identifier) === normalize(label))
|
|
25
|
+
result = {
|
|
26
|
+
definition: toMarkdown({ type: "root", children: [node] }).trimEnd(),
|
|
27
|
+
label: node.label ?? node.identifier,
|
|
28
|
+
};
|
|
29
|
+
if ("children" in node)
|
|
30
|
+
for (const child of node.children)
|
|
31
|
+
walk(child);
|
|
32
|
+
}
|
|
33
|
+
walk(referenceTree(doc));
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
/** Definitions are document syntax, not opening-bracket patterns in prose. */
|
|
37
|
+
export function markdownReferenceDefinitions(doc) {
|
|
38
|
+
const retained = cache.get(doc);
|
|
39
|
+
if (retained)
|
|
40
|
+
return retained;
|
|
41
|
+
const tree = referenceTree(doc);
|
|
42
|
+
const imageReferences = new Set();
|
|
43
|
+
function collect(node) {
|
|
44
|
+
if (node.type === "imageReference")
|
|
45
|
+
imageReferences.add(normalize(node.identifier));
|
|
46
|
+
if ("children" in node)
|
|
47
|
+
for (const child of node.children)
|
|
48
|
+
collect(child);
|
|
49
|
+
}
|
|
50
|
+
collect(tree);
|
|
51
|
+
const definitions = [];
|
|
52
|
+
for (const definition of tree.children) {
|
|
53
|
+
if (definition.type !== "definition" || !definition.position)
|
|
54
|
+
continue;
|
|
55
|
+
const from = definition.position.start.offset;
|
|
56
|
+
const to = definition.position.end.offset;
|
|
57
|
+
if (from === undefined || to === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const label = definition.label ?? definition.identifier;
|
|
60
|
+
const image = imageReferences.has(normalize(definition.identifier));
|
|
61
|
+
const reference = {
|
|
62
|
+
identifier: definition.identifier,
|
|
63
|
+
label: definition.label,
|
|
64
|
+
referenceType: "full",
|
|
65
|
+
};
|
|
66
|
+
const usage = image
|
|
67
|
+
? { type: "imageReference", ...reference, alt: label }
|
|
68
|
+
: {
|
|
69
|
+
type: "linkReference",
|
|
70
|
+
...reference,
|
|
71
|
+
children: [{ type: "text", value: definition.url }],
|
|
72
|
+
};
|
|
73
|
+
definitions.push({
|
|
74
|
+
from,
|
|
75
|
+
to,
|
|
76
|
+
label,
|
|
77
|
+
image,
|
|
78
|
+
markdown: toMarkdown({
|
|
79
|
+
type: "root",
|
|
80
|
+
children: [{ type: "paragraph", children: [usage] }, definition],
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
cache.set(doc, definitions);
|
|
85
|
+
return definitions;
|
|
86
|
+
}
|
|
@@ -10,6 +10,8 @@ export declare class BlockPreviewWidget extends WidgetType {
|
|
|
10
10
|
markdownIndentLength?: number;
|
|
11
11
|
markdownIndentedLineStarts?: number[];
|
|
12
12
|
nodeName: string;
|
|
13
|
+
referenceLabel?: string;
|
|
14
|
+
referenceImage?: boolean;
|
|
13
15
|
options: MiraRichEditorOptions;
|
|
14
16
|
});
|
|
15
17
|
eq(other: BlockPreviewWidget): boolean;
|
|
@@ -27,6 +29,7 @@ export declare class InlineMarkdownWidget extends WidgetType {
|
|
|
27
29
|
from: number;
|
|
28
30
|
to: number;
|
|
29
31
|
markdown: string;
|
|
32
|
+
referenceLabel?: string;
|
|
30
33
|
options: MiraRichEditorOptions;
|
|
31
34
|
});
|
|
32
35
|
eq(other: InlineMarkdownWidget): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-widgets.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/widgets/preview-widgets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"preview-widgets.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/widgets/preview-widgets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAe1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA+BtD,qBAAa,kBAAmB,SAAQ,UAAU;IAE9C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;QACtC,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,OAAO,EAAE,qBAAqB,CAAC;KAChC;IAKM,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO;IAmB/C,IAAa,eAAe,IAAI,MAAM,CAErC;IAEQ,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;IAkL7C,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,2BAA2B;IAiBnC,OAAO,CAAC,0BAA0B;IAwDzB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAW/B,WAAW,IAAI,OAAO;CAGhC;AAED,qBAAa,oBAAqB,SAAQ,UAAU;IAEhD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,qBAAqB,CAAC;KAChC;IAKM,EAAE,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAWxC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;IAkDpC,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAQ/B,WAAW,IAAI,OAAO;CAGhC;AAED,qBAAa,gBAAiB,SAAQ,UAAU;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,qBAAqB,CAAC;KAChC;IAKM,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO;IAQpC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;IAwCpC,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAQ/B,WAAW,IAAI,OAAO;CAGhC"}
|
|
@@ -3,6 +3,7 @@ import { EditorView, WidgetType } from "@codemirror/view";
|
|
|
3
3
|
import { createMarkdownGridTableWidget, createMarkdownTableWidget, } from "@lapismd/mira/tables";
|
|
4
4
|
import { MarkdownPreview } from "@lapismd/mira/preview";
|
|
5
5
|
import { mount, unmount } from "svelte";
|
|
6
|
+
import { destroyTableWidget } from "../../../../tables/widgets/lifecycle";
|
|
6
7
|
import { collectMiraDoodleDividerRules, formatMiraDoodleDividerSeed, MIRA_DOODLE_DIVIDER_CONTROL_EVENT, resolveMiraDoodleDividerController, } from "../../../doodle-dividers";
|
|
7
8
|
import { shouldActivateEditablePreview, PREVIEW_INTERACTIVE_SELECTOR, } from "../utils/activation";
|
|
8
9
|
import { estimateMarkdownBlockHeight } from "../utils/height-estimates";
|
|
@@ -10,6 +11,15 @@ import { createSourceToggleButton, selectWidgetSource } from "./source-toggle";
|
|
|
10
11
|
const previewWidgetMounts = new WeakMap();
|
|
11
12
|
const previewWidgetObservers = new WeakMap();
|
|
12
13
|
const frontmatterDisclosureByView = new WeakMap();
|
|
14
|
+
function appendReferenceLabel(container, label, image) {
|
|
15
|
+
container.dataset.referenceLabel = label;
|
|
16
|
+
container.classList.add(image ? "mira-reference--image" : "mira-reference--link");
|
|
17
|
+
const badge = container.ownerDocument.createElement("span");
|
|
18
|
+
badge.className = "mira-reference__label";
|
|
19
|
+
badge.textContent = label;
|
|
20
|
+
badge.title = `Reference: ${label}`;
|
|
21
|
+
container.append(badge);
|
|
22
|
+
}
|
|
13
23
|
export class BlockPreviewWidget extends WidgetType {
|
|
14
24
|
config;
|
|
15
25
|
constructor(config) {
|
|
@@ -25,9 +35,12 @@ export class BlockPreviewWidget extends WidgetType {
|
|
|
25
35
|
JSON.stringify(this.config.markdownIndentedLineStarts) ===
|
|
26
36
|
JSON.stringify(other.config.markdownIndentedLineStarts) &&
|
|
27
37
|
this.config.nodeName === other.config.nodeName &&
|
|
38
|
+
this.config.referenceLabel === other.config.referenceLabel &&
|
|
39
|
+
this.config.referenceImage === other.config.referenceImage &&
|
|
28
40
|
this.config.options.frontmatterOpen ===
|
|
29
41
|
other.config.options.frontmatterOpen &&
|
|
30
|
-
this.config.options.readonly === other.config.options.readonly
|
|
42
|
+
this.config.options.readonly === other.config.options.readonly &&
|
|
43
|
+
this.config.options.extensions === other.config.options.extensions);
|
|
31
44
|
}
|
|
32
45
|
get estimatedHeight() {
|
|
33
46
|
return estimateMarkdownBlockHeight(this.config.markdown);
|
|
@@ -41,6 +54,10 @@ export class BlockPreviewWidget extends WidgetType {
|
|
|
41
54
|
"markdown-rendered",
|
|
42
55
|
].join(" ");
|
|
43
56
|
container.dataset.node = this.config.nodeName;
|
|
57
|
+
if (this.config.nodeName === "ReferenceDefinition")
|
|
58
|
+
container.classList.add("mira-reference-definition");
|
|
59
|
+
if (this.config.referenceLabel)
|
|
60
|
+
appendReferenceLabel(container, this.config.referenceLabel, this.config.referenceImage || this.config.nodeName === "Image");
|
|
44
61
|
if (this.config.options.readonly) {
|
|
45
62
|
container.dataset.readonly = "true";
|
|
46
63
|
}
|
|
@@ -51,6 +68,7 @@ export class BlockPreviewWidget extends WidgetType {
|
|
|
51
68
|
: createMarkdownTableWidget;
|
|
52
69
|
container.append(createWidget({
|
|
53
70
|
markdown: this.config.markdown,
|
|
71
|
+
extensions: this.config.options.extensions,
|
|
54
72
|
onChange: (nextMarkdown) => {
|
|
55
73
|
this.dispatchMarkdownReplacement(view, nextMarkdown);
|
|
56
74
|
},
|
|
@@ -86,6 +104,9 @@ export class BlockPreviewWidget extends WidgetType {
|
|
|
86
104
|
props: {
|
|
87
105
|
value: this.config.markdown,
|
|
88
106
|
embed: true,
|
|
107
|
+
inline: this.config.nodeName === "ReferenceDefinition" &&
|
|
108
|
+
!this.config.referenceImage,
|
|
109
|
+
htmlPolicy: this.config.nodeName === "ReferenceDefinition" ? "safe" : undefined,
|
|
89
110
|
sourcePath: this.config.options.sourcePath,
|
|
90
111
|
extensions: this.config.options.extensions ?? [],
|
|
91
112
|
linkResolver: this.config.options.linkResolver,
|
|
@@ -220,6 +241,7 @@ export class BlockPreviewWidget extends WidgetType {
|
|
|
220
241
|
view.scrollDOM.scrollLeft = scrollLeft;
|
|
221
242
|
}
|
|
222
243
|
destroy(dom) {
|
|
244
|
+
destroyTableWidget(dom);
|
|
223
245
|
previewWidgetObservers.get(dom)?.disconnect();
|
|
224
246
|
previewWidgetObservers.delete(dom);
|
|
225
247
|
const component = previewWidgetMounts.get(dom);
|
|
@@ -241,11 +263,16 @@ export class InlineMarkdownWidget extends WidgetType {
|
|
|
241
263
|
eq(other) {
|
|
242
264
|
return (this.config.from === other.config.from &&
|
|
243
265
|
this.config.to === other.config.to &&
|
|
244
|
-
this.config.markdown === other.config.markdown
|
|
266
|
+
this.config.markdown === other.config.markdown &&
|
|
267
|
+
this.config.referenceLabel === other.config.referenceLabel &&
|
|
268
|
+
this.config.options.extensions === other.config.options.extensions &&
|
|
269
|
+
this.config.options.readonly === other.config.options.readonly);
|
|
245
270
|
}
|
|
246
271
|
toDOM(view) {
|
|
247
272
|
const container = document.createElement("span");
|
|
248
273
|
container.className = "mira-inline-markdown-widget markdown-rendered";
|
|
274
|
+
if (this.config.referenceLabel)
|
|
275
|
+
appendReferenceLabel(container, this.config.referenceLabel, true);
|
|
249
276
|
const component = mount(MarkdownPreview, {
|
|
250
277
|
target: container,
|
|
251
278
|
props: {
|
|
@@ -262,7 +289,8 @@ export class InlineMarkdownWidget extends WidgetType {
|
|
|
262
289
|
});
|
|
263
290
|
previewWidgetMounts.set(container, component);
|
|
264
291
|
const selectSource = (event) => {
|
|
265
|
-
if (
|
|
292
|
+
if (this.config.options.readonly ||
|
|
293
|
+
event.button !== 0 ||
|
|
266
294
|
event.metaKey ||
|
|
267
295
|
event.ctrlKey ||
|
|
268
296
|
event.shiftKey ||
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export declare const bundledLinkIcons: {
|
|
2
|
+
readonly github: {
|
|
3
|
+
readonly name: "GitHub";
|
|
4
|
+
readonly viewBox: "0 0 24 24";
|
|
5
|
+
readonly paths: readonly [{
|
|
6
|
+
readonly d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12";
|
|
7
|
+
}];
|
|
8
|
+
};
|
|
9
|
+
readonly gitlab: {
|
|
10
|
+
readonly name: "GitLab";
|
|
11
|
+
readonly viewBox: "0 0 24 24";
|
|
12
|
+
readonly paths: readonly [{
|
|
13
|
+
readonly d: "m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z";
|
|
14
|
+
}];
|
|
15
|
+
};
|
|
16
|
+
readonly forgejo: {
|
|
17
|
+
readonly name: "Forgejo";
|
|
18
|
+
readonly viewBox: "0 0 24 24";
|
|
19
|
+
readonly paths: readonly [{
|
|
20
|
+
readonly d: "M16.7773 0c1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.1175a7.0759 7.0759 0 0 1 4.148-1.4205l.1176-.001 1.3385.0002c.4973-.8827 1.4434-1.4788 2.5288-1.4788 1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.319c.8827.4973 1.4788 1.4434 1.4788 2.5287 0 1.602-1.2986 2.9005-2.9005 2.9005-1.6018 0-2.9004-1.2986-2.9004-2.9005 0-1.0853.596-2.0314 1.4788-2.5287l-.0002-9.9831c0-3.887 3.1195-7.0453 6.9915-7.108l.1176-.001h1.3385C14.7458.5962 15.692 0 16.7773 0ZM7.2227 19.9052c-.6596 0-1.1943.5347-1.1943 1.1943s.5347 1.1943 1.1943 1.1943 1.1944-.5347 1.1944-1.1943-.5348-1.1943-1.1944-1.1943Zm9.5546-10.4644c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Zm0-7.7346c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Z";
|
|
21
|
+
}];
|
|
22
|
+
};
|
|
23
|
+
readonly codeberg: {
|
|
24
|
+
readonly name: "Codeberg";
|
|
25
|
+
readonly viewBox: "0 0 24 24";
|
|
26
|
+
readonly paths: readonly [{
|
|
27
|
+
readonly d: "M11.999.747A11.974 11.974 0 0 0 0 12.75c0 2.254.635 4.465 1.833 6.376L11.837 6.19c.072-.092.251-.092.323 0l4.178 5.402h-2.992l.065.239h3.113l.882 1.138h-3.674l.103.374h3.86l.777 1.003h-4.358l.135.483h4.593l.695.894h-5.038l.165.589h5.326l.609.785h-5.717l.182.65h6.038l.562.727h-6.397l.183.65h6.717A12.003 12.003 0 0 0 24 12.75 11.977 11.977 0 0 0 11.999.747zm3.654 19.104.182.65h5.326c.173-.204.353-.433.513-.65zm.385 1.377.18.65h3.563c.233-.198.485-.428.712-.65zm.383 1.377.182.648h1.203c.356-.204.685-.412 1.042-.648zz";
|
|
28
|
+
}];
|
|
29
|
+
};
|
|
30
|
+
readonly bitbucket: {
|
|
31
|
+
readonly name: "Bitbucket";
|
|
32
|
+
readonly viewBox: "0 0 24 24";
|
|
33
|
+
readonly paths: readonly [{
|
|
34
|
+
readonly d: "M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z";
|
|
35
|
+
}];
|
|
36
|
+
};
|
|
37
|
+
readonly facebook: {
|
|
38
|
+
readonly name: "Facebook";
|
|
39
|
+
readonly viewBox: "0 0 24 24";
|
|
40
|
+
readonly paths: readonly [{
|
|
41
|
+
readonly d: "M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z";
|
|
42
|
+
}];
|
|
43
|
+
};
|
|
44
|
+
readonly x: {
|
|
45
|
+
readonly name: "X";
|
|
46
|
+
readonly viewBox: "0 0 24 24";
|
|
47
|
+
readonly paths: readonly [{
|
|
48
|
+
readonly d: "M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z";
|
|
49
|
+
}];
|
|
50
|
+
};
|
|
51
|
+
readonly google: {
|
|
52
|
+
readonly name: "Google";
|
|
53
|
+
readonly viewBox: "0 0 24 24";
|
|
54
|
+
readonly paths: readonly [{
|
|
55
|
+
readonly d: "M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z";
|
|
56
|
+
}];
|
|
57
|
+
};
|
|
58
|
+
readonly slack: {
|
|
59
|
+
readonly name: "Slack";
|
|
60
|
+
readonly viewBox: "0 0 24 24";
|
|
61
|
+
readonly paths: readonly [{
|
|
62
|
+
readonly d: "M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z";
|
|
63
|
+
}];
|
|
64
|
+
};
|
|
65
|
+
readonly linear: {
|
|
66
|
+
readonly name: "Linear";
|
|
67
|
+
readonly viewBox: "0 0 24 24";
|
|
68
|
+
readonly paths: readonly [{
|
|
69
|
+
readonly d: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z";
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
readonly notion: {
|
|
73
|
+
readonly name: "Notion";
|
|
74
|
+
readonly viewBox: "0 0 24 24";
|
|
75
|
+
readonly paths: readonly [{
|
|
76
|
+
readonly d: "M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z";
|
|
77
|
+
}];
|
|
78
|
+
};
|
|
79
|
+
readonly figma: {
|
|
80
|
+
readonly name: "Figma";
|
|
81
|
+
readonly viewBox: "0 0 24 24";
|
|
82
|
+
readonly paths: readonly [{
|
|
83
|
+
readonly d: "M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z";
|
|
84
|
+
}];
|
|
85
|
+
};
|
|
86
|
+
readonly youtube: {
|
|
87
|
+
readonly name: "YouTube";
|
|
88
|
+
readonly viewBox: "0 0 24 24";
|
|
89
|
+
readonly paths: readonly [{
|
|
90
|
+
readonly d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z";
|
|
91
|
+
}];
|
|
92
|
+
};
|
|
93
|
+
readonly discord: {
|
|
94
|
+
readonly name: "Discord";
|
|
95
|
+
readonly viewBox: "0 0 24 24";
|
|
96
|
+
readonly paths: readonly [{
|
|
97
|
+
readonly d: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z";
|
|
98
|
+
}];
|
|
99
|
+
};
|
|
100
|
+
readonly reddit: {
|
|
101
|
+
readonly name: "Reddit";
|
|
102
|
+
readonly viewBox: "0 0 24 24";
|
|
103
|
+
readonly paths: readonly [{
|
|
104
|
+
readonly d: "M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z";
|
|
105
|
+
}];
|
|
106
|
+
};
|
|
107
|
+
readonly stackoverflow: {
|
|
108
|
+
readonly name: "Stack Overflow";
|
|
109
|
+
readonly viewBox: "0 0 24 24";
|
|
110
|
+
readonly paths: readonly [{
|
|
111
|
+
readonly d: "M15.725 0l-1.72 1.277 6.39 8.588 1.716-1.277L15.725 0zm-3.94 3.418l-1.369 1.644 8.225 6.85 1.369-1.644-8.225-6.85zm-3.15 4.465l-.905 1.94 9.702 4.517.904-1.94-9.701-4.517zm-1.85 4.86l-.44 2.093 10.473 2.201.44-2.092-10.473-2.203zM1.89 15.47V24h19.19v-8.53h-2.133v6.397H4.021v-6.396H1.89zm4.265 2.133v2.13h10.66v-2.13H6.154Z";
|
|
112
|
+
}];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/internal/inline-links/icons.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJnB,CAAC"}
|