@clevertask/scribe 0.1.22 → 0.1.24
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/README.md +34 -2
- package/dist/{BarMenu-tPZoiOba.js → BarMenu-DW95OBe1.js} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.js +2 -2
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +2 -2
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/index.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/node-view.js +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/index.js +4 -4
- package/dist/{dist-D31OwZrM.js → dist-_L8dTDsy.js} +1 -1
- package/dist/document-node-capabilities.d.ts +47 -0
- package/dist/document-node-capabilities.d.ts.map +1 -0
- package/dist/document-node-capabilities.js +409 -0
- package/dist/{extension-BMUUYPzc.js → extension-B7i7CZ1Y.js} +1 -1
- package/dist/{html-to-markdown-D7PT8MhP.js → html-to-markdown-CKpceHDk.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-ChfR7P_Y.js → markdown-to-html-zj2j0HLf.js} +18 -15
- package/dist/{menus-DLKcWlVX.js → menus-BhM4ctz2.js} +2 -2
- package/dist/{purify.es-DGv0-Lid.js → purify.es-CpMrJENN.js} +277 -277
- package/dist/{schema-extensions-CQTswF0n.js → schema-extensions-ggKYCkRf.js} +397 -372
- package/dist/schema-extensions.js +1 -1
- package/dist/schema.d.ts +2 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +4 -3
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +10 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../BarMenu-
|
|
1
|
+
import { t as e } from "../../BarMenu-DW95OBe1.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as e } from "../../dist-
|
|
1
|
+
import { s as e } from "../../dist-_L8dTDsy.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
|
|
3
|
-
import { t as n } from "../../menus-
|
|
3
|
+
import { t as n } from "../../menus-BhM4ctz2.js";
|
|
4
4
|
import { Flex as r, IconButton as i } from "@radix-ui/themes";
|
|
5
5
|
import { useCallback as a } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, isCalloutVariant as n } from "../Scribe/extension/callout.js";
|
|
2
|
-
import { s as r } from "../../dist-
|
|
2
|
+
import { s as r } from "../../dist-_L8dTDsy.js";
|
|
3
3
|
import { getPopupMountTarget as i } from "../Scribe/extension/getPopupMountTarget.js";
|
|
4
|
-
import { t as a } from "../../menus-
|
|
4
|
+
import { t as a } from "../../menus-BhM4ctz2.js";
|
|
5
5
|
import { CalloutIcon as o, RemoveCalloutIcon as s } from "../../icons/CalloutIcon.js";
|
|
6
6
|
import { calloutBubbleMenuPluginKey as c, getSelectionCalloutContext as l } from "./calloutBubbleMenuPlugin.js";
|
|
7
7
|
import { getSelectionContextualMenuOwner as u } from "./contextualMenuOwner.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getExternalLinkPreviewHostname as e } from "../Scribe/extension/external-link-preview/attributes.js";
|
|
2
|
-
import { s as t } from "../../dist-
|
|
2
|
+
import { s as t } from "../../dist-_L8dTDsy.js";
|
|
3
3
|
import { getPopupMountTarget as n } from "../Scribe/extension/getPopupMountTarget.js";
|
|
4
4
|
import r from "./LinkEditor.js";
|
|
5
5
|
import { consumeLinkBubbleMenuFocusTarget as i, getPlainLinkContextAtPosition as a, getSelectionLinkContext as o, hideLinkBubbleMenu as s, linkBubbleMenuPluginKey as c, showLinkBubbleMenu as l } from "./linkBubbleMenuPlugin.js";
|
|
6
|
-
import { t as u } from "../../menus-
|
|
6
|
+
import { t as u } from "../../menus-BhM4ctz2.js";
|
|
7
7
|
import { getSelectionContextualMenuOwner as d } from "./contextualMenuOwner.js";
|
|
8
8
|
import { getExternalLinkPreviewResolutionStatus as f } from "../Scribe/extension/external-link-preview/resolver.js";
|
|
9
9
|
import { Box as p } from "@radix-ui/themes";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as e } from "../../dist-
|
|
1
|
+
import { s as e } from "../../dist-_L8dTDsy.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
|
|
3
|
-
import { t as n } from "../../menus-
|
|
3
|
+
import { t as n } from "../../menus-BhM4ctz2.js";
|
|
4
4
|
import { getSelectionTableContext as r, tableBubbleMenuPluginKey as i } from "./tableBubbleMenuPlugin.js";
|
|
5
5
|
import { getSelectionContextualMenuOwner as a } from "./contextualMenuOwner.js";
|
|
6
6
|
import { Flex as o, IconButton as s, Separator as c } from "@radix-ui/themes";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "../../../../dist-
|
|
1
|
+
import { i as e } from "../../../../dist-_L8dTDsy.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
|
|
3
3
|
import { t as n } from "../../../../tippy.esm-8vSV0zL7.js";
|
|
4
4
|
import { EmojiList as r } from "./EmojiList.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "../../../dist-ClNucvAM.js";
|
|
2
|
-
import { n as t, t as n } from "../../../markdown-to-html-
|
|
2
|
+
import { n as t, t as n } from "../../../markdown-to-html-zj2j0HLf.js";
|
|
3
3
|
import { Plugin as r, PluginKey as i } from "@tiptap/pm/state";
|
|
4
4
|
//#region lib/components/Scribe/extension/extension-markdown-paste.ts
|
|
5
5
|
var a = new i("markdownPaste"), o = /* @__PURE__ */ new Set([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as e } from "./types.js";
|
|
2
2
|
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t } from "./attributes.js";
|
|
3
3
|
import { ExternalLinkPreviewSchema as n } from "./schema.js";
|
|
4
|
-
import { r } from "../../../../dist-
|
|
4
|
+
import { r } from "../../../../dist-_L8dTDsy.js";
|
|
5
5
|
import { createExternalLinkPreviewResolverPlugin as i } from "./resolver.js";
|
|
6
6
|
import { createExternalLinkPreviewCommands as a } from "./commands.js";
|
|
7
7
|
import { ExternalLinkPreviewNodeView as o } from "./node-view.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getExternalLinkPreviewHostname as e, getExternalLinkPreviewTitle as t, normalizeExternalLinkPreviewAttributes as n } from "./attributes.js";
|
|
2
|
-
import { n as r, s as i } from "../../../../dist-
|
|
2
|
+
import { n as r, s as i } from "../../../../dist-_L8dTDsy.js";
|
|
3
3
|
import { showLinkBubbleMenu as a } from "../../../Menu/linkBubbleMenuPlugin.js";
|
|
4
4
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
//#region lib/components/Scribe/extension/external-link-preview/node-view.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../extension-
|
|
1
|
+
import { t as e } from "../../../extension-B7i7CZ1Y.js";
|
|
2
2
|
export { e as initExtensions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "../../../../dist-
|
|
1
|
+
import { i as e } from "../../../../dist-_L8dTDsy.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
|
|
3
3
|
import { t as n } from "../../../../tippy.esm-8vSV0zL7.js";
|
|
4
4
|
import { SlashCommandList as r } from "./SlashCommandList.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as e, t } from "../../BarMenu-
|
|
2
|
-
import { o as n, t as r } from "../../dist-
|
|
1
|
+
import { n as e, t } from "../../BarMenu-DW95OBe1.js";
|
|
2
|
+
import { o as n, t as r } from "../../dist-_L8dTDsy.js";
|
|
3
3
|
import i from "../Menu/CalloutBubbleMenu.js";
|
|
4
4
|
import a from "../Menu/LinkBubbleMenu.js";
|
|
5
5
|
import o from "../Menu/TableBubbleMenu.js";
|
|
6
|
-
import { t as s } from "../../html-to-markdown-
|
|
7
|
-
import { t as c } from "../../extension-
|
|
6
|
+
import { t as s } from "../../html-to-markdown-CKpceHDk.js";
|
|
7
|
+
import { t as c } from "../../extension-B7i7CZ1Y.js";
|
|
8
8
|
import { SuggestionItemType as l } from "./extension/slashCommand/items.js";
|
|
9
9
|
import "./extension/tableOfContents.js";
|
|
10
10
|
import "../../utils/index.js";
|
|
@@ -368,7 +368,7 @@ function B(e = {}) {
|
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
370
|
//#endregion
|
|
371
|
-
//#region node_modules/.pnpm/use-sync-external-store@1.
|
|
371
|
+
//#region node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.2.5/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
372
372
|
var Ue = /* @__PURE__ */ e(((e) => {
|
|
373
373
|
var t = C(), n = w();
|
|
374
374
|
function r(e, t) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Schema } from "@tiptap/pm/model";
|
|
2
|
+
export declare const SCRIBE_DOCUMENT_NODE_CAPABILITY_ROLES: readonly ["document", "text", "text_block", "heading", "container", "list", "list_item", "table", "table_row", "table_cell", "inline_atom", "block_atom", "separator"];
|
|
3
|
+
export type ScribeDocumentNodeCapabilityRole = (typeof SCRIBE_DOCUMENT_NODE_CAPABILITY_ROLES)[number];
|
|
4
|
+
export declare const SCRIBE_DOCUMENT_NODE_CONTENT_KINDS: readonly ["none", "inline", "block", "structured"];
|
|
5
|
+
export type ScribeDocumentNodeContentKind = (typeof SCRIBE_DOCUMENT_NODE_CONTENT_KINDS)[number];
|
|
6
|
+
export type ScribeDocumentNodeAttributeShape = {
|
|
7
|
+
readonly kind: "boolean" | "number" | "number_array" | "string" | "unknown";
|
|
8
|
+
readonly nullable?: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "enum";
|
|
11
|
+
readonly nullable?: boolean;
|
|
12
|
+
readonly values: readonly (boolean | number | string)[];
|
|
13
|
+
};
|
|
14
|
+
export type ScribeDocumentNodePotentialOperation = {
|
|
15
|
+
readonly type: "replace_content";
|
|
16
|
+
} | {
|
|
17
|
+
readonly attributes: readonly string[];
|
|
18
|
+
readonly type: "set_attributes";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Static structural facts about one Scribe-compatible node type.
|
|
22
|
+
*
|
|
23
|
+
* Potential operations are not permissions. An application must intersect them with its own
|
|
24
|
+
* authorization, current-node context, parser support, revision checks, and size limits before it
|
|
25
|
+
* advertises or executes a write.
|
|
26
|
+
*/
|
|
27
|
+
export type ScribeDocumentNodeCapability = {
|
|
28
|
+
readonly attributes: Readonly<Record<string, ScribeDocumentNodeAttributeShape>>;
|
|
29
|
+
readonly content: {
|
|
30
|
+
readonly expression: string | null;
|
|
31
|
+
readonly kind: ScribeDocumentNodeContentKind;
|
|
32
|
+
};
|
|
33
|
+
readonly label: string;
|
|
34
|
+
readonly nodeType: string;
|
|
35
|
+
readonly potentialOperations: readonly ScribeDocumentNodePotentialOperation[];
|
|
36
|
+
readonly role: ScribeDocumentNodeCapabilityRole;
|
|
37
|
+
};
|
|
38
|
+
export type ScribeDocumentNodeCapabilityManifest = Readonly<Record<string, ScribeDocumentNodeCapability>>;
|
|
39
|
+
export declare const defineScribeDocumentNodeCapability: <const Capability extends ScribeDocumentNodeCapability>(capability: Capability) => Capability;
|
|
40
|
+
/**
|
|
41
|
+
* Describe the exact node schema without importing Scribe's React editor.
|
|
42
|
+
*
|
|
43
|
+
* Consumer-owned nodes must provide an additional declaration. New schema nodes therefore fail
|
|
44
|
+
* closed instead of silently inheriting write capabilities.
|
|
45
|
+
*/
|
|
46
|
+
export declare const createScribeDocumentNodeCapabilityManifest: (schema: Schema, additionalCapabilities?: readonly ScribeDocumentNodeCapability[]) => ScribeDocumentNodeCapabilityManifest;
|
|
47
|
+
//# sourceMappingURL=document-node-capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-node-capabilities.d.ts","sourceRoot":"","sources":["../lib/document-node-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI/C,eAAO,MAAM,qCAAqC,YAChD,UAAU,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,CACH,CAAC;AAEX,MAAM,MAAM,gCAAgC,GAC1C,CAAC,OAAO,qCAAqC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,kCAAkC,YAC7C,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,CACJ,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhG,MAAM,MAAM,gCAAgC,GACxC;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACzD,CAAC;AAEN,MAAM,MAAM,oCAAoC,GAC5C;IACE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC,GACD;IACE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC;IAChF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAC;KAC9C,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,SAAS,oCAAoC,EAAE,CAAC;IAC9E,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG,QAAQ,CACzD,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAC7C,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,KAAK,CAAC,UAAU,SAAS,4BAA4B,cAEzC,UAAU,KACrB,UAAwB,CAAC;AAqX5B;;;;;GAKG;AACH,eAAO,MAAM,0CAA0C,WAC7C,MAAM,2BACU,SAAS,4BAA4B,EAAE,KAC9D,oCAuCF,CAAC"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { CALLOUT_VARIANTS as e } from "./components/Scribe/extension/callout.js";
|
|
2
|
+
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as t } from "./components/Scribe/extension/external-link-preview/types.js";
|
|
3
|
+
//#region lib/document-node-capabilities.ts
|
|
4
|
+
var n = [
|
|
5
|
+
"document",
|
|
6
|
+
"text",
|
|
7
|
+
"text_block",
|
|
8
|
+
"heading",
|
|
9
|
+
"container",
|
|
10
|
+
"list",
|
|
11
|
+
"list_item",
|
|
12
|
+
"table",
|
|
13
|
+
"table_row",
|
|
14
|
+
"table_cell",
|
|
15
|
+
"inline_atom",
|
|
16
|
+
"block_atom",
|
|
17
|
+
"separator"
|
|
18
|
+
], r = [
|
|
19
|
+
"none",
|
|
20
|
+
"inline",
|
|
21
|
+
"block",
|
|
22
|
+
"structured"
|
|
23
|
+
], i = (e) => e, a = {}, o = [], s = [
|
|
24
|
+
i({
|
|
25
|
+
attributes: a,
|
|
26
|
+
content: {
|
|
27
|
+
expression: "block+",
|
|
28
|
+
kind: "block"
|
|
29
|
+
},
|
|
30
|
+
label: "Document",
|
|
31
|
+
nodeType: "doc",
|
|
32
|
+
potentialOperations: o,
|
|
33
|
+
role: "document"
|
|
34
|
+
}),
|
|
35
|
+
i({
|
|
36
|
+
attributes: a,
|
|
37
|
+
content: {
|
|
38
|
+
expression: null,
|
|
39
|
+
kind: "none"
|
|
40
|
+
},
|
|
41
|
+
label: "Text",
|
|
42
|
+
nodeType: "text",
|
|
43
|
+
potentialOperations: o,
|
|
44
|
+
role: "text"
|
|
45
|
+
}),
|
|
46
|
+
i({
|
|
47
|
+
attributes: a,
|
|
48
|
+
content: {
|
|
49
|
+
expression: "inline*",
|
|
50
|
+
kind: "inline"
|
|
51
|
+
},
|
|
52
|
+
label: "Paragraph",
|
|
53
|
+
nodeType: "paragraph",
|
|
54
|
+
potentialOperations: [{ type: "replace_content" }],
|
|
55
|
+
role: "text_block"
|
|
56
|
+
}),
|
|
57
|
+
i({
|
|
58
|
+
attributes: { level: {
|
|
59
|
+
kind: "enum",
|
|
60
|
+
values: [
|
|
61
|
+
1,
|
|
62
|
+
2,
|
|
63
|
+
3,
|
|
64
|
+
4,
|
|
65
|
+
5,
|
|
66
|
+
6
|
|
67
|
+
]
|
|
68
|
+
} },
|
|
69
|
+
content: {
|
|
70
|
+
expression: "inline*",
|
|
71
|
+
kind: "inline"
|
|
72
|
+
},
|
|
73
|
+
label: "Heading",
|
|
74
|
+
nodeType: "heading",
|
|
75
|
+
potentialOperations: o,
|
|
76
|
+
role: "heading"
|
|
77
|
+
}),
|
|
78
|
+
i({
|
|
79
|
+
attributes: a,
|
|
80
|
+
content: {
|
|
81
|
+
expression: "block+",
|
|
82
|
+
kind: "block"
|
|
83
|
+
},
|
|
84
|
+
label: "Block quote",
|
|
85
|
+
nodeType: "blockquote",
|
|
86
|
+
potentialOperations: o,
|
|
87
|
+
role: "container"
|
|
88
|
+
}),
|
|
89
|
+
i({
|
|
90
|
+
attributes: { language: {
|
|
91
|
+
kind: "string",
|
|
92
|
+
nullable: !0
|
|
93
|
+
} },
|
|
94
|
+
content: {
|
|
95
|
+
expression: "text*",
|
|
96
|
+
kind: "inline"
|
|
97
|
+
},
|
|
98
|
+
label: "Code block",
|
|
99
|
+
nodeType: "codeBlock",
|
|
100
|
+
potentialOperations: o,
|
|
101
|
+
role: "text_block"
|
|
102
|
+
}),
|
|
103
|
+
i({
|
|
104
|
+
attributes: a,
|
|
105
|
+
content: {
|
|
106
|
+
expression: null,
|
|
107
|
+
kind: "none"
|
|
108
|
+
},
|
|
109
|
+
label: "Hard break",
|
|
110
|
+
nodeType: "hardBreak",
|
|
111
|
+
potentialOperations: o,
|
|
112
|
+
role: "inline_atom"
|
|
113
|
+
}),
|
|
114
|
+
i({
|
|
115
|
+
attributes: a,
|
|
116
|
+
content: {
|
|
117
|
+
expression: null,
|
|
118
|
+
kind: "none"
|
|
119
|
+
},
|
|
120
|
+
label: "Horizontal rule",
|
|
121
|
+
nodeType: "horizontalRule",
|
|
122
|
+
potentialOperations: o,
|
|
123
|
+
role: "separator"
|
|
124
|
+
}),
|
|
125
|
+
i({
|
|
126
|
+
attributes: a,
|
|
127
|
+
content: {
|
|
128
|
+
expression: "listItem+",
|
|
129
|
+
kind: "structured"
|
|
130
|
+
},
|
|
131
|
+
label: "Bullet list",
|
|
132
|
+
nodeType: "bulletList",
|
|
133
|
+
potentialOperations: o,
|
|
134
|
+
role: "list"
|
|
135
|
+
}),
|
|
136
|
+
i({
|
|
137
|
+
attributes: {
|
|
138
|
+
start: { kind: "number" },
|
|
139
|
+
type: {
|
|
140
|
+
kind: "string",
|
|
141
|
+
nullable: !0
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
content: {
|
|
145
|
+
expression: "listItem+",
|
|
146
|
+
kind: "structured"
|
|
147
|
+
},
|
|
148
|
+
label: "Ordered list",
|
|
149
|
+
nodeType: "orderedList",
|
|
150
|
+
potentialOperations: o,
|
|
151
|
+
role: "list"
|
|
152
|
+
}),
|
|
153
|
+
i({
|
|
154
|
+
attributes: a,
|
|
155
|
+
content: {
|
|
156
|
+
expression: "paragraph block*",
|
|
157
|
+
kind: "structured"
|
|
158
|
+
},
|
|
159
|
+
label: "List item",
|
|
160
|
+
nodeType: "listItem",
|
|
161
|
+
potentialOperations: o,
|
|
162
|
+
role: "list_item"
|
|
163
|
+
}),
|
|
164
|
+
i({
|
|
165
|
+
attributes: a,
|
|
166
|
+
content: {
|
|
167
|
+
expression: "taskItem+",
|
|
168
|
+
kind: "structured"
|
|
169
|
+
},
|
|
170
|
+
label: "Task list",
|
|
171
|
+
nodeType: "taskList",
|
|
172
|
+
potentialOperations: o,
|
|
173
|
+
role: "list"
|
|
174
|
+
}),
|
|
175
|
+
i({
|
|
176
|
+
attributes: { checked: { kind: "boolean" } },
|
|
177
|
+
content: {
|
|
178
|
+
expression: "paragraph block*",
|
|
179
|
+
kind: "structured"
|
|
180
|
+
},
|
|
181
|
+
label: "Task item",
|
|
182
|
+
nodeType: "taskItem",
|
|
183
|
+
potentialOperations: [{
|
|
184
|
+
attributes: ["checked"],
|
|
185
|
+
type: "set_attributes"
|
|
186
|
+
}],
|
|
187
|
+
role: "list_item"
|
|
188
|
+
}),
|
|
189
|
+
i({
|
|
190
|
+
attributes: { variant: {
|
|
191
|
+
kind: "enum",
|
|
192
|
+
values: e
|
|
193
|
+
} },
|
|
194
|
+
content: {
|
|
195
|
+
expression: "block+",
|
|
196
|
+
kind: "block"
|
|
197
|
+
},
|
|
198
|
+
label: "Callout",
|
|
199
|
+
nodeType: "callout",
|
|
200
|
+
potentialOperations: [{
|
|
201
|
+
attributes: ["variant"],
|
|
202
|
+
type: "set_attributes"
|
|
203
|
+
}],
|
|
204
|
+
role: "container"
|
|
205
|
+
}),
|
|
206
|
+
i({
|
|
207
|
+
attributes: a,
|
|
208
|
+
content: {
|
|
209
|
+
expression: "tableRow+",
|
|
210
|
+
kind: "structured"
|
|
211
|
+
},
|
|
212
|
+
label: "Table",
|
|
213
|
+
nodeType: "table",
|
|
214
|
+
potentialOperations: o,
|
|
215
|
+
role: "table"
|
|
216
|
+
}),
|
|
217
|
+
i({
|
|
218
|
+
attributes: a,
|
|
219
|
+
content: {
|
|
220
|
+
expression: "(tableCell | tableHeader)*",
|
|
221
|
+
kind: "structured"
|
|
222
|
+
},
|
|
223
|
+
label: "Table row",
|
|
224
|
+
nodeType: "tableRow",
|
|
225
|
+
potentialOperations: o,
|
|
226
|
+
role: "table_row"
|
|
227
|
+
}),
|
|
228
|
+
...["tableCell", "tableHeader"].map((e) => i({
|
|
229
|
+
attributes: {
|
|
230
|
+
align: {
|
|
231
|
+
kind: "enum",
|
|
232
|
+
nullable: !0,
|
|
233
|
+
values: [
|
|
234
|
+
"left",
|
|
235
|
+
"center",
|
|
236
|
+
"right"
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
colspan: { kind: "number" },
|
|
240
|
+
colwidth: {
|
|
241
|
+
kind: "number_array",
|
|
242
|
+
nullable: !0
|
|
243
|
+
},
|
|
244
|
+
rowspan: { kind: "number" }
|
|
245
|
+
},
|
|
246
|
+
content: {
|
|
247
|
+
expression: "block+",
|
|
248
|
+
kind: "block"
|
|
249
|
+
},
|
|
250
|
+
label: e === "tableCell" ? "Table cell" : "Table header",
|
|
251
|
+
nodeType: e,
|
|
252
|
+
potentialOperations: o,
|
|
253
|
+
role: "table_cell"
|
|
254
|
+
})),
|
|
255
|
+
i({
|
|
256
|
+
attributes: {
|
|
257
|
+
alt: {
|
|
258
|
+
kind: "string",
|
|
259
|
+
nullable: !0
|
|
260
|
+
},
|
|
261
|
+
height: {
|
|
262
|
+
kind: "unknown",
|
|
263
|
+
nullable: !0
|
|
264
|
+
},
|
|
265
|
+
src: {
|
|
266
|
+
kind: "string",
|
|
267
|
+
nullable: !0
|
|
268
|
+
},
|
|
269
|
+
title: {
|
|
270
|
+
kind: "string",
|
|
271
|
+
nullable: !0
|
|
272
|
+
},
|
|
273
|
+
width: {
|
|
274
|
+
kind: "unknown",
|
|
275
|
+
nullable: !0
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
content: {
|
|
279
|
+
expression: null,
|
|
280
|
+
kind: "none"
|
|
281
|
+
},
|
|
282
|
+
label: "Image",
|
|
283
|
+
nodeType: "image",
|
|
284
|
+
potentialOperations: o,
|
|
285
|
+
role: "inline_atom"
|
|
286
|
+
}),
|
|
287
|
+
i({
|
|
288
|
+
attributes: { name: {
|
|
289
|
+
kind: "string",
|
|
290
|
+
nullable: !0
|
|
291
|
+
} },
|
|
292
|
+
content: {
|
|
293
|
+
expression: null,
|
|
294
|
+
kind: "none"
|
|
295
|
+
},
|
|
296
|
+
label: "Emoji",
|
|
297
|
+
nodeType: "emoji",
|
|
298
|
+
potentialOperations: o,
|
|
299
|
+
role: "inline_atom"
|
|
300
|
+
}),
|
|
301
|
+
...["inlineMath", "blockMath"].map((e) => i({
|
|
302
|
+
attributes: { latex: { kind: "string" } },
|
|
303
|
+
content: {
|
|
304
|
+
expression: null,
|
|
305
|
+
kind: "none"
|
|
306
|
+
},
|
|
307
|
+
label: e === "inlineMath" ? "Inline math" : "Block math",
|
|
308
|
+
nodeType: e,
|
|
309
|
+
potentialOperations: o,
|
|
310
|
+
role: e === "inlineMath" ? "inline_atom" : "block_atom"
|
|
311
|
+
})),
|
|
312
|
+
i({
|
|
313
|
+
attributes: {
|
|
314
|
+
description: {
|
|
315
|
+
kind: "string",
|
|
316
|
+
nullable: !0
|
|
317
|
+
},
|
|
318
|
+
display: {
|
|
319
|
+
kind: "enum",
|
|
320
|
+
values: t
|
|
321
|
+
},
|
|
322
|
+
faviconUrl: {
|
|
323
|
+
kind: "string",
|
|
324
|
+
nullable: !0
|
|
325
|
+
},
|
|
326
|
+
fetchedAt: {
|
|
327
|
+
kind: "string",
|
|
328
|
+
nullable: !0
|
|
329
|
+
},
|
|
330
|
+
href: { kind: "string" },
|
|
331
|
+
imageUrl: {
|
|
332
|
+
kind: "string",
|
|
333
|
+
nullable: !0
|
|
334
|
+
},
|
|
335
|
+
linkText: { kind: "string" },
|
|
336
|
+
pageTitle: {
|
|
337
|
+
kind: "string",
|
|
338
|
+
nullable: !0
|
|
339
|
+
},
|
|
340
|
+
siteName: {
|
|
341
|
+
kind: "string",
|
|
342
|
+
nullable: !0
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
content: {
|
|
346
|
+
expression: null,
|
|
347
|
+
kind: "none"
|
|
348
|
+
},
|
|
349
|
+
label: "External link preview",
|
|
350
|
+
nodeType: "externalLinkPreview",
|
|
351
|
+
potentialOperations: o,
|
|
352
|
+
role: "inline_atom"
|
|
353
|
+
})
|
|
354
|
+
], c = (e, t, n, r) => {
|
|
355
|
+
let i = [...t].sort(), a = [...n].sort();
|
|
356
|
+
if (i.length !== a.length || i.some((e, t) => e !== a[t])) throw Error(`Document node capability ${r} ${e} drifted from the Scribe schema: expected [${a.join(", ")}], received [${i.join(", ")}].`);
|
|
357
|
+
}, l = (e, t, n) => {
|
|
358
|
+
if (n.kind === "enum" && (n.values.length === 0 || new Set(n.values).size !== n.values.length)) throw Error(`Document node capability ${e}.${t} requires unique enum values.`);
|
|
359
|
+
}, u = (e) => e.isLeaf ? "none" : e.inlineContent ? "inline" : e.spec.content === "block+" || e.spec.content === "block*" ? "block" : "structured", d = (e, t) => {
|
|
360
|
+
let n = e.nodes[t.nodeType];
|
|
361
|
+
if (!n) throw Error(`Document node capability ${t.nodeType} does not exist in the Scribe schema.`);
|
|
362
|
+
let r = n.spec.content ?? null;
|
|
363
|
+
if (r !== t.content.expression) throw Error(`Document node capability ${t.nodeType} content drifted from the Scribe schema: expected ${String(r)}, received ${String(t.content.expression)}.`);
|
|
364
|
+
let i = u(n);
|
|
365
|
+
if (i !== t.content.kind) throw Error(`Document node capability ${t.nodeType} content kind drifted from the Scribe schema: expected ${i}, received ${t.content.kind}.`);
|
|
366
|
+
let a = Object.keys(t.attributes);
|
|
367
|
+
c("attributes", a, Object.keys(n.spec.attrs ?? {}), t.nodeType), a.forEach((e) => l(t.nodeType, e, t.attributes[e]));
|
|
368
|
+
let o = t.potentialOperations.map((e) => e.type);
|
|
369
|
+
if (new Set(o).size !== o.length) throw Error(`Document node capability ${t.nodeType} repeats a potential operation.`);
|
|
370
|
+
t.potentialOperations.forEach((e) => {
|
|
371
|
+
if (e.type === "replace_content" && r === null) throw Error(`Document node capability ${t.nodeType} cannot replace content on a leaf node.`);
|
|
372
|
+
if (e.type === "set_attributes") {
|
|
373
|
+
if (e.attributes.length === 0) throw Error(`Document node capability ${t.nodeType} must name settable attributes.`);
|
|
374
|
+
if (new Set(e.attributes).size !== e.attributes.length) throw Error(`Document node capability ${t.nodeType} repeats a settable attribute.`);
|
|
375
|
+
e.attributes.forEach((e) => {
|
|
376
|
+
if (!Object.prototype.hasOwnProperty.call(t.attributes, e)) throw Error(`Document node capability ${t.nodeType} cannot set unknown attribute ${e}.`);
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}, f = (e) => {
|
|
381
|
+
let t = Object.freeze(Object.fromEntries(Object.entries(e.attributes).map(([e, t]) => [e, Object.freeze(t.kind === "enum" ? {
|
|
382
|
+
...t,
|
|
383
|
+
values: Object.freeze([...t.values])
|
|
384
|
+
} : { ...t })]))), n = Object.freeze(e.potentialOperations.map((e) => Object.freeze(e.type === "set_attributes" ? {
|
|
385
|
+
...e,
|
|
386
|
+
attributes: Object.freeze([...e.attributes])
|
|
387
|
+
} : { ...e })));
|
|
388
|
+
return Object.freeze({
|
|
389
|
+
attributes: t,
|
|
390
|
+
content: Object.freeze({ ...e.content }),
|
|
391
|
+
label: e.label,
|
|
392
|
+
nodeType: e.nodeType,
|
|
393
|
+
potentialOperations: n,
|
|
394
|
+
role: e.role
|
|
395
|
+
});
|
|
396
|
+
}, p = (e, t = []) => {
|
|
397
|
+
let n = /* @__PURE__ */ new Map(), r = t.map((e) => e.nodeType).filter((t) => !e.nodes[t]);
|
|
398
|
+
if (r.length > 0) throw Error(`Document node capabilities do not exist in the Scribe schema: ${r.join(", ")}.`);
|
|
399
|
+
for (let e of [...s, ...t]) {
|
|
400
|
+
if (n.has(e.nodeType)) throw Error(`Document node capability ${e.nodeType} is declared more than once.`);
|
|
401
|
+
n.set(e.nodeType, e);
|
|
402
|
+
}
|
|
403
|
+
let i = Object.keys(e.nodes), a = i.map((e) => n.get(e)), o = i.filter((e, t) => !a[t]);
|
|
404
|
+
if (o.length > 0) throw Error(`Document node capabilities are missing for schema nodes: ${o.join(", ")}.`);
|
|
405
|
+
let c = a.map((t) => (d(e, t), [t.nodeType, f(t)]));
|
|
406
|
+
return Object.freeze(Object.fromEntries(c));
|
|
407
|
+
};
|
|
408
|
+
//#endregion
|
|
409
|
+
export { n as SCRIBE_DOCUMENT_NODE_CAPABILITY_ROLES, r as SCRIBE_DOCUMENT_NODE_CONTENT_KINDS, p as createScribeDocumentNodeCapabilityManifest, i as defineScribeDocumentNodeCapability };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./schema-extensions-
|
|
1
|
+
import { n as e, r as t, t as n } from "./schema-extensions-ggKYCkRf.js";
|
|
2
2
|
import r from "./components/Scribe/extension/extension-markdown-paste.js";
|
|
3
3
|
import { SlashCommand as i } from "./components/Scribe/extension/slashCommand/index.js";
|
|
4
4
|
import a from "./components/Scribe/extension/extension-selectedText.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeExternalLinkPreviewElement as e, normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
|
|
2
|
-
import { t as n } from "./purify.es-
|
|
2
|
+
import { t as n } from "./purify.es-CpMrJENN.js";
|
|
3
3
|
//#region node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.js
|
|
4
4
|
function r(e) {
|
|
5
5
|
for (var t = 1; t < arguments.length; t++) {
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
|
|
2
2
|
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
|
|
3
3
|
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
|
|
4
|
-
import { t as s } from "./html-to-markdown-
|
|
5
|
-
import { t as c } from "./markdown-to-html-
|
|
4
|
+
import { t as s } from "./html-to-markdown-CKpceHDk.js";
|
|
5
|
+
import { t as c } from "./markdown-to-html-zj2j0HLf.js";
|
|
6
6
|
import { isInViewport as l } from "./utils/is-in-viewport.js";
|
|
7
7
|
import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
|
|
8
8
|
import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";
|