@fiestaboard/ui 5.4.2 → 5.4.4
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/chrome/page-header.d.ts +19 -0
- package/dist/components/chrome/page-header.js +1 -1
- package/dist/components/chrome/page-header.js.map +1 -1
- package/dist/components/chrome/page-layout.js.map +1 -1
- package/dist/components/chrome/page-toolbar.d.ts +28 -1
- package/dist/components/chrome/page-toolbar.js +13 -10
- package/dist/components/chrome/page-toolbar.js.map +1 -1
- package/dist/components/editor/utils/draw-mode.js +28 -28
- package/dist/components/editor/utils/draw-mode.js.map +1 -1
- package/dist/components/editor/utils/serialization.js +12 -12
- package/dist/components/editor/utils/serialization.js.map +1 -1
- package/package.json +1 -1
|
@@ -67,6 +67,25 @@ interface PageHeaderProps {
|
|
|
67
67
|
* `children` is an ACTION SLOT and now renders beside the title rather than
|
|
68
68
|
* below the description, so a route can put its primary action on the header
|
|
69
69
|
* row without hand-writing a float.
|
|
70
|
+
*
|
|
71
|
+
* INSET TO THE CARD'S CONTENT, NOT ITS CHROME. The header sits directly in
|
|
72
|
+
* `PageLayout`'s container, so with no padding of its own its type began on
|
|
73
|
+
* the same vertical as the *border* of every card below it — while the text
|
|
74
|
+
* inside those cards began 24px further in. A settings route therefore showed
|
|
75
|
+
* two left edges a reader could see, and the H1 lined up with the one that is
|
|
76
|
+
* a hairline rather than the one that is words. `px-6` matches `Card`'s own
|
|
77
|
+
* content padding, which is a constant 24 at every breakpoint (the container's
|
|
78
|
+
* gutter steps 16 -> 24 at md; the card's does not), so the page title, each
|
|
79
|
+
* card's title and each card's body share one column at every width.
|
|
80
|
+
*
|
|
81
|
+
* BOTH SIDES, which depends on `PageToolbar` taking the same inset. This was
|
|
82
|
+
* briefly `pl-6`: while the toolbar had no padding, its search field ran to
|
|
83
|
+
* the gutter, and padding the header's right pulled the action slot 24px
|
|
84
|
+
* inboard of the field directly beneath it. The toolbar now takes `px-6` too,
|
|
85
|
+
* so the action lines up with the controls under it. The symmetry is a
|
|
86
|
+
* consequence of that pairing, not a preference — if a route ever puts a
|
|
87
|
+
* full-bleed control under the header again, these two are the pair to
|
|
88
|
+
* revisit together.
|
|
70
89
|
*/
|
|
71
90
|
export declare const PageHeader: import("react").MemoExoticComponent<({ icon: Icon, title, description, children, className, animationDelay, hue, }: PageHeaderProps) => import("react").JSX.Element>;
|
|
72
91
|
/**
|
|
@@ -25,7 +25,7 @@ function s(e) {
|
|
|
25
25
|
var c = t(function({ icon: t, title: i, description: a, children: c, className: l, animationDelay: u = "0ms", hue: d }) {
|
|
26
26
|
let f = d ?? s(i);
|
|
27
27
|
return /* @__PURE__ */ r("div", {
|
|
28
|
-
className: e("mb-6 flex flex-wrap items-start justify-between gap-x-6 gap-y-3 animate-card-fade-in", l),
|
|
28
|
+
className: e("mb-6 flex flex-wrap items-start justify-between gap-x-6 gap-y-3 px-6 animate-card-fade-in", l),
|
|
29
29
|
style: { animationDelay: u },
|
|
30
30
|
children: [/* @__PURE__ */ r("div", {
|
|
31
31
|
className: "min-w-0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/chrome/page-header.tsx"],"mappings":";;;;AAMA,IAAM,IAAsC,EAAE,UAAU,WAAW,GAStD,IAAY;CAAC;CAAO;CAAU;CAAU;CAAS;CAAQ;AAAQ,GAIxE,IAAqC;CACzC,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,MAAM;CACN,QAAQ;AACV;AAqBA,SAAgB,EAAQ,GAAuB;CAC7C,IAAI,IAAI;CACR,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAE/B,AADA,KAAK,EAAK,WAAW,CAAC,GACtB,IAAI,KAAK,KAAK,GAAG,QAAU;CAE7B,OAAO,EAAU,KAAK,IAAI,CAAC,IAAI,EAAU;AAC3C;
|
|
1
|
+
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/chrome/page-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kBAAC,QAAD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAM,WAAU;IAAkB,CAAA;IAC/C,kBAAC,QAAD;KAAM,QAAO;KAAO,WAAU;IAAkB,CAAA;GAClC;EACZ,CAAA,EAAA,CAAA;CACH,CAAA;AAET,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-layout.js","names":[],"sources":["../../../src/components/chrome/page-layout.tsx"],"mappings":";;;;AAaA,IAAa,IAAa,EAAK,SAAoB,EACjD,aACA,cACA,mBACA,iBACkB;CAClB,OACE,kBAAC,OAAD;EACE,WAAW,EACT,mCAKA,IACI,wFACA,cACJ,CACF;EAEA,UAAA,kBAAC,OAAD;GACE,WAAW,
|
|
1
|
+
{"version":3,"file":"page-layout.js","names":[],"sources":["../../../src/components/chrome/page-layout.tsx"],"mappings":";;;;AAaA,IAAa,IAAa,EAAK,SAAoB,EACjD,aACA,cACA,mBACA,iBACkB;CAClB,OACE,kBAAC,OAAD;EACE,WAAW,EACT,mCAKA,IACI,wFACA,cACJ,CACF;EAEA,UAAA,kBAAC,OAAD;GACE,WAAW,EAkBT,0EAIA,KAAc,4EACd,CACF;GAEC;EACE,CAAA;CACF,CAAA;AAET,CAAC"}
|
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
interface PageToolbarProps {
|
|
2
2
|
left?: React.ReactNode;
|
|
3
3
|
right?: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Escape hatch for a toolbar whose row is not a left/right split — a grid
|
|
6
|
+
* that lets a search field take the remaining track, say. Supplying it
|
|
7
|
+
* replaces the slot layout entirely; the inset stays.
|
|
8
|
+
*/
|
|
9
|
+
children?: React.ReactNode;
|
|
4
10
|
className?: string;
|
|
5
11
|
}
|
|
6
|
-
|
|
12
|
+
/**
|
|
13
|
+
* INSET, NOT A SURFACE. The toolbar takes the same `px-6` as `PageHeader`, so
|
|
14
|
+
* its controls land on the card content column with the page title above them
|
|
15
|
+
* and every card's words below.
|
|
16
|
+
*
|
|
17
|
+
* Before this it had no padding at all, which put its controls on
|
|
18
|
+
* `PageLayout`'s gutter — the same vertical as every card's BORDER, 24px
|
|
19
|
+
* outboard of the words inside those cards. That was invisible while the
|
|
20
|
+
* header sat on the gutter too; once the header moved onto the content
|
|
21
|
+
* column, the toolbar was the last thing on a route still using the old edge,
|
|
22
|
+
* and a search field starting further left than both the title above it and
|
|
23
|
+
* the table below it read as broken rather than as full-bleed.
|
|
24
|
+
*
|
|
25
|
+
* NOT A CARD, though card chrome was tried here first and does solve the same
|
|
26
|
+
* problem — the border lands on the gutter, the padding puts the contents on
|
|
27
|
+
* the content column. It was rejected for weight: it adds a third surface to
|
|
28
|
+
* the top of every route that has a toolbar, and on a route whose toolbar is
|
|
29
|
+
* a single action it renders as a wide empty bar. Bare type and bare controls
|
|
30
|
+
* on a shared column is the lighter way to get the same alignment, and it
|
|
31
|
+
* keeps the page background as the thing the header sits on.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PageToolbar: import("react").MemoExoticComponent<({ left, right, children, className }: PageToolbarProps) => import("react").JSX.Element>;
|
|
7
34
|
export {};
|
|
@@ -2,17 +2,20 @@ import { cn as e } from "../../lib/utils.js";
|
|
|
2
2
|
import { memo as t } from "react";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/chrome/page-toolbar.tsx
|
|
5
|
-
var i = { animationDelay: "50ms" }, a = t(function({ left: t, right: a,
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
className: e("mb-4
|
|
5
|
+
var i = { animationDelay: "50ms" }, a = t(function({ left: t, right: a, children: o, className: s }) {
|
|
6
|
+
return /* @__PURE__ */ n("div", {
|
|
7
|
+
className: e("mb-4 px-6 animate-card-fade-in", s),
|
|
8
8
|
style: i,
|
|
9
|
-
children:
|
|
10
|
-
className: "flex items-center gap-3",
|
|
11
|
-
children: t
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
children: o ?? /* @__PURE__ */ r("div", {
|
|
10
|
+
className: e("flex flex-wrap items-center gap-3", t && a ? "justify-between" : a ? "justify-end" : "justify-start"),
|
|
11
|
+
children: [t && /* @__PURE__ */ n("div", {
|
|
12
|
+
className: "flex items-center gap-3",
|
|
13
|
+
children: t
|
|
14
|
+
}), a && /* @__PURE__ */ n("div", {
|
|
15
|
+
className: "flex items-center gap-3",
|
|
16
|
+
children: a
|
|
17
|
+
})]
|
|
18
|
+
})
|
|
16
19
|
});
|
|
17
20
|
});
|
|
18
21
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-toolbar.js","names":[],"sources":["../../../src/components/chrome/page-toolbar.tsx"],"mappings":";;;;AAKA,IAAM,IAAqC,EAAE,gBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"page-toolbar.js","names":[],"sources":["../../../src/components/chrome/page-toolbar.tsx"],"mappings":";;;;AAKA,IAAM,IAAqC,EAAE,gBAAgB,OAAO,GAmCvD,IAAc,EAAK,SAAqB,EAAE,SAAM,UAAO,aAAU,gBAA+B;CAC3G,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,kCAAkC,CAAS;EAAG,OAAO;EACrE,UAAA,KACC,kBAAC,OAAD;GACE,WAAW,EACT,qCACA,KAAQ,IAAQ,oBAAoB,IAAQ,gBAAgB,eAC9D;GAJF,UAAA,CAMG,KAAQ,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAA;GAAU,CAAA,GAC5D,KAAS,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAA;GAAW,CAAA,CAC5D;;CAEJ,CAAA;AAET,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { BOARD_CHARS as e } from "../../../lib/board-characters.js";
|
|
2
2
|
import { BOARD_CODE_TO_COLOR as t, BOARD_COLOR_CODES as n } from "../constants.js";
|
|
3
3
|
//#region src/components/editor/utils/draw-mode.ts
|
|
4
|
-
var r = e.slice(1, 63).filter((e) => e !== " "), i = /^\{\{([a-z]+)\}\}
|
|
5
|
-
function
|
|
4
|
+
var r = e.slice(1, 63).filter((e) => e !== " "), i = /^\{\{([a-z]+)\}\}$/, a = /^\{\{([^}]+)\}\}/, o = /^\{([a-z0-9]+)\}/i;
|
|
5
|
+
function s(e) {
|
|
6
6
|
return e === "purple" ? "violet" : e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return `{{${
|
|
8
|
+
function c(e) {
|
|
9
|
+
return `{{${s(e)}}}`;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function l(e) {
|
|
12
12
|
switch (e.kind) {
|
|
13
|
-
case "color": return
|
|
13
|
+
case "color": return c(e.color);
|
|
14
14
|
case "eraser": return " ";
|
|
15
15
|
case "char": {
|
|
16
16
|
let t = e.char.toUpperCase();
|
|
@@ -18,62 +18,62 @@ function s(e) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let r = [], i = !1,
|
|
23
|
-
for (;
|
|
24
|
-
let e =
|
|
21
|
+
function u(e) {
|
|
22
|
+
let r = [], i = !1, s = e;
|
|
23
|
+
for (; s.length > 0;) {
|
|
24
|
+
let e = s.match(a);
|
|
25
25
|
if (e) {
|
|
26
26
|
let t = e[1].trim().toLowerCase();
|
|
27
|
-
Object.hasOwn(n, t) ? r.push(
|
|
27
|
+
Object.hasOwn(n, t) ? r.push(c(t)) : i = !0, s = s.slice(e[0].length);
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
let e =
|
|
30
|
+
let l = s.match(o);
|
|
31
|
+
if (l) {
|
|
32
|
+
let e = l[1].toLowerCase(), i = Number(e);
|
|
33
33
|
if (Object.hasOwn(n, e)) {
|
|
34
|
-
r.push(
|
|
34
|
+
r.push(c(e)), s = s.slice(l[0].length);
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
37
|
if (Number.isInteger(i) && i >= 63 && i <= 71) {
|
|
38
|
-
r.push(
|
|
38
|
+
r.push(c(t[i])), s = s.slice(l[0].length);
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
r.push(
|
|
42
|
+
r.push(s[0]), s = s.slice(1);
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
cells: r,
|
|
46
46
|
droppedDynamic: i
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
49
|
+
function d(e) {
|
|
50
|
+
return u(e).cells;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function f(e) {
|
|
53
53
|
let t = e.length;
|
|
54
54
|
for (; t > 0 && e[t - 1] === " ";) t--;
|
|
55
55
|
return e.slice(0, t).join("");
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return !
|
|
57
|
+
function p(e) {
|
|
58
|
+
return !u(e).droppedDynamic;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
let r =
|
|
60
|
+
function m(e, t, n) {
|
|
61
|
+
let r = d(e);
|
|
62
62
|
r.length > n && (r.length = n);
|
|
63
63
|
let i = t.filter((e) => e.col >= 0 && e.col < n);
|
|
64
64
|
for (let e of i) {
|
|
65
65
|
for (; r.length <= e.col;) r.push(" ");
|
|
66
66
|
r[e.col] = e.cell;
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return f(r);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function h(e) {
|
|
71
|
+
return d(e).map((e) => {
|
|
72
72
|
let t = e.match(i);
|
|
73
73
|
return t ? `{${t[1]}}` : e;
|
|
74
74
|
}).join("");
|
|
75
75
|
}
|
|
76
76
|
//#endregion
|
|
77
|
-
export { r as DRAW_CHARS,
|
|
77
|
+
export { r as DRAW_CHARS, l as brushToCell, f as cellsToLine, p as isPositionalLine, d as lineToCells, m as paintLine, h as renderPositionalLine };
|
|
78
78
|
|
|
79
79
|
//# sourceMappingURL=draw-mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-mode.js","names":[],"sources":["../../../../src/components/editor/utils/draw-mode.ts"],"mappings":";;;AA0CA,IAAa,IAAuB,EAAY,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ,MAAS,MAAS,GAAG,GAEpF,IAAgB;
|
|
1
|
+
{"version":3,"file":"draw-mode.js","names":[],"sources":["../../../../src/components/editor/utils/draw-mode.ts"],"mappings":";;;AA0CA,IAAa,IAAuB,EAAY,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ,MAAS,MAAS,GAAG,GAEpF,IAAgB,sBAIhB,IAAkB,oBAClB,IAAkB;AAGxB,SAAS,EAAe,GAAwC;CAC9D,OAAO,MAAU,WAAW,WAAW;AACzC;AAEA,SAAS,EAAU,GAA8B;CAC/C,OAAO,KAAK,EAAe,CAAK,EAAE;AACpC;AAGA,SAAgB,EAAY,GAAwB;CAClD,QAAQ,EAAM,MAAd;EACE,KAAK,SACH,OAAO,EAAU,EAAM,KAAK;EAC9B,KAAK,UACH,OAAO;EACT,KAAK,QAAQ;GACX,IAAM,IAAO,EAAM,KAAK,YAAY;GAGpC,OAFI,EAAK,WAAW,KAAK,EAAW,SAAS,CAAI,IAAU,KAC3D,QAAQ,KAAK,uCAAuC,KAAK,UAAU,EAAM,IAAI,EAAE,oBAAoB,GAC5F;EACT;CACF;AACF;AAMA,SAAS,EAAa,GAA0D;CAC9E,IAAM,IAAgB,CAAC,GACnB,IAAiB,IACjB,IAAY;CAEhB,OAAO,EAAU,SAAS,IAAG;EAC3B,IAAM,IAAM,EAAU,MAAM,CAAe;EAC3C,IAAI,GAAK;GACP,IAAM,IAAU,EAAI,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MAAM,CAAI;CACnE,KAAK,IAAM,KAAS,GAAa;EAC/B,OAAO,EAAM,UAAU,EAAM,MAAK,EAAM,KAAK,GAAG;EAChD,EAAM,EAAM,OAAO,EAAM;CAC3B;CACA,OAAO,EAAY,CAAK;AAC1B;AAMA,SAAgB,EAAqB,GAAsB;CACzD,OAAO,EAAY,CAAI,CAAC,CACrB,KAAK,MAAS;EACb,IAAM,IAAI,EAAK,MAAM,CAAa;EAClC,OAAO,IAAI,IAAI,EAAE,GAAG,KAAK;CAC3B,CAAC,CAAC,CACD,KAAK,EAAE;AACZ"}
|
|
@@ -8,7 +8,7 @@ function a(e, n = t) {
|
|
|
8
8
|
type: "text",
|
|
9
9
|
text: i
|
|
10
10
|
}), e) {
|
|
11
|
-
let t =
|
|
11
|
+
let t = p(e);
|
|
12
12
|
a.push(...t);
|
|
13
13
|
}
|
|
14
14
|
a.push({
|
|
@@ -66,11 +66,11 @@ var l = /* @__PURE__ */ new Set([
|
|
|
66
66
|
"colorTile",
|
|
67
67
|
"fillSpace",
|
|
68
68
|
"formula"
|
|
69
|
-
]);
|
|
70
|
-
function
|
|
69
|
+
]), u = /^\{\{([^}]+)\}\}/, d = /^\{([a-z]+)\}/i, f = /\{\{|\{[a-z]+\}/i;
|
|
70
|
+
function p(t) {
|
|
71
71
|
let n = [], r = t;
|
|
72
72
|
for (; r.length > 0;) {
|
|
73
|
-
let t = r.match(
|
|
73
|
+
let t = r.match(u);
|
|
74
74
|
if (t) {
|
|
75
75
|
let i = t[1], a = t[0], o = i.toLowerCase();
|
|
76
76
|
if (Object.hasOwn(e, o)) n.push({
|
|
@@ -82,7 +82,7 @@ function u(t) {
|
|
|
82
82
|
});
|
|
83
83
|
else if (i.toLowerCase() === "fill_space") n.push({
|
|
84
84
|
type: "fillSpace",
|
|
85
|
-
attrs: { id:
|
|
85
|
+
attrs: { id: m() }
|
|
86
86
|
});
|
|
87
87
|
else if (i.toLowerCase().startsWith("fill_space_repeat")) {
|
|
88
88
|
let e = " ";
|
|
@@ -93,7 +93,7 @@ function u(t) {
|
|
|
93
93
|
n.push({
|
|
94
94
|
type: "fillSpace",
|
|
95
95
|
attrs: {
|
|
96
|
-
id:
|
|
96
|
+
id: m(),
|
|
97
97
|
repeatChar: e
|
|
98
98
|
}
|
|
99
99
|
});
|
|
@@ -104,7 +104,7 @@ function u(t) {
|
|
|
104
104
|
attrs: { expression: e }
|
|
105
105
|
});
|
|
106
106
|
} else {
|
|
107
|
-
let { varPath: e, filters: t } =
|
|
107
|
+
let { varPath: e, filters: t } = h(i), r = e.indexOf("."), a = r === -1 ? e : e.slice(0, r), o = r === -1 ? "" : e.slice(r + 1);
|
|
108
108
|
n.push({
|
|
109
109
|
type: "variable",
|
|
110
110
|
attrs: {
|
|
@@ -117,7 +117,7 @@ function u(t) {
|
|
|
117
117
|
r = r.slice(a.length);
|
|
118
118
|
continue;
|
|
119
119
|
}
|
|
120
|
-
let i = r.match(
|
|
120
|
+
let i = r.match(d);
|
|
121
121
|
if (i) {
|
|
122
122
|
let t = i[1].toLowerCase();
|
|
123
123
|
if (Object.hasOwn(e, t)) {
|
|
@@ -136,7 +136,7 @@ function u(t) {
|
|
|
136
136
|
}), r = r.slice(i[0].length);
|
|
137
137
|
continue;
|
|
138
138
|
}
|
|
139
|
-
let a = r.search(
|
|
139
|
+
let a = r.search(f);
|
|
140
140
|
if (a === -1) {
|
|
141
141
|
r && n.push({
|
|
142
142
|
type: "text",
|
|
@@ -162,10 +162,10 @@ function u(t) {
|
|
|
162
162
|
})) : a.push(e);
|
|
163
163
|
return a;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function m() {
|
|
166
166
|
return Math.random().toString(36).slice(2, 11);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function h(e) {
|
|
169
169
|
let t = e.split("|");
|
|
170
170
|
return {
|
|
171
171
|
varPath: t[0].trim(),
|
|
@@ -179,6 +179,6 @@ function f(e) {
|
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
|
-
export {
|
|
182
|
+
export { p as parseLineContent, a as parseTemplateSimple, o as serializeTemplateSimple };
|
|
183
183
|
|
|
184
184
|
//# sourceMappingURL=serialization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","names":[],"sources":["../../../../src/components/editor/utils/serialization.ts"],"mappings":";;AAuBA,IAAM,IAAA;AAON,SAAgB,EAAoB,GAAkB,IAAW,GAAkC;CACjG,IAAM,IAAQ,EAAS,MAAM,IAAI,GAG3B,IAAyB,CAAC;CAEhC,EAAM,SAAS,GAAM,MAAU;EAK7B,IAHA,EAAQ,KAAK;GAAE,MAAM;GAAQ,MAAM;EAAmB,CAAC,GAGnD,GAAM;GACR,IAAM,IAAY,EAAiB,CAAI;GACvC,EAAQ,KAAK,GAAG,CAAS;EAC3B;EAMA,AAHA,EAAQ,KAAK;GAAE,MAAM;GAAQ,MAAM;EAAmB,CAAC,GAGnD,IAAQ,EAAM,SAAS,KACzB,EAAQ,KAAK,EAAE,MAAM,YAAY,CAAC;CAEtC,CAAC;CAGD,IAAM,IAAe,EAAM;CAC3B,KAAK,IAAI,IAAI,GAAc,IAAI,GAAU,KAQvC,AAPI,EAAQ,SAAS,KAAK,EAAQ,EAAQ,SAAS,EAAE,CAAC,SAAS,eAC7D,EAAQ,KAAK,EAAE,MAAM,YAAY,CAAC,GAIpC,EAAQ,KAAK;EAAE,MAAM;EAAQ,MAAM;CAAmB,CAAC,GACvD,EAAQ,KAAK;EAAE,MAAM;EAAQ,MAAM;CAAmB,CAAC,GACnD,IAAI,IAAW,KACjB,EAAQ,KAAK,EAAE,MAAM,YAAY,CAAC;CAItC,OAAO;EACL,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,SAAS,EAAQ,SAAS,IAAI,IAAU,KAAA;EAC1C,CACF;CACF;AACF;AAMA,SAAgB,EAAwB,GAAkB,IAAW,GAA6B;CAChG,IAAM,IAAc,MAAM,KAAK,EAAE,QAAQ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