@fiestaboard/ui 3.0.1 → 3.2.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/containment/json-tree.d.ts +59 -0
- package/dist/components/containment/json-tree.js +122 -0
- package/dist/components/containment/json-tree.js.map +1 -0
- package/dist/components/editor/color-picker-content.d.ts +25 -0
- package/dist/components/editor/color-picker-content.js +118 -0
- package/dist/components/editor/color-picker-content.js.map +1 -0
- package/dist/components/editor/constants.d.ts +87 -0
- package/dist/components/editor/constants.js +29 -0
- package/dist/components/editor/constants.js.map +1 -0
- package/dist/components/editor/draw-char-picker-content.d.ts +22 -0
- package/dist/components/editor/draw-char-picker-content.js +79 -0
- package/dist/components/editor/draw-char-picker-content.js.map +1 -0
- package/dist/components/editor/extensions/color-tile-node.d.ts +10 -0
- package/dist/components/editor/extensions/color-tile-node.js +43 -0
- package/dist/components/editor/extensions/color-tile-node.js.map +1 -0
- package/dist/components/editor/extensions/fill-space-node.d.ts +10 -0
- package/dist/components/editor/extensions/fill-space-node.js +40 -0
- package/dist/components/editor/extensions/fill-space-node.js.map +1 -0
- package/dist/components/editor/extensions/formula-node.d.ts +6 -0
- package/dist/components/editor/extensions/formula-node.js +40 -0
- package/dist/components/editor/extensions/formula-node.js.map +1 -0
- package/dist/components/editor/extensions/line-navigation.d.ts +18 -0
- package/dist/components/editor/extensions/line-navigation.js +16 -0
- package/dist/components/editor/extensions/line-navigation.js.map +1 -0
- package/dist/components/editor/extensions/single-paragraph-doc.d.ts +15 -0
- package/dist/components/editor/extensions/single-paragraph-doc.js +11 -0
- package/dist/components/editor/extensions/single-paragraph-doc.js.map +1 -0
- package/dist/components/editor/extensions/trailing-newline.d.ts +13 -0
- package/dist/components/editor/extensions/trailing-newline.js +27 -0
- package/dist/components/editor/extensions/trailing-newline.js.map +1 -0
- package/dist/components/editor/extensions/variable-node.d.ts +15 -0
- package/dist/components/editor/extensions/variable-node.js +56 -0
- package/dist/components/editor/extensions/variable-node.js.map +1 -0
- package/dist/components/editor/extensions/wrapped-text-node.d.ts +9 -0
- package/dist/components/editor/extensions/wrapped-text-node.js +31 -0
- package/dist/components/editor/extensions/wrapped-text-node.js.map +1 -0
- package/dist/components/editor/filter-picker-content.d.ts +24 -0
- package/dist/components/editor/filter-picker-content.js +146 -0
- package/dist/components/editor/filter-picker-content.js.map +1 -0
- package/dist/components/editor/formatting-picker-content.d.ts +30 -0
- package/dist/components/editor/formatting-picker-content.js +154 -0
- package/dist/components/editor/formatting-picker-content.js.map +1 -0
- package/dist/components/editor/formula/formula-editor-panel.d.ts +102 -0
- package/dist/components/editor/formula/formula-editor-panel.js +527 -0
- package/dist/components/editor/formula/formula-editor-panel.js.map +1 -0
- package/dist/components/editor/node-views/color-tile-node-view.d.ts +21 -0
- package/dist/components/editor/node-views/color-tile-node-view.js +66 -0
- package/dist/components/editor/node-views/color-tile-node-view.js.map +1 -0
- package/dist/components/editor/node-views/fill-space-node-view.d.ts +16 -0
- package/dist/components/editor/node-views/fill-space-node-view.js +43 -0
- package/dist/components/editor/node-views/fill-space-node-view.js.map +1 -0
- package/dist/components/editor/node-views/formula-node-view.d.ts +39 -0
- package/dist/components/editor/node-views/formula-node-view.js +109 -0
- package/dist/components/editor/node-views/formula-node-view.js.map +1 -0
- package/dist/components/editor/node-views/node-view-context.d.ts +58 -0
- package/dist/components/editor/node-views/node-view-context.js +22 -0
- package/dist/components/editor/node-views/node-view-context.js.map +1 -0
- package/dist/components/editor/node-views/variable-node-view.d.ts +16 -0
- package/dist/components/editor/node-views/variable-node-view.js +63 -0
- package/dist/components/editor/node-views/variable-node-view.js.map +1 -0
- package/dist/components/editor/node-views/wrapped-text-view.d.ts +14 -0
- package/dist/components/editor/node-views/wrapped-text-view.js +46 -0
- package/dist/components/editor/node-views/wrapped-text-view.js.map +1 -0
- package/dist/components/editor/template-editor-toolbar.d.ts +146 -0
- package/dist/components/editor/template-editor-toolbar.js +434 -0
- package/dist/components/editor/template-editor-toolbar.js.map +1 -0
- package/dist/components/editor/template-editor.d.ts +109 -0
- package/dist/components/editor/template-editor.js +662 -0
- package/dist/components/editor/template-editor.js.map +1 -0
- package/dist/components/editor/toolbar-dropdown.d.ts +20 -0
- package/dist/components/editor/toolbar-dropdown.js +88 -0
- package/dist/components/editor/toolbar-dropdown.js.map +1 -0
- package/dist/components/editor/utils/draw-mode.d.ts +55 -0
- package/dist/components/editor/utils/draw-mode.js +79 -0
- package/dist/components/editor/utils/draw-mode.js.map +1 -0
- package/dist/components/editor/utils/insertion.d.ts +11 -0
- package/dist/components/editor/utils/insertion.js +26 -0
- package/dist/components/editor/utils/insertion.js.map +1 -0
- package/dist/components/editor/utils/length-calculator.d.ts +36 -0
- package/dist/components/editor/utils/length-calculator.js +32 -0
- package/dist/components/editor/utils/length-calculator.js.map +1 -0
- package/dist/components/editor/utils/serialization.d.ts +34 -0
- package/dist/components/editor/utils/serialization.js +184 -0
- package/dist/components/editor/utils/serialization.js.map +1 -0
- package/dist/components/editor/utils/stroke-transaction.d.ts +36 -0
- package/dist/components/editor/utils/stroke-transaction.js +57 -0
- package/dist/components/editor/utils/stroke-transaction.js.map +1 -0
- package/dist/components/editor/variable-picker-content.d.ts +130 -0
- package/dist/components/editor/variable-picker-content.js +422 -0
- package/dist/components/editor/variable-picker-content.js.map +1 -0
- package/dist/components/feedback/status-dot.d.ts +49 -0
- package/dist/components/feedback/status-dot.js +58 -0
- package/dist/components/feedback/status-dot.js.map +1 -0
- package/dist/components/forms/secret-input.d.ts +38 -0
- package/dist/components/forms/secret-input.js +42 -0
- package/dist/components/forms/secret-input.js.map +1 -0
- package/dist/components/forms/time-picker.d.ts +87 -0
- package/dist/components/forms/time-picker.js +260 -0
- package/dist/components/forms/time-picker.js.map +1 -0
- package/dist/components/forms/toggle-card.d.ts +120 -0
- package/dist/components/forms/toggle-card.js +211 -0
- package/dist/components/forms/toggle-card.js.map +1 -0
- package/dist/components/overlays/popover.d.ts +65 -0
- package/dist/components/overlays/popover.js +89 -0
- package/dist/components/overlays/popover.js.map +1 -0
- package/dist/editor.css +164 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +95 -61
- package/dist/lib/board-colors.d.ts +16 -0
- package/dist/lib/board-colors.js +14 -14
- package/dist/lib/board-colors.js.map +1 -1
- package/dist/lib/use-deps-changed.d.ts +33 -0
- package/dist/lib/use-deps-changed.js +11 -0
- package/dist/lib/use-deps-changed.js.map +1 -0
- package/package.json +50 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { FillSpaceNodeView as e } from "../node-views/fill-space-node-view.js";
|
|
3
|
+
import { ReactNodeViewRenderer as t } from "@tiptap/react";
|
|
4
|
+
import { Node as n, mergeAttributes as r } from "@tiptap/core";
|
|
5
|
+
//#region src/components/editor/extensions/fill-space-node.ts
|
|
6
|
+
var i = n.create({
|
|
7
|
+
name: "fillSpace",
|
|
8
|
+
group: "inline",
|
|
9
|
+
inline: !0,
|
|
10
|
+
atom: !0,
|
|
11
|
+
selectable: !1,
|
|
12
|
+
draggable: !0,
|
|
13
|
+
addAttributes() {
|
|
14
|
+
return {
|
|
15
|
+
id: {
|
|
16
|
+
default: "",
|
|
17
|
+
parseHTML: (e) => e.getAttribute("data-id"),
|
|
18
|
+
renderHTML: (e) => ({ "data-id": e.id })
|
|
19
|
+
},
|
|
20
|
+
repeatChar: {
|
|
21
|
+
default: void 0,
|
|
22
|
+
parseHTML: (e) => e.getAttribute("data-repeat-char") || void 0,
|
|
23
|
+
renderHTML: (e) => e.repeatChar ? { "data-repeat-char": e.repeatChar } : {}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
parseHTML() {
|
|
28
|
+
return [{ tag: "span[data-type=\"fill-space\"]" }];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
31
|
+
return ["span", r({ "data-type": "fill-space" }, e)];
|
|
32
|
+
},
|
|
33
|
+
addNodeView() {
|
|
34
|
+
return t(e);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { i as FillSpaceNode };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=fill-space-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fill-space-node.js","names":[],"sources":["../../../../src/components/editor/extensions/fill-space-node.ts"],"mappings":";;;;;AAgBA,IAAa,IAAgB,EAAK,OAAO;CACvC,MAAM;CAEN,OAAO;CAEP,QAAQ;CAER,MAAM;CAEN,YAAY;CAEZ,WAAW;CAEX,gBAAgB;EACd,OAAO;GACL,IAAI;IACF,SAAS;IACT,YAAY,MAAY,EAAQ,aAAa,SAAS;IACtD,aAAa,OAAgB,EAC3B,WAAW,EAAW,GACxB;GACF;GACA,YAAY;IACV,SAAS,KAAA;IACT,YAAY,MAAY,EAAQ,aAAa,kBAAkB,KAAK,KAAA;IACpE,aAAa,MACP,EAAW,aACN,EAAE,oBAAoB,EAAW,WAAW,IAE9C,CAAC;GAEZ;EACF;CACF;CAEA,YAAY;EACV,OAAO,CACL,EACE,KAAK,iCACP,CACF;CACF;CAEA,WAAW,EAAE,qBAAkB;EAC7B,OAAO,CAAC,QAAQ,EAAgB,EAAE,aAAa,aAAa,GAAG,CAAc,CAAC;CAChF;CAEA,cAAc;EACZ,OAAO,EAAsB,CAAiB;CAChD;AACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { FormulaNodeView as e } from "../node-views/formula-node-view.js";
|
|
3
|
+
import { ReactNodeViewRenderer as t } from "@tiptap/react";
|
|
4
|
+
import { Node as n, mergeAttributes as r } from "@tiptap/core";
|
|
5
|
+
//#region src/components/editor/extensions/formula-node.ts
|
|
6
|
+
var i = n.create({
|
|
7
|
+
name: "formula",
|
|
8
|
+
group: "inline",
|
|
9
|
+
inline: !0,
|
|
10
|
+
atom: !0,
|
|
11
|
+
selectable: !1,
|
|
12
|
+
draggable: !0,
|
|
13
|
+
addAttributes() {
|
|
14
|
+
return {
|
|
15
|
+
expression: {
|
|
16
|
+
default: "",
|
|
17
|
+
parseHTML: (e) => e.getAttribute("data-expression") ?? "",
|
|
18
|
+
renderHTML: (e) => ({ "data-expression": e.expression })
|
|
19
|
+
},
|
|
20
|
+
autoOpen: {
|
|
21
|
+
default: !1,
|
|
22
|
+
parseHTML: () => !1,
|
|
23
|
+
renderHTML: () => ({})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
parseHTML() {
|
|
28
|
+
return [{ tag: "span[data-type=\"formula\"]" }];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
31
|
+
return ["span", r({ "data-type": "formula" }, e)];
|
|
32
|
+
},
|
|
33
|
+
addNodeView() {
|
|
34
|
+
return t(e);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { i as FormulaNode };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=formula-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula-node.js","names":[],"sources":["../../../../src/components/editor/extensions/formula-node.ts"],"mappings":";;;;;AAWA,IAAa,IAAc,EAAK,OAAO;CACrC,MAAM;CAEN,OAAO;CAEP,QAAQ;CAER,MAAM;CAEN,YAAY;CAEZ,WAAW;CAEX,gBAAgB;EACd,OAAO;GACL,YAAY;IACV,SAAS;IACT,YAAY,MAAY,EAAQ,aAAa,iBAAiB,KAAK;IACnE,aAAa,OAAgB,EAC3B,mBAAmB,EAAW,WAChC;GACF;GAGA,UAAU;IACR,SAAS;IACT,iBAAiB;IACjB,mBAAmB,CAAC;GACtB;EACF;CACF;CAEA,YAAY;EACV,OAAO,CACL,EACE,KAAK,8BACP,CACF;CACF;CAEA,WAAW,EAAE,qBAAkB;EAC7B,OAAO,CAAC,QAAQ,EAAgB,EAAE,aAAa,UAAU,GAAG,CAAc,CAAC;CAC7E;CAEA,cAAc;EACZ,OAAO,EAAsB,CAAe;CAC9C;AACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LineNavigation Extension
|
|
3
|
+
*
|
|
4
|
+
* Handles Enter key in the single-paragraph / hardBreak document model.
|
|
5
|
+
* Enter always inserts a hardBreak (line splitting). Validation of the
|
|
6
|
+
* line count is handled externally (the parent shows a warning when over
|
|
7
|
+
* the board limit, but doesn't prevent typing).
|
|
8
|
+
*
|
|
9
|
+
* Shift+Enter is blocked to prevent accidental double-breaks.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: In the full TipTapTemplateEditor, the editorProps `handleKeyDown`
|
|
12
|
+
* intercepts Enter/Shift-Enter before plugin keymaps run, so the shortcuts
|
|
13
|
+
* below are effectively redundant at runtime. They are retained so that
|
|
14
|
+
* unit tests (which instantiate a bare Editor with this extension but
|
|
15
|
+
* without editorProps) still get correct Enter-as-hardBreak behavior.
|
|
16
|
+
*/
|
|
17
|
+
import { Extension } from "@tiptap/core";
|
|
18
|
+
export declare const LineNavigation: Extension<any, any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Extension as e } from "@tiptap/core";
|
|
2
|
+
//#region src/components/editor/extensions/line-navigation.ts
|
|
3
|
+
var t = e.create({
|
|
4
|
+
name: "lineNavigation",
|
|
5
|
+
priority: 1e3,
|
|
6
|
+
addKeyboardShortcuts() {
|
|
7
|
+
return {
|
|
8
|
+
Enter: () => (this.editor.commands.setHardBreak(), !0),
|
|
9
|
+
"Shift-Enter": () => !0
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as LineNavigation };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=line-navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-navigation.js","names":[],"sources":["../../../../src/components/editor/extensions/line-navigation.ts"],"mappings":";;AAkBA,IAAa,IAAiB,EAAU,OAAO;CAC7C,MAAM;CAEN,UAAU;CAEV,uBAAuB;EACrB,OAAO;GACL,cACE,KAAK,OAAO,SAAS,aAAa,GAC3B;GAGT,qBAAqB;EACvB;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SingleParagraphDoc Extension
|
|
3
|
+
*
|
|
4
|
+
* Overrides the default Document node to allow EXACTLY one paragraph.
|
|
5
|
+
* This prevents ProseMirror's built-in `splitBlock` command (bound to
|
|
6
|
+
* Enter in the base keymap) from ever creating a second paragraph.
|
|
7
|
+
*
|
|
8
|
+
* Without this, a race condition or priority mis-ordering could let
|
|
9
|
+
* splitBlock run, which would:
|
|
10
|
+
* 1. Create two <p> nodes,
|
|
11
|
+
* 2. Place the cursor at position 0 of the second <p>,
|
|
12
|
+
* 3. Confuse the serializer (which reads only the first <p>).
|
|
13
|
+
*/
|
|
14
|
+
import { Node } from "@tiptap/core";
|
|
15
|
+
export declare const SingleParagraphDoc: Node<any, any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Node as e } from "@tiptap/core";
|
|
2
|
+
//#region src/components/editor/extensions/single-paragraph-doc.ts
|
|
3
|
+
var t = e.create({
|
|
4
|
+
name: "doc",
|
|
5
|
+
topNode: !0,
|
|
6
|
+
content: "paragraph"
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as SingleParagraphDoc };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=single-paragraph-doc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-paragraph-doc.js","names":[],"sources":["../../../../src/components/editor/extensions/single-paragraph-doc.ts"],"mappings":";;AAeA,IAAa,IAAqB,EAAK,OAAO;CAC5C,MAAM;CACN,SAAS;CACT,SAAS;AACX,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrailingNewline Extension
|
|
3
|
+
*
|
|
4
|
+
* Ensures that a hardBreak at the end of a paragraph always has a ZWS
|
|
5
|
+
* text node after it. Browsers collapse a bare trailing <br> inside a
|
|
6
|
+
* block element, making the new empty line invisible. By appending a
|
|
7
|
+
* zero-width space we give the line height and a cursor position.
|
|
8
|
+
*
|
|
9
|
+
* Runs as an appendTransaction plugin so it fires after any command
|
|
10
|
+
* (setHardBreak, paste, undo, etc.) that might leave a trailing <br>.
|
|
11
|
+
*/
|
|
12
|
+
import { Extension } from "@tiptap/core";
|
|
13
|
+
export declare const TrailingNewline: Extension<any, any>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "../constants.js";
|
|
2
|
+
import { Plugin as e, PluginKey as t } from "@tiptap/pm/state";
|
|
3
|
+
import { Extension as n } from "@tiptap/core";
|
|
4
|
+
//#region src/components/editor/extensions/trailing-newline.ts
|
|
5
|
+
var r = n.create({
|
|
6
|
+
name: "trailingNewline",
|
|
7
|
+
addProseMirrorPlugins() {
|
|
8
|
+
return [new e({
|
|
9
|
+
key: new t("trailingNewline"),
|
|
10
|
+
appendTransaction(e, t, n) {
|
|
11
|
+
let { doc: r, tr: i } = n, a = !1;
|
|
12
|
+
return r.descendants((e, t) => {
|
|
13
|
+
if (e.type.name !== "paragraph") return;
|
|
14
|
+
let n = e.lastChild;
|
|
15
|
+
if (n && n.type.name === "hardBreak") {
|
|
16
|
+
let n = t + e.nodeSize - 1;
|
|
17
|
+
i.insertText("", n), a = !0;
|
|
18
|
+
}
|
|
19
|
+
}), a ? i : null;
|
|
20
|
+
}
|
|
21
|
+
})];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as TrailingNewline };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=trailing-newline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailing-newline.js","names":[],"sources":["../../../../src/components/editor/extensions/trailing-newline.ts"],"mappings":";;;;AAgBA,IAAa,IAAkB,EAAU,OAAO;CAC9C,MAAM;CAEN,wBAAwB;EACtB,OAAO,CACL,IAAI,EAAO;GACT,KAAK,IAAI,EAAU,iBAAiB;GAEpC,kBAAkB,GAAe,GAAW,GAAU;IACpD,IAAM,EAAE,QAAK,UAAO,GAEhB,IAAW;IAef,OAbA,EAAI,aAAa,GAAM,MAAQ;KAC7B,IAAI,EAAK,KAAK,SAAS,aAAa;KAEpC,IAAM,IAAY,EAAK;KAClB,SAED,EAAU,KAAK,SAAS,aAAa;MACvC,IAAM,IAAY,IAAM,EAAK,WAAW;MAExC,AADA,EAAG,WAAA,KAA0B,CAAS,GACtC,IAAW;KACb;IACF,CAAC,GAEM,IAAW,IAAK;GACzB;EACF,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VariableNode - Inline node for {{plugin.field}} variables
|
|
3
|
+
* Supports filters like |pad:3, |wrap, etc.
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from "@tiptap/core";
|
|
6
|
+
export interface VariableAttrs {
|
|
7
|
+
pluginId: string;
|
|
8
|
+
field: string;
|
|
9
|
+
filters: Array<{
|
|
10
|
+
name: string;
|
|
11
|
+
arg?: string;
|
|
12
|
+
}>;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const VariableNode: Node<any, any>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { VariableNodeView as e } from "../node-views/variable-node-view.js";
|
|
3
|
+
import { ReactNodeViewRenderer as t } from "@tiptap/react";
|
|
4
|
+
import { Node as n, mergeAttributes as r } from "@tiptap/core";
|
|
5
|
+
//#region src/components/editor/extensions/variable-node.ts
|
|
6
|
+
var i = n.create({
|
|
7
|
+
name: "variable",
|
|
8
|
+
group: "inline",
|
|
9
|
+
inline: !0,
|
|
10
|
+
atom: !0,
|
|
11
|
+
selectable: !1,
|
|
12
|
+
draggable: !0,
|
|
13
|
+
addAttributes() {
|
|
14
|
+
return {
|
|
15
|
+
pluginId: {
|
|
16
|
+
default: "",
|
|
17
|
+
parseHTML: (e) => e.getAttribute("data-plugin-id"),
|
|
18
|
+
renderHTML: (e) => ({ "data-plugin-id": e.pluginId })
|
|
19
|
+
},
|
|
20
|
+
field: {
|
|
21
|
+
default: "",
|
|
22
|
+
parseHTML: (e) => e.getAttribute("data-field"),
|
|
23
|
+
renderHTML: (e) => ({ "data-field": e.field })
|
|
24
|
+
},
|
|
25
|
+
filters: {
|
|
26
|
+
default: [],
|
|
27
|
+
parseHTML: (e) => {
|
|
28
|
+
let t = e.getAttribute("data-filters");
|
|
29
|
+
return t ? JSON.parse(t) : [];
|
|
30
|
+
},
|
|
31
|
+
renderHTML: (e) => ({ "data-filters": JSON.stringify(e.filters || []) })
|
|
32
|
+
},
|
|
33
|
+
maxLength: {
|
|
34
|
+
default: 10,
|
|
35
|
+
parseHTML: (e) => {
|
|
36
|
+
let t = e.getAttribute("data-max-length");
|
|
37
|
+
return t ? parseInt(t, 10) : 10;
|
|
38
|
+
},
|
|
39
|
+
renderHTML: (e) => ({ "data-max-length": e.maxLength?.toString() || "10" })
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
parseHTML() {
|
|
44
|
+
return [{ tag: "span[data-type=\"variable\"]" }];
|
|
45
|
+
},
|
|
46
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
47
|
+
return ["span", r({ "data-type": "variable" }, e)];
|
|
48
|
+
},
|
|
49
|
+
addNodeView() {
|
|
50
|
+
return t(e);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//#endregion
|
|
54
|
+
export { i as VariableNode };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=variable-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-node.js","names":[],"sources":["../../../../src/components/editor/extensions/variable-node.ts"],"mappings":";;;;;AAkBA,IAAa,IAAe,EAAK,OAAO;CACtC,MAAM;CAEN,OAAO;CAEP,QAAQ;CAER,MAAM;CAEN,YAAY;CAEZ,WAAW;CAEX,gBAAgB;EACd,OAAO;GACL,UAAU;IACR,SAAS;IACT,YAAY,MAAY,EAAQ,aAAa,gBAAgB;IAC7D,aAAa,OAAgB,EAC3B,kBAAkB,EAAW,SAC/B;GACF;GACA,OAAO;IACL,SAAS;IACT,YAAY,MAAY,EAAQ,aAAa,YAAY;IACzD,aAAa,OAAgB,EAC3B,cAAc,EAAW,MAC3B;GACF;GACA,SAAS;IACP,SAAS,CAAC;IACV,YAAY,MAAY;KACtB,IAAM,IAAa,EAAQ,aAAa,cAAc;KACtD,OAAO,IAAa,KAAK,MAAM,CAAU,IAAI,CAAC;IAChD;IACA,aAAa,OAAgB,EAC3B,gBAAgB,KAAK,UAAU,EAAW,WAAW,CAAC,CAAC,EACzD;GACF;GACA,WAAW;IACT,SAAS;IACT,YAAY,MAAY;KACtB,IAAM,IAAS,EAAQ,aAAa,iBAAiB;KACrD,OAAO,IAAS,SAAS,GAAQ,EAAE,IAAI;IACzC;IACA,aAAa,OAAgB,EAC3B,mBAAmB,EAAW,WAAW,SAAS,KAAK,KACzD;GACF;EACF;CACF;CAEA,YAAY;EACV,OAAO,CACL,EACE,KAAK,+BACP,CACF;CACF;CAEA,WAAW,EAAE,qBAAkB;EAC7B,OAAO,CAAC,QAAQ,EAAgB,EAAE,aAAa,WAAW,GAAG,CAAc,CAAC;CAC9E;CAEA,cAAc;EACZ,OAAO,EAAsB,CAAgB;CAC/C;AACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WrappedTextNode - Inline node for text that will be wrapped
|
|
3
|
+
* Created when user selects text and applies wrap filter
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from "@tiptap/core";
|
|
6
|
+
export interface WrappedTextAttrs {
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const WrappedTextNode: Node<any, any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { WrappedTextView as e } from "../node-views/wrapped-text-view.js";
|
|
3
|
+
import { ReactNodeViewRenderer as t } from "@tiptap/react";
|
|
4
|
+
import { Node as n, mergeAttributes as r } from "@tiptap/core";
|
|
5
|
+
//#region src/components/editor/extensions/wrapped-text-node.ts
|
|
6
|
+
var i = n.create({
|
|
7
|
+
name: "wrappedText",
|
|
8
|
+
group: "inline",
|
|
9
|
+
inline: !0,
|
|
10
|
+
atom: !1,
|
|
11
|
+
addAttributes() {
|
|
12
|
+
return { text: {
|
|
13
|
+
default: "",
|
|
14
|
+
parseHTML: (e) => e.getAttribute("data-text") || e.textContent || "",
|
|
15
|
+
renderHTML: (e) => ({ "data-text": e.text })
|
|
16
|
+
} };
|
|
17
|
+
},
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{ tag: "span[data-type=\"wrapped-text\"]" }];
|
|
20
|
+
},
|
|
21
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
22
|
+
return ["span", r({ "data-type": "wrapped-text" }, e)];
|
|
23
|
+
},
|
|
24
|
+
addNodeView() {
|
|
25
|
+
return t(e);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { i as WrappedTextNode };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=wrapped-text-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapped-text-node.js","names":[],"sources":["../../../../src/components/editor/extensions/wrapped-text-node.ts"],"mappings":";;;;;AAeA,IAAa,IAAkB,EAAK,OAAO;CACzC,MAAM;CAEN,OAAO;CAEP,QAAQ;CAER,MAAM;CAEN,gBAAgB;EACd,OAAO,EACL,MAAM;GACJ,SAAS;GACT,YAAY,MAAY,EAAQ,aAAa,WAAW,KAAK,EAAQ,eAAe;GACpF,aAAa,OAAgB,EAC3B,aAAa,EAAW,KAC1B;EACF,EACF;CACF;CAEA,YAAY;EACV,OAAO,CACL,EACE,KAAK,mCACP,CACF;CACF;CAEA,WAAW,EAAE,qBAAkB;EAC7B,OAAO,CAAC,QAAQ,EAAgB,EAAE,aAAa,eAAe,GAAG,CAAc,CAAC;CAClF;CAEA,cAAc;EACZ,OAAO,EAAsB,CAAe;CAC9C;AACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export interface FilterPickerLabels {
|
|
3
|
+
noFiltersAvailable: string;
|
|
4
|
+
selectVariableFirst: string;
|
|
5
|
+
filterDescWrap: string;
|
|
6
|
+
filterDescPad: string;
|
|
7
|
+
filterDescTruncate: string;
|
|
8
|
+
wrapInstruction: string;
|
|
9
|
+
/** The template snippet is syntax — it stays verbatim in every locale. */
|
|
10
|
+
exampleLabel: (example: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_FILTER_PICKER_LABELS: FilterPickerLabels;
|
|
13
|
+
export interface FilterPickerContentProps {
|
|
14
|
+
/** Filter names as declared by the template engine, e.g. `["wrap", "pad:3"]`. */
|
|
15
|
+
filters: string[];
|
|
16
|
+
/**
|
|
17
|
+
* The live TipTap editor, so a picked filter can be applied to the variable
|
|
18
|
+
* under the caret. `null` degrades to plain text insertion via `onInsert`.
|
|
19
|
+
*/
|
|
20
|
+
editor: Editor | null;
|
|
21
|
+
onInsert?: (filter: string) => void;
|
|
22
|
+
labels?: Partial<FilterPickerLabels>;
|
|
23
|
+
}
|
|
24
|
+
export declare function FilterPickerContent({ filters, editor, onInsert, labels }: FilterPickerContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Badge as t } from "../feedback/badge.js";
|
|
4
|
+
import { Box as n } from "../layout/box.js";
|
|
5
|
+
import { Flex as r } from "../layout/flex.js";
|
|
6
|
+
import { Code as i } from "../typography/code.js";
|
|
7
|
+
import { Text as a } from "../typography/text.js";
|
|
8
|
+
import { Stack as o } from "../layout/stack.js";
|
|
9
|
+
import { AlertCircle as s } from "lucide-react";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/editor/filter-picker-content.tsx
|
|
12
|
+
var u = {
|
|
13
|
+
noFiltersAvailable: "No filters available",
|
|
14
|
+
selectVariableFirst: "Select a variable first to apply a filter, or click to insert filter text.",
|
|
15
|
+
filterDescWrap: "Wraps long text across multiple lines",
|
|
16
|
+
filterDescPad: "Pads text to specified width",
|
|
17
|
+
filterDescTruncate: "Truncates text to specified length",
|
|
18
|
+
wrapInstruction: "Wraps long text. Leave empty lines below for text to flow into.",
|
|
19
|
+
exampleLabel: (e) => `Example: ${e}`
|
|
20
|
+
};
|
|
21
|
+
function d(e) {
|
|
22
|
+
let { state: t } = e, { selection: n } = t, { $from: r } = n;
|
|
23
|
+
for (let e = r.depth; e > 0; e--) {
|
|
24
|
+
let t = r.node(e);
|
|
25
|
+
if (t.type.name === "variable") return {
|
|
26
|
+
node: t,
|
|
27
|
+
pos: r.before(e)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
let i = null;
|
|
31
|
+
return t.doc.nodesBetween(n.from, n.to, (e, t) => {
|
|
32
|
+
if (i) return !1;
|
|
33
|
+
if (e.type.name === "variable") return i = {
|
|
34
|
+
node: e,
|
|
35
|
+
pos: t
|
|
36
|
+
}, !1;
|
|
37
|
+
}), i;
|
|
38
|
+
}
|
|
39
|
+
function f(e, t) {
|
|
40
|
+
let { $from: n } = e.state.selection;
|
|
41
|
+
for (let e = n.depth; e > 0; e--) if (n.node(e).type.name === t) return !0;
|
|
42
|
+
return !1;
|
|
43
|
+
}
|
|
44
|
+
function p({ filters: p, editor: m, onInsert: h, labels: g }) {
|
|
45
|
+
let _ = {
|
|
46
|
+
...u,
|
|
47
|
+
...g
|
|
48
|
+
};
|
|
49
|
+
if (p.length === 0) return /* @__PURE__ */ c(a, {
|
|
50
|
+
tone: "muted",
|
|
51
|
+
className: "p-3",
|
|
52
|
+
children: _.noFiltersAvailable
|
|
53
|
+
});
|
|
54
|
+
let v = m !== null && d(m) !== null, y = (e) => {
|
|
55
|
+
if (!m) {
|
|
56
|
+
h?.(`|${e}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let { state: t } = m, { selection: n } = t, r = d(m);
|
|
60
|
+
if (r) {
|
|
61
|
+
let n = r.node.attrs.filters || [], i = e.split(":")[0];
|
|
62
|
+
if (!n.some((e) => e.name === i)) {
|
|
63
|
+
let i = e.split(":"), a = {
|
|
64
|
+
name: i[0],
|
|
65
|
+
arg: i[1] || void 0
|
|
66
|
+
}, o = [...n, a], s = t.tr;
|
|
67
|
+
s.setNodeMarkup(r.pos, void 0, {
|
|
68
|
+
...r.node.attrs,
|
|
69
|
+
filters: o
|
|
70
|
+
}), m.view.dispatch(s), m.chain().focus().run();
|
|
71
|
+
}
|
|
72
|
+
} else if (e === "wrap" && n.from !== n.to) {
|
|
73
|
+
let r = t.doc.textBetween(n.from, n.to);
|
|
74
|
+
r.trim().length > 0 ? f(m, "wrappedText") || m.chain().focus().deleteSelection().insertContent({
|
|
75
|
+
type: "wrappedText",
|
|
76
|
+
attrs: { text: r }
|
|
77
|
+
}).run() : h?.(`|${e}`);
|
|
78
|
+
} else h?.(`|${e}`);
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ l(n, {
|
|
81
|
+
className: "p-2 min-w-[250px]",
|
|
82
|
+
children: [
|
|
83
|
+
!v && m && /* @__PURE__ */ l(r, {
|
|
84
|
+
align: "start",
|
|
85
|
+
gap: "2",
|
|
86
|
+
className: "mb-2 p-2 bg-muted/50 rounded-md text-xs text-muted-foreground",
|
|
87
|
+
children: [/* @__PURE__ */ c(s, { className: "w-3.5 h-3.5 mt-0.5 flex-shrink-0" }), /* @__PURE__ */ c(a, {
|
|
88
|
+
as: "span",
|
|
89
|
+
size: "xs",
|
|
90
|
+
tone: "muted",
|
|
91
|
+
children: _.selectVariableFirst
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ c(o, {
|
|
95
|
+
gap: "2",
|
|
96
|
+
children: p.map((n) => {
|
|
97
|
+
let r = n.split(":")[0];
|
|
98
|
+
return /* @__PURE__ */ l("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
onClick: () => y(n),
|
|
101
|
+
className: e("w-full text-left px-3 py-2 rounded-md text-sm", "hover:bg-accent hover:text-accent-foreground transition-colors", "flex items-center gap-2"),
|
|
102
|
+
children: [/* @__PURE__ */ l(t, {
|
|
103
|
+
variant: "secondary",
|
|
104
|
+
className: "font-mono text-xs",
|
|
105
|
+
children: ["|", n]
|
|
106
|
+
}), /* @__PURE__ */ l(a, {
|
|
107
|
+
as: "span",
|
|
108
|
+
size: "xs",
|
|
109
|
+
tone: "muted",
|
|
110
|
+
children: [
|
|
111
|
+
r === "wrap" && _.filterDescWrap,
|
|
112
|
+
r === "pad" && _.filterDescPad,
|
|
113
|
+
r === "truncate" && _.filterDescTruncate
|
|
114
|
+
]
|
|
115
|
+
})]
|
|
116
|
+
}, n);
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ l(o, {
|
|
120
|
+
gap: "1",
|
|
121
|
+
className: "mt-3 pt-3 border-t text-xs text-muted-foreground",
|
|
122
|
+
children: [/* @__PURE__ */ c(a, {
|
|
123
|
+
size: "xs",
|
|
124
|
+
tone: "muted",
|
|
125
|
+
children: _.exampleLabel("{{weather.temperature|pad:3}}")
|
|
126
|
+
}), /* @__PURE__ */ l(a, {
|
|
127
|
+
tone: "muted",
|
|
128
|
+
className: "text-[10px]",
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ c(i, {
|
|
131
|
+
className: "bg-transparent px-0 py-0 text-[10px] font-semibold text-muted-foreground",
|
|
132
|
+
children: "|wrap"
|
|
133
|
+
}),
|
|
134
|
+
":",
|
|
135
|
+
" ",
|
|
136
|
+
_.wrapInstruction
|
|
137
|
+
]
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { u as DEFAULT_FILTER_PICKER_LABELS, p as FilterPickerContent };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=filter-picker-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-picker-content.js","names":[],"sources":["../../../src/components/editor/filter-picker-content.tsx"],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type BoardColorName } from "../../lib/board-colors";
|
|
3
|
+
export interface FormattingPickerLabels {
|
|
4
|
+
noFormattingAvailable: string;
|
|
5
|
+
back: string;
|
|
6
|
+
selectColor: string;
|
|
7
|
+
orCustomPattern: string;
|
|
8
|
+
use: string;
|
|
9
|
+
/** Placeholder for the custom repeat-pattern field. Punctuation, but still on screen. */
|
|
10
|
+
customPatternPlaceholder: string;
|
|
11
|
+
/** Display name per board color, shown on and announced for each swatch. */
|
|
12
|
+
colorNames: Record<BoardColorName, string>;
|
|
13
|
+
/** Accessible name for one swatch, given its display name. */
|
|
14
|
+
colorOptionLabel: (colorName: string) => string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_FORMATTING_PICKER_LABELS: FormattingPickerLabels;
|
|
17
|
+
export interface FormattingPickerContentProps {
|
|
18
|
+
/**
|
|
19
|
+
* Formatting options keyed by name, as declared by the template engine.
|
|
20
|
+
* Optional because the app's call site passes a possibly-absent
|
|
21
|
+
* `templateVars?.formatting`; an empty map renders the "none available" copy.
|
|
22
|
+
*/
|
|
23
|
+
formatting?: Record<string, {
|
|
24
|
+
syntax: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
onInsert: (syntax: string) => void;
|
|
28
|
+
labels?: Partial<FormattingPickerLabels>;
|
|
29
|
+
}
|
|
30
|
+
export declare function FormattingPickerContent({ formatting, onInsert, labels }: FormattingPickerContentProps): React.JSX.Element;
|