@aicayzer/inkkit 0.2.0 → 0.3.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.
|
@@ -43687,27 +43687,9 @@ function remarkComments() {
|
|
|
43687
43687
|
});
|
|
43688
43688
|
return (tree) => {
|
|
43689
43689
|
const visit = (node, inline, parentType) => {
|
|
43690
|
-
if (parentType === "listItem" && node.type === "inkkitCommentBlock") return {
|
|
43691
|
-
type: "paragraph",
|
|
43692
|
-
children: [{
|
|
43693
|
-
...node,
|
|
43694
|
-
type: "inkkitCommentInline",
|
|
43695
|
-
block: true
|
|
43696
|
-
}],
|
|
43697
|
-
position: node.position
|
|
43698
|
-
};
|
|
43699
43690
|
if (node.type === "html") {
|
|
43700
43691
|
const spans = htmlSpans(node.value);
|
|
43701
|
-
if (spans.length === 1 && spans[0].start === 0 && spans[0].end === node.value.length) return
|
|
43702
|
-
type: "paragraph",
|
|
43703
|
-
children: [{
|
|
43704
|
-
type: "inkkitCommentInline",
|
|
43705
|
-
syntax: "html",
|
|
43706
|
-
value: spans[0].value,
|
|
43707
|
-
position: node.position
|
|
43708
|
-
}],
|
|
43709
|
-
position: node.position
|
|
43710
|
-
} : {
|
|
43692
|
+
if (spans.length === 1 && spans[0].start === 0 && spans[0].end === node.value.length) return {
|
|
43711
43693
|
type: inline ? "inkkitCommentInline" : "inkkitCommentBlock",
|
|
43712
43694
|
syntax: "html",
|
|
43713
43695
|
value: spans[0].value,
|
|
@@ -44483,7 +44465,7 @@ function isHTMLElement(node) {
|
|
|
44483
44465
|
return isElement(node) && node.namespaceURI === "http://www.w3.org/1999/xhtml";
|
|
44484
44466
|
}
|
|
44485
44467
|
//#endregion
|
|
44486
|
-
//#region node_modules/.pnpm/prosemirror-drop-indicator@0.1.
|
|
44468
|
+
//#region node_modules/.pnpm/prosemirror-drop-indicator@0.1.4_patch_hash=4afd7e652c59a5f25f8ecc7b74d6370bde7273ee46a28766df1490663f928940/node_modules/prosemirror-drop-indicator/dist/index.js
|
|
44487
44469
|
function getTargetsByView(view) {
|
|
44488
44470
|
const stack = [[-1, view.state.doc]];
|
|
44489
44471
|
const targets = [];
|
|
@@ -44639,6 +44621,8 @@ function createDropIndicatorView(view, getTarget, options) {
|
|
|
44639
44621
|
let hasDragOverEvent = false;
|
|
44640
44622
|
const scheduleHide = () => {
|
|
44641
44623
|
if (hideId) clearTimeout(hideId);
|
|
44624
|
+
prevX = void 0;
|
|
44625
|
+
prevY = void 0;
|
|
44642
44626
|
hasDragOverEvent = false;
|
|
44643
44627
|
hideId = setTimeout(() => {
|
|
44644
44628
|
if (hasDragOverEvent) return;
|
|
@@ -44679,6 +44663,7 @@ function createDropIndicatorView(view, getTarget, options) {
|
|
|
44679
44663
|
dom.addEventListener("drop", scheduleHide);
|
|
44680
44664
|
dom.addEventListener("dragleave", scheduleHide);
|
|
44681
44665
|
const destroy = () => {
|
|
44666
|
+
if (hideId) clearTimeout(hideId);
|
|
44682
44667
|
dom.removeEventListener("dragover", handleDragOver);
|
|
44683
44668
|
dom.removeEventListener("dragend", scheduleHide);
|
|
44684
44669
|
dom.removeEventListener("drop", scheduleHide);
|
|
@@ -45782,6 +45767,18 @@ function retainText(raw, before, after, inTable = false, written, beside = [fals
|
|
|
45782
45767
|
const read = decodedOffsets(raw, true);
|
|
45783
45768
|
if (read?.decoded !== before) return after;
|
|
45784
45769
|
const { offsets } = read;
|
|
45770
|
+
const lineStart = after.lastIndexOf("\n", prefix - 1) + 1;
|
|
45771
|
+
if (lineStart > 0 && written !== void 0) {
|
|
45772
|
+
const canonical = decodedOffsets(written, true);
|
|
45773
|
+
if (canonical?.decoded === after) {
|
|
45774
|
+
const opening = written.slice(canonical.offsets[lineStart]);
|
|
45775
|
+
const marker = /^(?:\d+)?\\[#+.\->)]/.exec(opening)?.[0];
|
|
45776
|
+
if (marker && prefix - lineStart <= decodedOffsets(marker).decoded.length) {
|
|
45777
|
+
prefix = lineStart;
|
|
45778
|
+
return raw.slice(0, offsets[prefix]) + written.slice(canonical.offsets[prefix], canonical.offsets[after.length - suffix]) + raw.slice(offsets[before.length - suffix]);
|
|
45779
|
+
}
|
|
45780
|
+
}
|
|
45781
|
+
}
|
|
45785
45782
|
if (written !== void 0 && (beside[0] && prefix === 0 || beside[1] && suffix === 0)) {
|
|
45786
45783
|
const writtenOffsets = decodedOffsets(written);
|
|
45787
45784
|
if (writtenOffsets && writtenOffsets.decoded === after) return raw.slice(0, offsets[prefix]) + written.slice(writtenOffsets.offsets[prefix], writtenOffsets.offsets[after.length - suffix]) + raw.slice(offsets[before.length - suffix]);
|
|
@@ -57510,7 +57507,7 @@ var InkKitEditor = class InkKitEditor {
|
|
|
57510
57507
|
return true;
|
|
57511
57508
|
}
|
|
57512
57509
|
}));
|
|
57513
|
-
}).use(labelsCtx).use(instance.pasteController.plugin).use(visibleClipboard).use($prose(() => instance.suggestions.plugin())).use(instance.keymapPlugin).use(createDialect(Boolean(options.images || options.files), Boolean(options.wikiLinks), Boolean(options.files))).use(codeControlCtx).use(codeControlsPlugin(() => instance.viewport().rect)).use(tablePlugins).use(tableBlock).use(instance.changePlugin).use(instance.historyInputPlugin).use(history).use(clipboard).use(cursor).use(taskListPlugin).use(quoteBackspace).use(calloutEnter).use(literalEnter).use(literalReread).use(listItemBackspace).use(listItemShiftTab).use(nestedItemEnter).use(rejoinLists).use(movedListItems).use(textInputPolicy).use(events.copy ? codeCopyPlugin((text) => events.copy?.(text)) : []).use(placeholderPlugin).use(options.rendering?.codeHighlighting === false ? [] : (await import("./highlight-
|
|
57510
|
+
}).use(labelsCtx).use(instance.pasteController.plugin).use(visibleClipboard).use($prose(() => instance.suggestions.plugin())).use(instance.keymapPlugin).use(createDialect(Boolean(options.images || options.files), Boolean(options.wikiLinks), Boolean(options.files))).use(codeControlCtx).use(codeControlsPlugin(() => instance.viewport().rect)).use(tablePlugins).use(tableBlock).use(instance.changePlugin).use(instance.historyInputPlugin).use(history).use(clipboard).use(cursor).use(taskListPlugin).use(quoteBackspace).use(calloutEnter).use(literalEnter).use(literalReread).use(listItemBackspace).use(listItemShiftTab).use(nestedItemEnter).use(rejoinLists).use(movedListItems).use(textInputPolicy).use(events.copy ? codeCopyPlugin((text) => events.copy?.(text)) : []).use(placeholderPlugin).use(options.rendering?.codeHighlighting === false ? [] : (await import("./highlight-D6evOlOs.js")).highlightPlugin).use(options.rendering?.diagramPreview === false || !diagramsAvailable() ? [] : mermaidPreview((error) => instance.report(error))).use(selectionPlugin).use($prose(() => search())).use(instance.policyPlugin).use(options.wikiLinks ? wikiLinkView(options.wikiLinks, {
|
|
57514
57511
|
capture: () => instance.adapterCapture(),
|
|
57515
57512
|
active: () => instance.ready && !instance.destroyed && !instance.literalSurface,
|
|
57516
57513
|
labels: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Decoration, c as PluginKey, d as __toESM, i as $prose, o as DecorationSet, s as Plugin, u as __commonJSMin } from "./core-
|
|
1
|
+
import { a as Decoration, c as PluginKey, d as __toESM, i as $prose, o as DecorationSet, s as Plugin, u as __commonJSMin } from "./core-DrVCeBzK.js";
|
|
2
2
|
//#region node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/arduino.js
|
|
3
3
|
/** @type LanguageFn */
|
|
4
4
|
function cPlusPlus(hljs) {
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as InkKitError, t as InkKitEditor } from "./chunks/core-
|
|
1
|
+
import { r as InkKitError, t as InkKitEditor } from "./chunks/core-DrVCeBzK.js";
|
|
2
2
|
export { InkKitEditor, InkKitError };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as registerMermaid, r as InkKitError, t as InkKitEditor } from "./chunks/core-
|
|
1
|
+
import { n as registerMermaid, r as InkKitError, t as InkKitEditor } from "./chunks/core-DrVCeBzK.js";
|
|
2
2
|
//#region src/index.ts
|
|
3
3
|
registerMermaid(async () => (await import("mermaid")).default);
|
|
4
4
|
//#endregion
|
package/dist/style.css
CHANGED
|
@@ -81,7 +81,10 @@
|
|
|
81
81
|
overflow-x: auto;
|
|
82
82
|
}
|
|
83
83
|
.inkkit-root .ProseMirror table {
|
|
84
|
-
border-collapse:
|
|
84
|
+
border-collapse: separate;
|
|
85
|
+
border-spacing: 0;
|
|
86
|
+
border: 1px solid var(--_inkkit-rule);
|
|
87
|
+
border-radius: var(--inkkit-table-radius, 4px);
|
|
85
88
|
width: 100%;
|
|
86
89
|
}
|
|
87
90
|
.inkkit-root .ProseMirror td,
|
|
@@ -91,9 +94,39 @@
|
|
|
91
94
|
min-width: calc(var(--inkkit-font-size, 15px) * 4);
|
|
92
95
|
padding: calc(var(--inkkit-font-size, 15px) * 0.4)
|
|
93
96
|
calc(var(--inkkit-font-size, 15px) * 0.6);
|
|
94
|
-
border:
|
|
97
|
+
border: 0 solid var(--_inkkit-rule);
|
|
98
|
+
border-width: 0 1px 1px 0;
|
|
95
99
|
vertical-align: top;
|
|
96
100
|
}
|
|
101
|
+
/* Round only the perimeter; keep controls and focus rings outside the table
|
|
102
|
+
unclipped, and leave every internal cell division square. */
|
|
103
|
+
.inkkit-root .ProseMirror tr > :last-child {
|
|
104
|
+
border-right-width: 0;
|
|
105
|
+
}
|
|
106
|
+
.inkkit-root .ProseMirror tr:last-child > * {
|
|
107
|
+
border-bottom-width: 0;
|
|
108
|
+
}
|
|
109
|
+
.inkkit-root .ProseMirror tr:first-child > :first-child {
|
|
110
|
+
border-top-left-radius: max(0px, calc(var(--inkkit-table-radius, 4px) - 1px));
|
|
111
|
+
}
|
|
112
|
+
.inkkit-root .ProseMirror tr:first-child > :last-child {
|
|
113
|
+
border-top-right-radius: max(
|
|
114
|
+
0px,
|
|
115
|
+
calc(var(--inkkit-table-radius, 4px) - 1px)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
.inkkit-root .ProseMirror tr:last-child > :first-child {
|
|
119
|
+
border-bottom-left-radius: max(
|
|
120
|
+
0px,
|
|
121
|
+
calc(var(--inkkit-table-radius, 4px) - 1px)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
.inkkit-root .ProseMirror tr:last-child > :last-child {
|
|
125
|
+
border-bottom-right-radius: max(
|
|
126
|
+
0px,
|
|
127
|
+
calc(var(--inkkit-table-radius, 4px) - 1px)
|
|
128
|
+
);
|
|
129
|
+
}
|
|
97
130
|
.inkkit-root .ProseMirror th {
|
|
98
131
|
background: var(--_inkkit-code-bg);
|
|
99
132
|
font-weight: 600;
|
|
@@ -107,6 +140,7 @@
|
|
|
107
140
|
position: absolute;
|
|
108
141
|
inset: 0;
|
|
109
142
|
z-index: 2;
|
|
143
|
+
border-radius: inherit;
|
|
110
144
|
content: '';
|
|
111
145
|
background: color-mix(in srgb, var(--_inkkit-accent) 25%, transparent);
|
|
112
146
|
pointer-events: none;
|
|
@@ -665,7 +699,11 @@
|
|
|
665
699
|
width: var(--_inkkit-task-size);
|
|
666
700
|
height: var(--_inkkit-task-size);
|
|
667
701
|
box-sizing: border-box;
|
|
668
|
-
border: 1.5px solid
|
|
702
|
+
border: 1.5px solid
|
|
703
|
+
var(
|
|
704
|
+
--inkkit-checkbox-border-color,
|
|
705
|
+
color-mix(in srgb, CanvasText 35%, transparent)
|
|
706
|
+
);
|
|
669
707
|
border-radius: 4px;
|
|
670
708
|
cursor: pointer;
|
|
671
709
|
}
|
|
@@ -808,7 +846,7 @@
|
|
|
808
846
|
}
|
|
809
847
|
|
|
810
848
|
.inkkit-root .inkkit-reference-definition {
|
|
811
|
-
font-family:
|
|
849
|
+
font-family: var(--_inkkit-mono);
|
|
812
850
|
font-size: calc(var(--inkkit-font-size, 15px) * 0.8);
|
|
813
851
|
opacity: 0.7;
|
|
814
852
|
}
|
|
@@ -963,11 +1001,13 @@
|
|
|
963
1001
|
background: var(--inkkit-menu-background, light-dark(#fff, #252529));
|
|
964
1002
|
color: var(--inkkit-menu-text, CanvasText);
|
|
965
1003
|
box-shadow: var(--inkkit-menu-shadow, 0 4px 18px #0003);
|
|
966
|
-
font:
|
|
1004
|
+
font: calc(var(--inkkit-font-size, 15px) * 14 / 15) /
|
|
1005
|
+
calc(var(--inkkit-font-size, 15px) * 1.6)
|
|
1006
|
+
var(--inkkit-font-family, system-ui, sans-serif);
|
|
967
1007
|
}
|
|
968
1008
|
.inkkit-root .inkkit-suggestions [role='option'] {
|
|
969
1009
|
box-sizing: border-box;
|
|
970
|
-
height: 32px;
|
|
1010
|
+
min-height: 32px;
|
|
971
1011
|
display: flex;
|
|
972
1012
|
align-items: center;
|
|
973
1013
|
gap: 8px;
|
|
@@ -1027,8 +1067,9 @@
|
|
|
1027
1067
|
}
|
|
1028
1068
|
.inkkit-root .inkkit-code-language:focus-visible,
|
|
1029
1069
|
.inkkit-root .inkkit-copy:focus-visible {
|
|
1030
|
-
outline:
|
|
1031
|
-
|
|
1070
|
+
outline: var(--inkkit-focus-width, 2px) solid
|
|
1071
|
+
var(--inkkit-focus-color, var(--_inkkit-accent));
|
|
1072
|
+
outline-offset: var(--inkkit-focus-offset, 1px);
|
|
1032
1073
|
}
|
|
1033
1074
|
.inkkit-root .inkkit-code-language-menu {
|
|
1034
1075
|
position: fixed;
|
|
@@ -1078,3 +1119,7 @@
|
|
|
1078
1119
|
.inkkit-root .inkkit-code-language-list button[aria-pressed='true'] {
|
|
1079
1120
|
background: color-mix(in srgb, CanvasText 8%, transparent);
|
|
1080
1121
|
}
|
|
1122
|
+
|
|
1123
|
+
.inkkit-root .milkdown-drop-indicator {
|
|
1124
|
+
background: var(--inkkit-drop-indicator-color, var(--_inkkit-accent));
|
|
1125
|
+
}
|