notra-editor 0.5.0 → 0.6.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/dist/components/code-block-view/code-block-shell.cjs +41 -0
- package/dist/components/code-block-view/code-block-shell.cjs.map +1 -0
- package/dist/components/code-block-view/code-block-shell.d.cts +11 -0
- package/dist/components/code-block-view/code-block-shell.d.ts +11 -0
- package/dist/components/code-block-view/code-block-shell.mjs +17 -0
- package/dist/components/code-block-view/code-block-shell.mjs.map +1 -0
- package/dist/components/{code-block-view.cjs → code-block-view/code-block-view.cjs} +16 -8
- package/dist/components/code-block-view/code-block-view.cjs.map +1 -0
- package/dist/components/code-block-view/code-block-view.d.cts +6 -0
- package/dist/components/code-block-view/code-block-view.d.ts +6 -0
- package/dist/components/code-block-view/code-block-view.mjs +26 -0
- package/dist/components/code-block-view/code-block-view.mjs.map +1 -0
- package/dist/components/code-block-view/language-select.cjs +91 -0
- package/dist/components/code-block-view/language-select.cjs.map +1 -0
- package/dist/components/code-block-view/language-select.d.cts +11 -0
- package/dist/components/code-block-view/language-select.d.ts +11 -0
- package/dist/components/code-block-view/language-select.mjs +74 -0
- package/dist/components/code-block-view/language-select.mjs.map +1 -0
- package/dist/components/ui/command.cjs +144 -0
- package/dist/components/ui/command.cjs.map +1 -0
- package/dist/components/ui/command.d.cts +12 -0
- package/dist/components/ui/command.d.ts +12 -0
- package/dist/components/ui/command.mjs +115 -0
- package/dist/components/ui/command.mjs.map +1 -0
- package/dist/extensions/code-block.cjs +76 -19
- package/dist/extensions/code-block.cjs.map +1 -1
- package/dist/extensions/code-block.d.cts +7 -3
- package/dist/extensions/code-block.d.ts +7 -3
- package/dist/extensions/code-block.mjs +73 -8
- package/dist/extensions/code-block.mjs.map +1 -1
- package/dist/extensions/editor.d.cts +3 -3
- package/dist/extensions/editor.d.ts +3 -3
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/shared.cjs +5 -1
- package/dist/extensions/shared.cjs.map +1 -1
- package/dist/extensions/shared.d.cts +2 -1
- package/dist/extensions/shared.d.ts +2 -1
- package/dist/extensions/shared.mjs +5 -1
- package/dist/extensions/shared.mjs.map +1 -1
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/highlight-code-to-html.cjs +38 -0
- package/dist/lib/highlight-code-to-html.cjs.map +1 -0
- package/dist/lib/highlight-code-to-html.d.cts +6 -0
- package/dist/lib/highlight-code-to-html.d.ts +6 -0
- package/dist/lib/highlight-code-to-html.mjs +14 -0
- package/dist/lib/highlight-code-to-html.mjs.map +1 -0
- package/dist/lib/languages.cjs +181 -0
- package/dist/lib/languages.cjs.map +1 -0
- package/dist/lib/languages.d.cts +24 -0
- package/dist/lib/languages.d.ts +24 -0
- package/dist/lib/languages.mjs +155 -0
- package/dist/lib/languages.mjs.map +1 -0
- package/dist/notra-reader.cjs +32 -3
- package/dist/notra-reader.cjs.map +1 -1
- package/dist/notra-reader.d.cts +11 -1
- package/dist/notra-reader.d.ts +11 -1
- package/dist/notra-reader.mjs +32 -3
- package/dist/notra-reader.mjs.map +1 -1
- package/dist/styles/globals.css +109 -0
- package/dist/themes/default/shared.css +132 -5
- package/package.json +5 -1
- package/dist/components/code-block-view.cjs.map +0 -1
- package/dist/components/code-block-view.d.cts +0 -12
- package/dist/components/code-block-view.d.ts +0 -12
- package/dist/components/code-block-view.mjs +0 -17
- package/dist/components/code-block-view.mjs.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { SearchIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
function Command({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
CommandPrimitive,
|
|
11
|
+
{
|
|
12
|
+
className: cn(
|
|
13
|
+
"nt:flex nt:h-full nt:w-full nt:flex-col nt:overflow-hidden nt:rounded-lg nt:bg-popover nt:text-popover-foreground",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
"data-slot": "command",
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function CommandInput({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: "nt:flex nt:items-center nt:gap-2 nt:border-b nt:border-foreground/10 nt:px-3",
|
|
29
|
+
"data-slot": "command-input-wrapper",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "nt:size-4 nt:shrink-0 nt:opacity-50" }),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
CommandPrimitive.Input,
|
|
34
|
+
{
|
|
35
|
+
className: cn(
|
|
36
|
+
"nt:flex nt:h-9 nt:w-full nt:rounded-md nt:bg-transparent nt:py-3 nt:text-sm nt:outline-hidden nt:placeholder:text-muted-foreground nt:disabled:cursor-not-allowed nt:disabled:opacity-50",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
"data-slot": "command-input",
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function CommandList({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
CommandPrimitive.List,
|
|
53
|
+
{
|
|
54
|
+
className: cn(
|
|
55
|
+
"nt:max-h-[300px] nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
"data-slot": "command-list",
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function CommandEmpty({
|
|
64
|
+
...props
|
|
65
|
+
}) {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
CommandPrimitive.Empty,
|
|
68
|
+
{
|
|
69
|
+
className: "nt:py-6 nt:text-center nt:text-sm",
|
|
70
|
+
"data-slot": "command-empty",
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function CommandGroup({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
CommandPrimitive.Group,
|
|
81
|
+
{
|
|
82
|
+
className: cn(
|
|
83
|
+
"nt:overflow-hidden nt:p-1 nt:text-foreground nt:[&_[cmdk-group-heading]]:px-2 nt:[&_[cmdk-group-heading]]:py-1.5 nt:[&_[cmdk-group-heading]]:text-xs nt:[&_[cmdk-group-heading]]:font-medium nt:[&_[cmdk-group-heading]]:text-muted-foreground",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
"data-slot": "command-group",
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function CommandItem({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
CommandPrimitive.Item,
|
|
97
|
+
{
|
|
98
|
+
className: cn(
|
|
99
|
+
"nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-md nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:data-[selected=true]:bg-accent nt:data-[selected=true]:text-accent-foreground nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50",
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
"data-slot": "command-item",
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
Command,
|
|
109
|
+
CommandEmpty,
|
|
110
|
+
CommandGroup,
|
|
111
|
+
CommandInput,
|
|
112
|
+
CommandItem,
|
|
113
|
+
CommandList
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:h-full nt:w-full nt:flex-col nt:overflow-hidden nt:rounded-lg nt:bg-popover nt:text-popover-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"nt:flex nt:items-center nt:gap-2 nt:border-b nt:border-foreground/10 nt:px-3\"\n\t\t\tdata-slot=\"command-input-wrapper\"\n\t\t>\n\t\t\t<SearchIcon className=\"nt:size-4 nt:shrink-0 nt:opacity-50\" />\n\t\t\t<CommandPrimitive.Input\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:flex nt:h-9 nt:w-full nt:rounded-md nt:bg-transparent nt:py-3 nt:text-sm nt:outline-hidden nt:placeholder:text-muted-foreground nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t'nt:max-h-[300px] nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-list\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tclassName=\"nt:py-6 nt:text-center nt:text-sm\"\n\t\t\tdata-slot=\"command-empty\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tclassName={cn(\n\t\t\t\t'nt:overflow-hidden nt:p-1 nt:text-foreground nt:[&_[cmdk-group-heading]]:px-2 nt:[&_[cmdk-group-heading]]:py-1.5 nt:[&_[cmdk-group-heading]]:text-xs nt:[&_[cmdk-group-heading]]:font-medium nt:[&_[cmdk-group-heading]]:text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-md nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:data-[selected=true]:bg-accent nt:data-[selected=true]:text-accent-foreground nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-item\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList\n};\n"],"mappings":"AAWE,cAgBA,YAhBA;AAXF,SAAS,WAAW,wBAAwB;AAC5C,SAAS,kBAAkB;AAG3B,SAAS,UAAU;AAEnB,SAAS,QAAQ;AAAA,EAChB;AAAA,EACA,GAAG;AACJ,GAAkD;AACjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,aAAU;AAAA,MAEV;AAAA,4BAAC,cAAW,WAAU,uCAAsC;AAAA,QAC5D;AAAA,UAAC,iBAAiB;AAAA,UAAjB;AAAA,YACA,WAAW;AAAA,cACV;AAAA,cACA;AAAA,YACD;AAAA,YACA,aAAU;AAAA,YACT,GAAG;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAU;AAAA,MACV,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,30 +15,89 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var code_block_exports = {};
|
|
30
20
|
__export(code_block_exports, {
|
|
31
|
-
CodeBlockExtension: () => CodeBlockExtension
|
|
21
|
+
CodeBlockExtension: () => CodeBlockExtension,
|
|
22
|
+
createCodeBlockExtension: () => createCodeBlockExtension,
|
|
23
|
+
defaultLowlight: () => defaultLowlight
|
|
32
24
|
});
|
|
33
25
|
module.exports = __toCommonJS(code_block_exports);
|
|
34
|
-
var
|
|
26
|
+
var import_core = require("@tiptap/core");
|
|
27
|
+
var import_extension_code_block_lowlight = require("@tiptap/extension-code-block-lowlight");
|
|
35
28
|
var import_react = require("@tiptap/react");
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
var import_lowlight = require("lowlight");
|
|
30
|
+
var import_code_block_view = require("../components/code-block-view/code-block-view");
|
|
31
|
+
var import_languages = require("../lib/languages");
|
|
32
|
+
const defaultLowlight = (0, import_lowlight.createLowlight)(import_lowlight.common);
|
|
33
|
+
const backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
|
|
34
|
+
const tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
|
|
35
|
+
function createCodeBlockExtension(lowlight) {
|
|
36
|
+
return import_extension_code_block_lowlight.CodeBlockLowlight.configure({
|
|
37
|
+
lowlight,
|
|
38
|
+
// Tab inserts spaces instead of leaving the editor; Shift-Tab dedents.
|
|
39
|
+
enableTabIndentation: true,
|
|
40
|
+
tabSize: 2
|
|
41
|
+
}).extend({
|
|
42
|
+
addNodeView() {
|
|
43
|
+
return (0, import_react.ReactNodeViewRenderer)(import_code_block_view.CodeBlockView);
|
|
44
|
+
},
|
|
45
|
+
addKeyboardShortcuts() {
|
|
46
|
+
const parent = this.parent?.() ?? {};
|
|
47
|
+
return {
|
|
48
|
+
...parent,
|
|
49
|
+
Tab: ({ editor }) => {
|
|
50
|
+
if (!this.options.enableTabIndentation) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const tabSize = this.options.tabSize ?? 2;
|
|
54
|
+
const { selection } = editor.state;
|
|
55
|
+
const { $from, empty } = selection;
|
|
56
|
+
if ($from.parent.type !== this.type) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const indent = " ".repeat(tabSize);
|
|
60
|
+
if (empty) {
|
|
61
|
+
return editor.commands.command(({ tr }) => {
|
|
62
|
+
tr.insertText(indent);
|
|
63
|
+
return true;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return editor.commands.command(({ tr, state }) => {
|
|
67
|
+
const { from, to } = selection;
|
|
68
|
+
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
69
|
+
const indented = text.split("\n").map((line) => indent + line).join("\n");
|
|
70
|
+
tr.replaceWith(from, to, state.schema.text(indented));
|
|
71
|
+
return true;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
addInputRules() {
|
|
77
|
+
return [
|
|
78
|
+
(0, import_core.textblockTypeInputRule)({
|
|
79
|
+
find: backtickInputRegex,
|
|
80
|
+
type: this.type,
|
|
81
|
+
getAttributes: (match) => ({
|
|
82
|
+
language: (0, import_languages.normalizeLanguage)(match[1])
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
(0, import_core.textblockTypeInputRule)({
|
|
86
|
+
find: tildeInputRegex,
|
|
87
|
+
type: this.type,
|
|
88
|
+
getAttributes: (match) => ({
|
|
89
|
+
language: (0, import_languages.normalizeLanguage)(match[1])
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const CodeBlockExtension = createCodeBlockExtension(defaultLowlight);
|
|
42
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
98
|
0 && (module.exports = {
|
|
44
|
-
CodeBlockExtension
|
|
99
|
+
CodeBlockExtension,
|
|
100
|
+
createCodeBlockExtension,
|
|
101
|
+
defaultLowlight
|
|
45
102
|
});
|
|
46
103
|
//# sourceMappingURL=code-block.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/code-block.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/code-block.ts"],"sourcesContent":["import { textblockTypeInputRule } from '@tiptap/core';\nimport { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight';\nimport { ReactNodeViewRenderer } from '@tiptap/react';\nimport { common, createLowlight } from 'lowlight';\n\nimport { CodeBlockView } from '../components/code-block-view/code-block-view';\nimport { normalizeLanguage } from '../lib/languages';\n\ntype Lowlight = ReturnType<typeof createLowlight>;\n\n// Module-level instance, shared by the default CodeBlockExtension and the\n// reader. Loads the lowlight `common` set (~37 mainstream languages, ~150 KB).\n// Consumers needing more or fewer languages should call createCodeBlockExtension\n// with their own instance and pass the same instance to <NotraReader lowlight={…} />.\nexport const defaultLowlight: Lowlight = createLowlight(common);\n\n// Mirrors the regexes in @tiptap/extension-code-block. Override the rules so\n// the captured language is collapsed to its canonical LANGUAGES value before\n// being written to the node attribute (e.g. ```js → language: \"javascript\").\nconst backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/;\nconst tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/;\n\nexport function createCodeBlockExtension(lowlight: Lowlight) {\n\treturn CodeBlockLowlight.configure({\n\t\tlowlight,\n\t\t// Tab inserts spaces instead of leaving the editor; Shift-Tab dedents.\n\t\tenableTabIndentation: true,\n\t\ttabSize: 2\n\t}).extend({\n\t\taddNodeView() {\n\t\t\treturn ReactNodeViewRenderer(CodeBlockView);\n\t\t},\n\t\taddKeyboardShortcuts() {\n\t\t\tconst parent = this.parent?.() ?? {};\n\n\t\t\t// Upstream's empty-selection Tab branch goes through\n\t\t\t// `editor.commands.insertContent(' '.repeat(tabSize))`, which\n\t\t\t// `tiptap-markdown` reroutes via its overridden `insertContentAt`\n\t\t\t// → `markdown.parser.parse(...)`. Whitespace-only input parses to\n\t\t\t// an empty document, so the spaces vanish while the keymap still\n\t\t\t// reports the event as handled. Use a raw transaction instead.\n\t\t\treturn {\n\t\t\t\t...parent,\n\t\t\t\tTab: ({ editor }) => {\n\t\t\t\t\tif (!this.options.enableTabIndentation) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst tabSize = this.options.tabSize ?? 2;\n\t\t\t\t\tconst { selection } = editor.state;\n\t\t\t\t\tconst { $from, empty } = selection;\n\n\t\t\t\t\tif ($from.parent.type !== this.type) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst indent = ' '.repeat(tabSize);\n\n\t\t\t\t\tif (empty) {\n\t\t\t\t\t\treturn editor.commands.command(({ tr }) => {\n\t\t\t\t\t\t\ttr.insertText(indent);\n\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn editor.commands.command(({ tr, state }) => {\n\t\t\t\t\t\tconst { from, to } = selection;\n\t\t\t\t\t\tconst text = state.doc.textBetween(from, to, '\\n', '\\n');\n\t\t\t\t\t\tconst indented = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.map((line) => indent + line)\n\t\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\t\ttr.replaceWith(from, to, state.schema.text(indented));\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\taddInputRules() {\n\t\t\treturn [\n\t\t\t\ttextblockTypeInputRule({\n\t\t\t\t\tfind: backtickInputRegex,\n\t\t\t\t\ttype: this.type,\n\t\t\t\t\tgetAttributes: (match) => ({\n\t\t\t\t\t\tlanguage: normalizeLanguage(match[1])\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t\ttextblockTypeInputRule({\n\t\t\t\t\tfind: tildeInputRegex,\n\t\t\t\t\ttype: this.type,\n\t\t\t\t\tgetAttributes: (match) => ({\n\t\t\t\t\t\tlanguage: normalizeLanguage(match[1])\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t});\n}\n\nexport const CodeBlockExtension = createCodeBlockExtension(defaultLowlight);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AACvC,2CAAkC;AAClC,mBAAsC;AACtC,sBAAuC;AAEvC,6BAA8B;AAC9B,uBAAkC;AAQ3B,MAAM,sBAA4B,gCAAe,sBAAM;AAK9D,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAEjB,SAAS,yBAAyB,UAAoB;AAC5D,SAAO,uDAAkB,UAAU;AAAA,IAClC;AAAA;AAAA,IAEA,sBAAsB;AAAA,IACtB,SAAS;AAAA,EACV,CAAC,EAAE,OAAO;AAAA,IACT,cAAc;AACb,iBAAO,oCAAsB,oCAAa;AAAA,IAC3C;AAAA,IACA,uBAAuB;AACtB,YAAM,SAAS,KAAK,SAAS,KAAK,CAAC;AAQnC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,KAAK,CAAC,EAAE,OAAO,MAAM;AACpB,cAAI,CAAC,KAAK,QAAQ,sBAAsB;AACvC,mBAAO;AAAA,UACR;AAEA,gBAAM,UAAU,KAAK,QAAQ,WAAW;AACxC,gBAAM,EAAE,UAAU,IAAI,OAAO;AAC7B,gBAAM,EAAE,OAAO,MAAM,IAAI;AAEzB,cAAI,MAAM,OAAO,SAAS,KAAK,MAAM;AACpC,mBAAO;AAAA,UACR;AAEA,gBAAM,SAAS,IAAI,OAAO,OAAO;AAEjC,cAAI,OAAO;AACV,mBAAO,OAAO,SAAS,QAAQ,CAAC,EAAE,GAAG,MAAM;AAC1C,iBAAG,WAAW,MAAM;AAEpB,qBAAO;AAAA,YACR,CAAC;AAAA,UACF;AAEA,iBAAO,OAAO,SAAS,QAAQ,CAAC,EAAE,IAAI,MAAM,MAAM;AACjD,kBAAM,EAAE,MAAM,GAAG,IAAI;AACrB,kBAAM,OAAO,MAAM,IAAI,YAAY,MAAM,IAAI,MAAM,IAAI;AACvD,kBAAM,WAAW,KACf,MAAM,IAAI,EACV,IAAI,CAAC,SAAS,SAAS,IAAI,EAC3B,KAAK,IAAI;AACX,eAAG,YAAY,MAAM,IAAI,MAAM,OAAO,KAAK,QAAQ,CAAC;AAEpD,mBAAO;AAAA,UACR,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,IACA,gBAAgB;AACf,aAAO;AAAA,YACN,oCAAuB;AAAA,UACtB,MAAM;AAAA,UACN,MAAM,KAAK;AAAA,UACX,eAAe,CAAC,WAAW;AAAA,YAC1B,cAAU,oCAAkB,MAAM,CAAC,CAAC;AAAA,UACrC;AAAA,QACD,CAAC;AAAA,YACD,oCAAuB;AAAA,UACtB,MAAM;AAAA,UACN,MAAM,KAAK;AAAA,UACX,eAAe,CAAC,WAAW;AAAA,YAC1B,cAAU,oCAAkB,MAAM,CAAC,CAAC;AAAA,UACrC;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEO,MAAM,qBAAqB,yBAAyB,eAAe;","names":[]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
import * as
|
|
2
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
3
|
+
import { createLowlight } from 'lowlight';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
type Lowlight = ReturnType<typeof createLowlight>;
|
|
6
|
+
declare const defaultLowlight: Lowlight;
|
|
7
|
+
declare function createCodeBlockExtension(lowlight: Lowlight): _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
8
|
+
declare const CodeBlockExtension: _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
5
9
|
|
|
6
|
-
export { CodeBlockExtension };
|
|
10
|
+
export { CodeBlockExtension, createCodeBlockExtension, defaultLowlight };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
import * as
|
|
2
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
3
|
+
import { createLowlight } from 'lowlight';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
type Lowlight = ReturnType<typeof createLowlight>;
|
|
6
|
+
declare const defaultLowlight: Lowlight;
|
|
7
|
+
declare function createCodeBlockExtension(lowlight: Lowlight): _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
8
|
+
declare const CodeBlockExtension: _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
5
9
|
|
|
6
|
-
export { CodeBlockExtension };
|
|
10
|
+
export { CodeBlockExtension, createCodeBlockExtension, defaultLowlight };
|
|
@@ -1,12 +1,77 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { textblockTypeInputRule } from "@tiptap/core";
|
|
2
|
+
import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
|
|
2
3
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { common, createLowlight } from "lowlight";
|
|
5
|
+
import { CodeBlockView } from "../components/code-block-view/code-block-view";
|
|
6
|
+
import { normalizeLanguage } from "../lib/languages";
|
|
7
|
+
const defaultLowlight = createLowlight(common);
|
|
8
|
+
const backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
|
|
9
|
+
const tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
|
|
10
|
+
function createCodeBlockExtension(lowlight) {
|
|
11
|
+
return CodeBlockLowlight.configure({
|
|
12
|
+
lowlight,
|
|
13
|
+
// Tab inserts spaces instead of leaving the editor; Shift-Tab dedents.
|
|
14
|
+
enableTabIndentation: true,
|
|
15
|
+
tabSize: 2
|
|
16
|
+
}).extend({
|
|
17
|
+
addNodeView() {
|
|
18
|
+
return ReactNodeViewRenderer(CodeBlockView);
|
|
19
|
+
},
|
|
20
|
+
addKeyboardShortcuts() {
|
|
21
|
+
const parent = this.parent?.() ?? {};
|
|
22
|
+
return {
|
|
23
|
+
...parent,
|
|
24
|
+
Tab: ({ editor }) => {
|
|
25
|
+
if (!this.options.enableTabIndentation) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const tabSize = this.options.tabSize ?? 2;
|
|
29
|
+
const { selection } = editor.state;
|
|
30
|
+
const { $from, empty } = selection;
|
|
31
|
+
if ($from.parent.type !== this.type) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const indent = " ".repeat(tabSize);
|
|
35
|
+
if (empty) {
|
|
36
|
+
return editor.commands.command(({ tr }) => {
|
|
37
|
+
tr.insertText(indent);
|
|
38
|
+
return true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return editor.commands.command(({ tr, state }) => {
|
|
42
|
+
const { from, to } = selection;
|
|
43
|
+
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
44
|
+
const indented = text.split("\n").map((line) => indent + line).join("\n");
|
|
45
|
+
tr.replaceWith(from, to, state.schema.text(indented));
|
|
46
|
+
return true;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
addInputRules() {
|
|
52
|
+
return [
|
|
53
|
+
textblockTypeInputRule({
|
|
54
|
+
find: backtickInputRegex,
|
|
55
|
+
type: this.type,
|
|
56
|
+
getAttributes: (match) => ({
|
|
57
|
+
language: normalizeLanguage(match[1])
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
textblockTypeInputRule({
|
|
61
|
+
find: tildeInputRegex,
|
|
62
|
+
type: this.type,
|
|
63
|
+
getAttributes: (match) => ({
|
|
64
|
+
language: normalizeLanguage(match[1])
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const CodeBlockExtension = createCodeBlockExtension(defaultLowlight);
|
|
9
72
|
export {
|
|
10
|
-
CodeBlockExtension
|
|
73
|
+
CodeBlockExtension,
|
|
74
|
+
createCodeBlockExtension,
|
|
75
|
+
defaultLowlight
|
|
11
76
|
};
|
|
12
77
|
//# sourceMappingURL=code-block.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/code-block.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/code-block.ts"],"sourcesContent":["import { textblockTypeInputRule } from '@tiptap/core';\nimport { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight';\nimport { ReactNodeViewRenderer } from '@tiptap/react';\nimport { common, createLowlight } from 'lowlight';\n\nimport { CodeBlockView } from '../components/code-block-view/code-block-view';\nimport { normalizeLanguage } from '../lib/languages';\n\ntype Lowlight = ReturnType<typeof createLowlight>;\n\n// Module-level instance, shared by the default CodeBlockExtension and the\n// reader. Loads the lowlight `common` set (~37 mainstream languages, ~150 KB).\n// Consumers needing more or fewer languages should call createCodeBlockExtension\n// with their own instance and pass the same instance to <NotraReader lowlight={…} />.\nexport const defaultLowlight: Lowlight = createLowlight(common);\n\n// Mirrors the regexes in @tiptap/extension-code-block. Override the rules so\n// the captured language is collapsed to its canonical LANGUAGES value before\n// being written to the node attribute (e.g. ```js → language: \"javascript\").\nconst backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/;\nconst tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/;\n\nexport function createCodeBlockExtension(lowlight: Lowlight) {\n\treturn CodeBlockLowlight.configure({\n\t\tlowlight,\n\t\t// Tab inserts spaces instead of leaving the editor; Shift-Tab dedents.\n\t\tenableTabIndentation: true,\n\t\ttabSize: 2\n\t}).extend({\n\t\taddNodeView() {\n\t\t\treturn ReactNodeViewRenderer(CodeBlockView);\n\t\t},\n\t\taddKeyboardShortcuts() {\n\t\t\tconst parent = this.parent?.() ?? {};\n\n\t\t\t// Upstream's empty-selection Tab branch goes through\n\t\t\t// `editor.commands.insertContent(' '.repeat(tabSize))`, which\n\t\t\t// `tiptap-markdown` reroutes via its overridden `insertContentAt`\n\t\t\t// → `markdown.parser.parse(...)`. Whitespace-only input parses to\n\t\t\t// an empty document, so the spaces vanish while the keymap still\n\t\t\t// reports the event as handled. Use a raw transaction instead.\n\t\t\treturn {\n\t\t\t\t...parent,\n\t\t\t\tTab: ({ editor }) => {\n\t\t\t\t\tif (!this.options.enableTabIndentation) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst tabSize = this.options.tabSize ?? 2;\n\t\t\t\t\tconst { selection } = editor.state;\n\t\t\t\t\tconst { $from, empty } = selection;\n\n\t\t\t\t\tif ($from.parent.type !== this.type) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst indent = ' '.repeat(tabSize);\n\n\t\t\t\t\tif (empty) {\n\t\t\t\t\t\treturn editor.commands.command(({ tr }) => {\n\t\t\t\t\t\t\ttr.insertText(indent);\n\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn editor.commands.command(({ tr, state }) => {\n\t\t\t\t\t\tconst { from, to } = selection;\n\t\t\t\t\t\tconst text = state.doc.textBetween(from, to, '\\n', '\\n');\n\t\t\t\t\t\tconst indented = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.map((line) => indent + line)\n\t\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\t\ttr.replaceWith(from, to, state.schema.text(indented));\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\taddInputRules() {\n\t\t\treturn [\n\t\t\t\ttextblockTypeInputRule({\n\t\t\t\t\tfind: backtickInputRegex,\n\t\t\t\t\ttype: this.type,\n\t\t\t\t\tgetAttributes: (match) => ({\n\t\t\t\t\t\tlanguage: normalizeLanguage(match[1])\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t\ttextblockTypeInputRule({\n\t\t\t\t\tfind: tildeInputRegex,\n\t\t\t\t\ttype: this.type,\n\t\t\t\t\tgetAttributes: (match) => ({\n\t\t\t\t\t\tlanguage: normalizeLanguage(match[1])\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t});\n}\n\nexport const CodeBlockExtension = createCodeBlockExtension(defaultLowlight);\n"],"mappings":"AAAA,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,QAAQ,sBAAsB;AAEvC,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAQ3B,MAAM,kBAA4B,eAAe,MAAM;AAK9D,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAEjB,SAAS,yBAAyB,UAAoB;AAC5D,SAAO,kBAAkB,UAAU;AAAA,IAClC;AAAA;AAAA,IAEA,sBAAsB;AAAA,IACtB,SAAS;AAAA,EACV,CAAC,EAAE,OAAO;AAAA,IACT,cAAc;AACb,aAAO,sBAAsB,aAAa;AAAA,IAC3C;AAAA,IACA,uBAAuB;AACtB,YAAM,SAAS,KAAK,SAAS,KAAK,CAAC;AAQnC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,KAAK,CAAC,EAAE,OAAO,MAAM;AACpB,cAAI,CAAC,KAAK,QAAQ,sBAAsB;AACvC,mBAAO;AAAA,UACR;AAEA,gBAAM,UAAU,KAAK,QAAQ,WAAW;AACxC,gBAAM,EAAE,UAAU,IAAI,OAAO;AAC7B,gBAAM,EAAE,OAAO,MAAM,IAAI;AAEzB,cAAI,MAAM,OAAO,SAAS,KAAK,MAAM;AACpC,mBAAO;AAAA,UACR;AAEA,gBAAM,SAAS,IAAI,OAAO,OAAO;AAEjC,cAAI,OAAO;AACV,mBAAO,OAAO,SAAS,QAAQ,CAAC,EAAE,GAAG,MAAM;AAC1C,iBAAG,WAAW,MAAM;AAEpB,qBAAO;AAAA,YACR,CAAC;AAAA,UACF;AAEA,iBAAO,OAAO,SAAS,QAAQ,CAAC,EAAE,IAAI,MAAM,MAAM;AACjD,kBAAM,EAAE,MAAM,GAAG,IAAI;AACrB,kBAAM,OAAO,MAAM,IAAI,YAAY,MAAM,IAAI,MAAM,IAAI;AACvD,kBAAM,WAAW,KACf,MAAM,IAAI,EACV,IAAI,CAAC,SAAS,SAAS,IAAI,EAC3B,KAAK,IAAI;AACX,eAAG,YAAY,MAAM,IAAI,MAAM,OAAO,KAAK,QAAQ,CAAC;AAEpD,mBAAO;AAAA,UACR,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,IACA,gBAAgB;AACf,aAAO;AAAA,QACN,uBAAuB;AAAA,UACtB,MAAM;AAAA,UACN,MAAM,KAAK;AAAA,UACX,eAAe,CAAC,WAAW;AAAA,YAC1B,UAAU,kBAAkB,MAAM,CAAC,CAAC;AAAA,UACrC;AAAA,QACD,CAAC;AAAA,QACD,uBAAuB;AAAA,UACtB,MAAM;AAAA,UACN,MAAM,KAAK;AAAA,UACX,eAAe,CAAC,WAAW;AAAA,YAC1B,UAAU,kBAAkB,MAAM,CAAC,CAAC;AAAA,UACrC;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEO,MAAM,qBAAqB,yBAAyB,eAAe;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as tiptap_markdown from 'tiptap-markdown';
|
|
2
|
-
import * as _tiptap_extension_code_block from '@tiptap/extension-code-block';
|
|
3
2
|
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
4
3
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
5
|
-
import * as _tiptap_core from '@tiptap/core';
|
|
6
4
|
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
7
7
|
|
|
8
|
-
declare const editorExtensions: (_tiptap_core.
|
|
8
|
+
declare const editorExtensions: (_tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any> | _tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
9
9
|
|
|
10
10
|
export { editorExtensions };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as tiptap_markdown from 'tiptap-markdown';
|
|
2
|
-
import * as _tiptap_extension_code_block from '@tiptap/extension-code-block';
|
|
3
2
|
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
4
3
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
5
|
-
import * as _tiptap_core from '@tiptap/core';
|
|
6
4
|
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
7
7
|
|
|
8
|
-
declare const editorExtensions: (_tiptap_core.
|
|
8
|
+
declare const editorExtensions: (_tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any> | _tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
9
9
|
|
|
10
10
|
export { editorExtensions };
|
|
@@ -3,6 +3,6 @@ export { editorExtensions } from './editor.cjs';
|
|
|
3
3
|
import '@tiptap/extension-image';
|
|
4
4
|
import '@tiptap/extension-list';
|
|
5
5
|
import '@tiptap/core';
|
|
6
|
+
import '@tiptap/extension-code-block-lowlight';
|
|
6
7
|
import '@tiptap/starter-kit';
|
|
7
8
|
import 'tiptap-markdown';
|
|
8
|
-
import '@tiptap/extension-code-block';
|
|
@@ -3,6 +3,6 @@ export { editorExtensions } from './editor.js';
|
|
|
3
3
|
import '@tiptap/extension-image';
|
|
4
4
|
import '@tiptap/extension-list';
|
|
5
5
|
import '@tiptap/core';
|
|
6
|
+
import '@tiptap/extension-code-block-lowlight';
|
|
6
7
|
import '@tiptap/starter-kit';
|
|
7
8
|
import 'tiptap-markdown';
|
|
8
|
-
import '@tiptap/extension-code-block';
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(shared_exports);
|
|
|
35
35
|
var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
|
|
36
36
|
var import_extension_list = require("@tiptap/extension-list");
|
|
37
37
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
|
|
38
|
+
var import_code_block = require("./code-block");
|
|
38
39
|
const starterKitBaseConfig = {
|
|
39
40
|
heading: { levels: [1, 2, 3, 4, 5, 6] },
|
|
40
41
|
link: {
|
|
@@ -45,7 +46,9 @@ const starterKitBaseConfig = {
|
|
|
45
46
|
bulletList: false,
|
|
46
47
|
orderedList: false,
|
|
47
48
|
listItem: false,
|
|
48
|
-
listKeymap: false
|
|
49
|
+
listKeymap: false,
|
|
50
|
+
// Disable StarterKit's vanilla code-block; use the lowlight one instead
|
|
51
|
+
codeBlock: false
|
|
49
52
|
};
|
|
50
53
|
const sharedExtensions = [
|
|
51
54
|
import_starter_kit.default.configure({
|
|
@@ -56,6 +59,7 @@ const sharedExtensions = [
|
|
|
56
59
|
trailingNode: false
|
|
57
60
|
}),
|
|
58
61
|
import_extension_list.ListKit,
|
|
62
|
+
import_code_block.CodeBlockExtension,
|
|
59
63
|
import_extension_image.default
|
|
60
64
|
];
|
|
61
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\nimport { CodeBlockExtension } from './code-block';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead),\n// no codeBlock (use the lowlight-extended CodeBlockExtension instead).\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false,\n\t// Disable StarterKit's vanilla code-block; use the lowlight one instead\n\tcodeBlock: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit,\n\tCodeBlockExtension,\n\tImage\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAkB;AAClB,4BAAwB;AACxB,yBAAmD;AAEnD,wBAAmC;AAI5B,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA;AAAA,EAEZ,WAAW;AACZ;AAIO,MAAM,mBAAmB;AAAA,EAC/B,mBAAAA,QAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AAAA,EACA;AAAA,EACA,uBAAAC;AACD;","names":["StarterKit","Image"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
2
2
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
3
3
|
import * as _tiptap_core from '@tiptap/core';
|
|
4
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
4
5
|
import { StarterKitOptions } from '@tiptap/starter-kit';
|
|
5
6
|
|
|
6
7
|
declare const starterKitBaseConfig: Partial<StarterKitOptions>;
|
|
7
|
-
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
8
|
+
declare const sharedExtensions: (_tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any> | _tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
8
9
|
|
|
9
10
|
export { sharedExtensions, starterKitBaseConfig };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
2
2
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
3
3
|
import * as _tiptap_core from '@tiptap/core';
|
|
4
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
4
5
|
import { StarterKitOptions } from '@tiptap/starter-kit';
|
|
5
6
|
|
|
6
7
|
declare const starterKitBaseConfig: Partial<StarterKitOptions>;
|
|
7
|
-
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
8
|
+
declare const sharedExtensions: (_tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any> | _tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
8
9
|
|
|
9
10
|
export { sharedExtensions, starterKitBaseConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Image from "@tiptap/extension-image";
|
|
2
2
|
import { ListKit } from "@tiptap/extension-list";
|
|
3
3
|
import StarterKit from "@tiptap/starter-kit";
|
|
4
|
+
import { CodeBlockExtension } from "./code-block";
|
|
4
5
|
const starterKitBaseConfig = {
|
|
5
6
|
heading: { levels: [1, 2, 3, 4, 5, 6] },
|
|
6
7
|
link: {
|
|
@@ -11,7 +12,9 @@ const starterKitBaseConfig = {
|
|
|
11
12
|
bulletList: false,
|
|
12
13
|
orderedList: false,
|
|
13
14
|
listItem: false,
|
|
14
|
-
listKeymap: false
|
|
15
|
+
listKeymap: false,
|
|
16
|
+
// Disable StarterKit's vanilla code-block; use the lowlight one instead
|
|
17
|
+
codeBlock: false
|
|
15
18
|
};
|
|
16
19
|
const sharedExtensions = [
|
|
17
20
|
StarterKit.configure({
|
|
@@ -22,6 +25,7 @@ const sharedExtensions = [
|
|
|
22
25
|
trailingNode: false
|
|
23
26
|
}),
|
|
24
27
|
ListKit,
|
|
28
|
+
CodeBlockExtension,
|
|
25
29
|
Image
|
|
26
30
|
];
|
|
27
31
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\nimport { CodeBlockExtension } from './code-block';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead),\n// no codeBlock (use the lowlight-extended CodeBlockExtension instead).\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false,\n\t// Disable StarterKit's vanilla code-block; use the lowlight one instead\n\tcodeBlock: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit,\n\tCodeBlockExtension,\n\tImage\n];\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,OAAO,gBAA4C;AAEnD,SAAS,0BAA0B;AAI5B,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA;AAAA,EAEZ,WAAW;AACZ;AAIO,MAAM,mBAAmB;AAAA,EAC/B,WAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -20,8 +20,11 @@ var index_exports = {};
|
|
|
20
20
|
__export(index_exports, {
|
|
21
21
|
BlockquoteButton: () => import_blockquote_button.BlockquoteButton,
|
|
22
22
|
CodeBlockButton: () => import_code_block_button.CodeBlockButton,
|
|
23
|
+
CodeBlockExtension: () => import_code_block.CodeBlockExtension,
|
|
23
24
|
HeadingDropdownMenu: () => import_heading_dropdown_menu.HeadingDropdownMenu,
|
|
24
25
|
ImagePopover: () => import_image_popover.ImagePopover,
|
|
26
|
+
LANGUAGES: () => import_languages.LANGUAGES,
|
|
27
|
+
LanguageSelect: () => import_language_select.LanguageSelect,
|
|
25
28
|
LinkPopover: () => import_link_popover.LinkPopover,
|
|
26
29
|
ListDropdownMenu: () => import_list_dropdown_menu.ListDropdownMenu,
|
|
27
30
|
MarkButton: () => import_mark_button.MarkButton,
|
|
@@ -31,7 +34,11 @@ __export(index_exports, {
|
|
|
31
34
|
Toolbar: () => import_toolbar.Toolbar,
|
|
32
35
|
ToolbarGroup: () => import_toolbar.ToolbarGroup,
|
|
33
36
|
ToolbarSeparator: () => import_toolbar.ToolbarSeparator,
|
|
34
|
-
UndoRedoButton: () => import_undo_redo_button.UndoRedoButton
|
|
37
|
+
UndoRedoButton: () => import_undo_redo_button.UndoRedoButton,
|
|
38
|
+
createCodeBlockExtension: () => import_code_block.createCodeBlockExtension,
|
|
39
|
+
defaultLowlight: () => import_code_block.defaultLowlight,
|
|
40
|
+
getLanguageLabel: () => import_languages.getLanguageLabel,
|
|
41
|
+
highlightCodeToHtml: () => import_highlight_code_to_html.highlightCodeToHtml
|
|
35
42
|
});
|
|
36
43
|
module.exports = __toCommonJS(index_exports);
|
|
37
44
|
var import_globals = require("./styles/globals.css");
|
|
@@ -47,12 +54,19 @@ var import_blockquote_button = require("./components/blockquote-button/blockquot
|
|
|
47
54
|
var import_code_block_button = require("./components/code-block-button/code-block-button");
|
|
48
55
|
var import_link_popover = require("./components/link-popover/link-popover");
|
|
49
56
|
var import_image_popover = require("./components/image-popover/image-popover");
|
|
57
|
+
var import_code_block = require("./extensions/code-block");
|
|
58
|
+
var import_language_select = require("./components/code-block-view/language-select");
|
|
59
|
+
var import_languages = require("./lib/languages");
|
|
60
|
+
var import_highlight_code_to_html = require("./lib/highlight-code-to-html");
|
|
50
61
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
62
|
0 && (module.exports = {
|
|
52
63
|
BlockquoteButton,
|
|
53
64
|
CodeBlockButton,
|
|
65
|
+
CodeBlockExtension,
|
|
54
66
|
HeadingDropdownMenu,
|
|
55
67
|
ImagePopover,
|
|
68
|
+
LANGUAGES,
|
|
69
|
+
LanguageSelect,
|
|
56
70
|
LinkPopover,
|
|
57
71
|
ListDropdownMenu,
|
|
58
72
|
MarkButton,
|
|
@@ -62,6 +76,10 @@ var import_image_popover = require("./components/image-popover/image-popover");
|
|
|
62
76
|
Toolbar,
|
|
63
77
|
ToolbarGroup,
|
|
64
78
|
ToolbarSeparator,
|
|
65
|
-
UndoRedoButton
|
|
79
|
+
UndoRedoButton,
|
|
80
|
+
createCodeBlockExtension,
|
|
81
|
+
defaultLowlight,
|
|
82
|
+
getLanguageLabel,
|
|
83
|
+
highlightCodeToHtml
|
|
66
84
|
});
|
|
67
85
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n\nexport { ImagePopover } from './components/image-popover/image-popover';\nexport type { ImagePopoverProps } from './components/image-popover/image-popover';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAO;AAEP,0BAA4B;AAG5B,0BAA4B;AAG5B,qBAIO;AAMP,8BAA+B;AAG/B,oBAAuB;AAEvB,yBAA2B;AAI3B,mCAAoC;AAGpC,gCAAiC;AAGjC,+BAAiC;AAGjC,+BAAgC;AAGhC,0BAA4B;AAG5B,2BAA6B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n\nexport { ImagePopover } from './components/image-popover/image-popover';\nexport type { ImagePopoverProps } from './components/image-popover/image-popover';\n\nexport {\n\tCodeBlockExtension,\n\tcreateCodeBlockExtension,\n\tdefaultLowlight\n} from './extensions/code-block';\n\nexport { LanguageSelect } from './components/code-block-view/language-select';\nexport type { LanguageSelectProps } from './components/code-block-view/language-select';\n\nexport { LANGUAGES, getLanguageLabel } from './lib/languages';\nexport type { Language } from './lib/languages';\n\nexport { highlightCodeToHtml } from './lib/highlight-code-to-html';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAO;AAEP,0BAA4B;AAG5B,0BAA4B;AAG5B,qBAIO;AAMP,8BAA+B;AAG/B,oBAAuB;AAEvB,yBAA2B;AAI3B,mCAAoC;AAGpC,gCAAiC;AAGjC,+BAAiC;AAGjC,+BAAgC;AAGhC,0BAA4B;AAG5B,2BAA6B;AAG7B,wBAIO;AAEP,6BAA+B;AAG/B,uBAA4C;AAG5C,oCAAoC;","names":[]}
|