@damiro/stylo 0.15.2 → 0.16.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/{InPlaceView-DVX9qV68.js → InPlaceView-CC5hZCcI.js} +787 -750
- package/dist/InPlaceView-CC5hZCcI.js.map +1 -0
- package/dist/Preview-5lm2uUVj.js +319 -0
- package/dist/Preview-5lm2uUVj.js.map +1 -0
- package/dist/Stylo.d.ts.map +1 -1
- package/dist/editor/useCodeMirror.d.ts.map +1 -1
- package/dist/embed-DKKeCE1Y.js +109 -0
- package/dist/embed-DKKeCE1Y.js.map +1 -0
- package/dist/{highlight-BLdNzTxQ.js → embed-cache-CcBfVrc9.js} +47 -4
- package/dist/embed-cache-CcBfVrc9.js.map +1 -0
- package/dist/inplace/context-menu-helpers.d.ts +3 -4
- package/dist/inplace/context-menu-helpers.d.ts.map +1 -1
- package/dist/inplace/decorate.d.ts.map +1 -1
- package/dist/inplace/edit-line-prefix.d.ts.map +1 -1
- package/dist/inplace/embed.d.ts.map +1 -1
- package/dist/inplace/extension.d.ts.map +1 -1
- package/dist/inplace/inline-md.d.ts.map +1 -1
- package/dist/inplace/link-row.d.ts +14 -13
- package/dist/inplace/link-row.d.ts.map +1 -1
- package/dist/inplace/list-guides.d.ts.map +1 -1
- package/dist/inplace/math.d.ts +18 -3
- package/dist/inplace/math.d.ts.map +1 -1
- package/dist/inplace/table-widget-keys.d.ts +46 -0
- package/dist/inplace/table-widget-keys.d.ts.map +1 -0
- package/dist/inplace/table-widget.d.ts +1 -2
- package/dist/inplace/table-widget.d.ts.map +1 -1
- package/dist/inplace/tables.d.ts.map +1 -1
- package/dist/inplace/wikilinks.d.ts +1 -1
- package/dist/inplace/wikilinks.d.ts.map +1 -1
- package/dist/render/Embed.d.ts.map +1 -1
- package/dist/render/Preview.d.ts.map +1 -1
- package/dist/render/embed-cache.d.ts +13 -0
- package/dist/render/embed-cache.d.ts.map +1 -1
- package/dist/render/preview-components.d.ts +22 -0
- package/dist/render/preview-components.d.ts.map +1 -0
- package/dist/render/remark-wikilink.d.ts.map +1 -1
- package/dist/render/taskCheckbox.d.ts +30 -0
- package/dist/render/taskCheckbox.d.ts.map +1 -1
- package/dist/stylo.js +208 -196
- package/dist/stylo.js.map +1 -1
- package/dist/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/toolbar/command-helpers.d.ts +27 -0
- package/dist/toolbar/command-helpers.d.ts.map +1 -1
- package/dist/toolbar/heading.d.ts +3 -0
- package/dist/toolbar/heading.d.ts.map +1 -1
- package/dist/toolbar/inline-ops.d.ts +6 -0
- package/dist/toolbar/inline-ops.d.ts.map +1 -1
- package/dist/toolbar/table.d.ts.map +1 -1
- package/dist/types/core.d.ts +200 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/inplace.d.ts +91 -0
- package/dist/types/inplace.d.ts.map +1 -0
- package/dist/types/sources.d.ts +66 -0
- package/dist/types/sources.d.ts.map +1 -0
- package/dist/types/toolbar.d.ts +72 -0
- package/dist/types/toolbar.d.ts.map +1 -0
- package/dist/types.d.ts +11 -406
- package/dist/types.d.ts.map +1 -1
- package/dist/{useCodeMirror-CXtuBlLf.js → useCodeMirror-TAWSJQiZ.js} +345 -304
- package/dist/useCodeMirror-TAWSJQiZ.js.map +1 -0
- package/package.json +1 -1
- package/dist/InPlaceView-DVX9qV68.js.map +0 -1
- package/dist/Preview-BcdSr09-.js +0 -304
- package/dist/Preview-BcdSr09-.js.map +0 -1
- package/dist/embed-Dsu6b-MV.js +0 -131
- package/dist/embed-Dsu6b-MV.js.map +0 -1
- package/dist/highlight-BLdNzTxQ.js.map +0 -1
- package/dist/inplace/table-widget-caret.d.ts +0 -11
- package/dist/inplace/table-widget-caret.d.ts.map +0 -1
- package/dist/useCodeMirror-CXtuBlLf.js.map +0 -1
package/dist/stylo.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { Suspense as
|
|
5
|
-
import { EditorView as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { jsx as
|
|
1
|
+
import { c as e, t, u as n } from "./embed-cache-CcBfVrc9.js";
|
|
2
|
+
import { g as r, k as i, l as a, n as o, t as s } from "./useCodeMirror-TAWSJQiZ.js";
|
|
3
|
+
import { n as c, r as l } from "./config-DTBxVhtH.js";
|
|
4
|
+
import { Suspense as u, forwardRef as d, lazy as f, useEffect as p, useImperativeHandle as m, useReducer as h, useRef as g, useState as _, useSyncExternalStore as v } from "react";
|
|
5
|
+
import { EditorView as y, showPanel as b } from "@codemirror/view";
|
|
6
|
+
import { createPortal as x } from "react-dom";
|
|
7
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
8
|
//#region src/editor/SourceView.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let [
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
}).current, E = p
|
|
16
|
-
E.current =
|
|
17
|
-
let [D] =
|
|
9
|
+
var w = () => () => {}, T = () => null;
|
|
10
|
+
function E({ value: e, onChange: t, readOnly: r, placeholder: a, codeLanguages: o, wikiLinkSource: c, tagSource: l, onResolveError: u, onSave: d, onViewChange: f, canvasHeader: p }) {
|
|
11
|
+
let [m, h] = _(null), y = g(f);
|
|
12
|
+
y.current = f;
|
|
13
|
+
let C = g((e) => {
|
|
14
|
+
h(e), y.current?.(e);
|
|
15
|
+
}).current, E = g(p);
|
|
16
|
+
E.current = p;
|
|
17
|
+
let [D] = _(() => p ? new i() : null), O = v(D?.subscribe ?? w, D?.getSnapshot ?? T), [k] = _(() => D ? [b.of(D.panel)] : []), A = s({
|
|
18
18
|
value: e,
|
|
19
|
-
onChange:
|
|
20
|
-
readOnly:
|
|
21
|
-
placeholder:
|
|
22
|
-
codeLanguages:
|
|
19
|
+
onChange: t,
|
|
20
|
+
readOnly: r,
|
|
21
|
+
placeholder: a,
|
|
22
|
+
codeLanguages: o,
|
|
23
23
|
wikiLinkSource: c,
|
|
24
24
|
tagSource: l,
|
|
25
25
|
onResolveError: u,
|
|
26
26
|
onSave: d,
|
|
27
|
-
onViewChange:
|
|
27
|
+
onViewChange: C,
|
|
28
28
|
extensions: k
|
|
29
29
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className:
|
|
30
|
+
return /* @__PURE__ */ S("div", {
|
|
31
|
+
className: n.source,
|
|
32
32
|
ref: A,
|
|
33
|
-
children: O && E.current &&
|
|
33
|
+
children: O && E.current && x(E.current({ view: m }), O)
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/inplace/lazyInPlace.ts
|
|
38
|
-
var
|
|
38
|
+
var D = f(async () => ({ default: (await import("./InPlaceView-CC5hZCcI.js")).InPlaceView })), O = f(async () => ({ default: (await import("./Preview-5lm2uUVj.js")).Preview }));
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/SplitView.tsx
|
|
41
|
-
function
|
|
42
|
-
let [
|
|
43
|
-
return
|
|
44
|
-
let e =
|
|
41
|
+
function k({ value: e, onChange: t, onWikiLinkClick: r, readOnly: i, placeholder: a, codeLanguages: o, wikiLinkSource: s, tagSource: c, embedSource: l, onResolveError: d, frontmatter: f, softBreaks: m, onTaskToggle: h, onSave: v, onViewChange: y, canvasHeader: b }) {
|
|
42
|
+
let [x, w] = _(null), T = g(null), D = g(!1);
|
|
43
|
+
return p(() => {
|
|
44
|
+
let e = x?.scrollDOM, t = T.current;
|
|
45
45
|
if (!e || !t) return;
|
|
46
46
|
let n = (e, t) => {
|
|
47
|
-
if (
|
|
47
|
+
if (D.current) return;
|
|
48
48
|
let n = e.scrollHeight - e.clientHeight;
|
|
49
|
-
n <= 0 || (
|
|
50
|
-
|
|
49
|
+
n <= 0 || (D.current = !0, t.scrollTop = e.scrollTop / n * (t.scrollHeight - t.clientHeight), requestAnimationFrame(() => {
|
|
50
|
+
D.current = !1;
|
|
51
51
|
}));
|
|
52
52
|
}, r = () => n(e, t), i = () => n(t, e);
|
|
53
53
|
return e.addEventListener("scroll", r, { passive: !0 }), t.addEventListener("scroll", i, { passive: !0 }), () => {
|
|
54
54
|
e.removeEventListener("scroll", r), t.removeEventListener("scroll", i);
|
|
55
55
|
};
|
|
56
|
-
}, [
|
|
57
|
-
className:
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
className:
|
|
60
|
-
children: /* @__PURE__ */
|
|
56
|
+
}, [x]), /* @__PURE__ */ C("div", {
|
|
57
|
+
className: n.split,
|
|
58
|
+
children: [/* @__PURE__ */ S("div", {
|
|
59
|
+
className: n.splitPane,
|
|
60
|
+
children: /* @__PURE__ */ S(E, {
|
|
61
61
|
value: e,
|
|
62
|
-
onChange:
|
|
62
|
+
onChange: t,
|
|
63
63
|
readOnly: i,
|
|
64
64
|
placeholder: a,
|
|
65
65
|
codeLanguages: o,
|
|
66
|
-
wikiLinkSource:
|
|
67
|
-
tagSource:
|
|
68
|
-
onResolveError:
|
|
66
|
+
wikiLinkSource: s,
|
|
67
|
+
tagSource: c,
|
|
68
|
+
onResolveError: d,
|
|
69
69
|
onSave: v,
|
|
70
70
|
onViewChange: (e) => {
|
|
71
|
-
|
|
71
|
+
w(e), y?.(e);
|
|
72
72
|
},
|
|
73
|
-
canvasHeader:
|
|
73
|
+
canvasHeader: b
|
|
74
74
|
})
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
className:
|
|
77
|
-
ref:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
fallback: /* @__PURE__ */
|
|
80
|
-
className:
|
|
75
|
+
}), /* @__PURE__ */ S("div", {
|
|
76
|
+
className: n.splitPane,
|
|
77
|
+
ref: T,
|
|
78
|
+
children: /* @__PURE__ */ S(u, {
|
|
79
|
+
fallback: /* @__PURE__ */ S("div", {
|
|
80
|
+
className: n.preview,
|
|
81
81
|
"aria-busy": "true"
|
|
82
82
|
}),
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ S(O, {
|
|
84
84
|
value: e,
|
|
85
85
|
onWikiLinkClick: r,
|
|
86
|
-
embedSource:
|
|
87
|
-
onResolveError:
|
|
88
|
-
frontmatter:
|
|
86
|
+
embedSource: l,
|
|
87
|
+
onResolveError: d,
|
|
88
|
+
frontmatter: f,
|
|
89
89
|
codeLanguages: o,
|
|
90
|
-
softBreaks:
|
|
91
|
-
onTaskToggle:
|
|
90
|
+
softBreaks: m,
|
|
91
|
+
onTaskToggle: h
|
|
92
92
|
})
|
|
93
93
|
})
|
|
94
94
|
})]
|
|
@@ -96,8 +96,8 @@ function E({ value: e, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder
|
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/toolbar/floating-watchdog.ts
|
|
99
|
-
function
|
|
100
|
-
|
|
99
|
+
function A(e, t) {
|
|
100
|
+
p(() => {
|
|
101
101
|
if (!t) return;
|
|
102
102
|
let n = 0, r = !1, i = () => {
|
|
103
103
|
let t = e.current;
|
|
@@ -108,9 +108,9 @@ function D(e, t) {
|
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/toolbar/keyboard-inset.ts
|
|
111
|
-
function
|
|
112
|
-
let [t, n] =
|
|
113
|
-
return
|
|
111
|
+
function j(e) {
|
|
112
|
+
let [t, n] = _(0);
|
|
113
|
+
return p(() => {
|
|
114
114
|
let t = typeof window > "u" ? null : window.visualViewport;
|
|
115
115
|
if (!e || !t) {
|
|
116
116
|
n(0);
|
|
@@ -124,7 +124,7 @@ function O(e) {
|
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/toolbar/Toolbar.tsx
|
|
127
|
-
function
|
|
127
|
+
function M(e) {
|
|
128
128
|
let t = [], n = [];
|
|
129
129
|
for (let r of e) {
|
|
130
130
|
if (r !== "|") {
|
|
@@ -135,7 +135,7 @@ function k(e) {
|
|
|
135
135
|
}
|
|
136
136
|
return n.length && t.push(n), t;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function N(e, t) {
|
|
139
139
|
if (typeof e != "string") {
|
|
140
140
|
let { id: t, icon: n, title: r, run: i, isActive: a, disabled: o } = e;
|
|
141
141
|
return {
|
|
@@ -147,208 +147,220 @@ function A(e, t) {
|
|
|
147
147
|
disabled: o
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
let n =
|
|
150
|
+
let n = o[e];
|
|
151
151
|
return n ? {
|
|
152
152
|
key: e,
|
|
153
|
-
icon: t?.[e] ??
|
|
153
|
+
icon: t?.[e] ?? l[e],
|
|
154
154
|
title: n.title,
|
|
155
155
|
run: n.run,
|
|
156
156
|
isActive: n.isActive,
|
|
157
157
|
disabled: n.disabled
|
|
158
158
|
} : null;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
let [,
|
|
162
|
-
|
|
160
|
+
function P({ view: e, items: t, icons: i, disabled: s, sticky: c, stickyVisibility: l }) {
|
|
161
|
+
let [, u] = h((e) => e + 1, 0), [d, f] = _(!1), m = j(c === "bottom"), v = g(null);
|
|
162
|
+
A(v, c === "top"), p(() => {
|
|
163
163
|
if (!e) return;
|
|
164
164
|
let t = e.contentDOM;
|
|
165
|
-
|
|
165
|
+
f(e.hasFocus);
|
|
166
166
|
let n = () => {
|
|
167
|
-
|
|
167
|
+
f(!0), u();
|
|
168
168
|
}, r = () => {
|
|
169
|
-
|
|
169
|
+
f(!1), u();
|
|
170
170
|
}, i = [
|
|
171
171
|
"keyup",
|
|
172
172
|
"mouseup",
|
|
173
173
|
"input"
|
|
174
174
|
];
|
|
175
|
-
for (let e of i) t.addEventListener(e,
|
|
175
|
+
for (let e of i) t.addEventListener(e, u);
|
|
176
176
|
return t.addEventListener("focus", n), t.addEventListener("blur", r), () => {
|
|
177
|
-
for (let e of i) t.removeEventListener(e,
|
|
177
|
+
for (let e of i) t.removeEventListener(e, u);
|
|
178
178
|
t.removeEventListener("focus", n), t.removeEventListener("blur", r);
|
|
179
179
|
};
|
|
180
180
|
}, [e]);
|
|
181
|
-
let
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
].filter(Boolean).join(" "),
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
ref:
|
|
190
|
-
className:
|
|
181
|
+
let y = !!c && l === "dynamic" && !d, b = e ? !!r(e) : !1, x = [
|
|
182
|
+
n.toolbar,
|
|
183
|
+
c && n.toolbarSticky,
|
|
184
|
+
c === "top" && n.toolbarStickyTop,
|
|
185
|
+
c === "bottom" && n.toolbarStickyBottom,
|
|
186
|
+
y && n.toolbarStickyHidden
|
|
187
|
+
].filter(Boolean).join(" "), C = c === "bottom" ? { transform: `translateY(-${m}px)` } : void 0;
|
|
188
|
+
return /* @__PURE__ */ S("div", {
|
|
189
|
+
ref: v,
|
|
190
|
+
className: x,
|
|
191
191
|
role: "toolbar",
|
|
192
192
|
"aria-label": "Formatting",
|
|
193
|
-
"aria-hidden":
|
|
194
|
-
style:
|
|
195
|
-
children:
|
|
196
|
-
className:
|
|
193
|
+
"aria-hidden": y || void 0,
|
|
194
|
+
style: C,
|
|
195
|
+
children: M(t).map((t, r) => t === "|" ? /* @__PURE__ */ S("span", {
|
|
196
|
+
className: n.toolbarSep,
|
|
197
197
|
"aria-hidden": "true"
|
|
198
|
-
}, `sep-${
|
|
199
|
-
className:
|
|
200
|
-
children:
|
|
201
|
-
let
|
|
202
|
-
if (!
|
|
203
|
-
let
|
|
204
|
-
|
|
198
|
+
}, `sep-${r}`) : /* @__PURE__ */ S("div", {
|
|
199
|
+
className: n.toolbarGroup,
|
|
200
|
+
children: t.map((t) => {
|
|
201
|
+
let r = N(t, i);
|
|
202
|
+
if (!r) return null;
|
|
203
|
+
let c = typeof t == "string" ? o[t] : void 0, l = e ? c ? a(e.state, c, b) : {
|
|
204
|
+
disabled: !!r.disabled?.(e.state),
|
|
205
|
+
active: !!r.isActive?.(e.state)
|
|
206
|
+
} : {
|
|
207
|
+
disabled: !0,
|
|
208
|
+
active: !1
|
|
209
|
+
}, d = s || !e || l.disabled, f = !d && l.active;
|
|
210
|
+
return /* @__PURE__ */ S("button", {
|
|
205
211
|
type: "button",
|
|
206
|
-
className:
|
|
207
|
-
"data-command":
|
|
208
|
-
title:
|
|
209
|
-
"aria-label":
|
|
210
|
-
"aria-pressed":
|
|
211
|
-
"data-active":
|
|
212
|
-
disabled:
|
|
212
|
+
className: n.toolbarButton,
|
|
213
|
+
"data-command": r.key,
|
|
214
|
+
title: r.title,
|
|
215
|
+
"aria-label": r.title,
|
|
216
|
+
"aria-pressed": r.isActive ? f : void 0,
|
|
217
|
+
"data-active": f ? "" : void 0,
|
|
218
|
+
disabled: d,
|
|
213
219
|
onMouseDown: (e) => e.preventDefault(),
|
|
214
220
|
onClick: () => {
|
|
215
|
-
e && (
|
|
221
|
+
e && (r.run(e), u());
|
|
216
222
|
},
|
|
217
|
-
children:
|
|
218
|
-
},
|
|
223
|
+
children: r.icon
|
|
224
|
+
}, r.key);
|
|
219
225
|
})
|
|
220
|
-
}, `group-${
|
|
226
|
+
}, `group-${r}`))
|
|
221
227
|
});
|
|
222
228
|
}
|
|
223
229
|
//#endregion
|
|
224
230
|
//#region src/Stylo.tsx
|
|
225
|
-
var
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
let
|
|
229
|
-
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
}).current,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
231
|
+
var F = d(function({ value: r, onChange: i, mode: a = "in-place", onSave: o, onFrontmatter: s, onWikiLinkClick: l, onLinkClick: d, readOnly: f, placeholder: h, className: v, inPlace: b, codeLanguages: x, wikiLinkSource: w, tagSource: T, embedSource: A, onResolveError: j, toolbar: M, icons: N, frontmatter: F, softBreaks: I, onTaskToggle: L, canvasHeader: R }, z) {
|
|
232
|
+
let B = a === "preview" || a === "split" || a === "in-place" ? a : "source", [V, H] = _(null), U = B === "preview" ? null : c(M), W = M && typeof M == "object" ? M : void 0, G = W?.render, K = W?.sticky === "top" ? "top" : W?.sticky ? "bottom" : !1, q = W?.stickyVisibility, J = g(s);
|
|
233
|
+
J.current = s;
|
|
234
|
+
let Y = g(j);
|
|
235
|
+
Y.current = j;
|
|
236
|
+
let X = g((e, t) => {
|
|
237
|
+
Y.current?.(e, t);
|
|
238
|
+
}).current, Z = g(A);
|
|
239
|
+
Z.current = A;
|
|
240
|
+
let Q = g(void 0);
|
|
241
|
+
p(() => {
|
|
242
|
+
let t = e(r)?.frontmatter ?? null;
|
|
243
|
+
t !== Q.current && (Q.current = t, J.current?.(t));
|
|
244
|
+
}, [r]), m(z, () => ({
|
|
245
|
+
focus: () => V?.focus(),
|
|
246
|
+
getView: () => V,
|
|
239
247
|
insertAtCursor: (e) => {
|
|
240
|
-
|
|
248
|
+
V && (V.dispatch(V.state.replaceSelection(e)), V.focus());
|
|
241
249
|
},
|
|
242
250
|
scrollToHeading: (e) => {
|
|
243
|
-
if (!
|
|
244
|
-
let t = e.trim().toLowerCase(), { doc: n } =
|
|
251
|
+
if (!V) return !1;
|
|
252
|
+
let t = e.trim().toLowerCase(), { doc: n } = V.state;
|
|
245
253
|
for (let e = 1; e <= n.lines; e++) {
|
|
246
254
|
let r = n.line(e), i = /^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(r.text);
|
|
247
|
-
if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return
|
|
255
|
+
if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return V.dispatch({
|
|
248
256
|
selection: { anchor: r.from },
|
|
249
|
-
effects:
|
|
250
|
-
}),
|
|
257
|
+
effects: y.scrollIntoView(r.from, { y: "start" })
|
|
258
|
+
}), V.focus(), !0;
|
|
251
259
|
}
|
|
252
260
|
return !1;
|
|
261
|
+
},
|
|
262
|
+
invalidateEmbed: (e) => {
|
|
263
|
+
let n = Z.current;
|
|
264
|
+
n && t(n, e);
|
|
253
265
|
}
|
|
254
|
-
}), [
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
266
|
+
}), [V]);
|
|
267
|
+
let $ = [
|
|
268
|
+
n.root,
|
|
269
|
+
K === "bottom" && n.stickyToolbarRootBottom,
|
|
270
|
+
K === "top" && n.stickyToolbarRootTop,
|
|
259
271
|
"stylo",
|
|
260
272
|
v
|
|
261
273
|
].filter(Boolean).join(" ");
|
|
262
|
-
return /* @__PURE__ */
|
|
263
|
-
className:
|
|
264
|
-
"data-stylo-mode":
|
|
274
|
+
return /* @__PURE__ */ C("div", {
|
|
275
|
+
className: $,
|
|
276
|
+
"data-stylo-mode": B,
|
|
265
277
|
children: [
|
|
266
|
-
|
|
267
|
-
let e = /* @__PURE__ */
|
|
268
|
-
view:
|
|
269
|
-
items:
|
|
278
|
+
U && (() => {
|
|
279
|
+
let e = /* @__PURE__ */ S(P, {
|
|
280
|
+
view: V,
|
|
281
|
+
items: U,
|
|
270
282
|
icons: N,
|
|
271
|
-
disabled:
|
|
272
|
-
sticky:
|
|
273
|
-
stickyVisibility:
|
|
283
|
+
disabled: f,
|
|
284
|
+
sticky: K,
|
|
285
|
+
stickyVisibility: q
|
|
274
286
|
});
|
|
275
|
-
return
|
|
287
|
+
return G ? G(e, { view: V }) : e;
|
|
276
288
|
})(),
|
|
277
|
-
|
|
278
|
-
value:
|
|
279
|
-
onChange:
|
|
280
|
-
readOnly:
|
|
281
|
-
placeholder:
|
|
282
|
-
codeLanguages:
|
|
283
|
-
wikiLinkSource:
|
|
284
|
-
tagSource:
|
|
285
|
-
onResolveError:
|
|
289
|
+
B === "source" && /* @__PURE__ */ S(E, {
|
|
290
|
+
value: r,
|
|
291
|
+
onChange: i,
|
|
292
|
+
readOnly: f,
|
|
293
|
+
placeholder: h,
|
|
294
|
+
codeLanguages: x,
|
|
295
|
+
wikiLinkSource: w,
|
|
296
|
+
tagSource: T,
|
|
297
|
+
onResolveError: X,
|
|
286
298
|
onSave: o,
|
|
287
|
-
onViewChange:
|
|
288
|
-
canvasHeader:
|
|
299
|
+
onViewChange: H,
|
|
300
|
+
canvasHeader: R
|
|
289
301
|
}),
|
|
290
|
-
|
|
291
|
-
fallback: /* @__PURE__ */
|
|
292
|
-
className:
|
|
302
|
+
B === "preview" && /* @__PURE__ */ S(u, {
|
|
303
|
+
fallback: /* @__PURE__ */ S("div", {
|
|
304
|
+
className: n.preview,
|
|
293
305
|
"aria-busy": "true"
|
|
294
306
|
}),
|
|
295
|
-
children: /* @__PURE__ */
|
|
296
|
-
value:
|
|
307
|
+
children: /* @__PURE__ */ S(O, {
|
|
308
|
+
value: r,
|
|
297
309
|
onWikiLinkClick: l,
|
|
298
|
-
embedSource:
|
|
299
|
-
onResolveError:
|
|
300
|
-
frontmatter:
|
|
301
|
-
codeLanguages:
|
|
302
|
-
softBreaks:
|
|
303
|
-
onTaskToggle:
|
|
310
|
+
embedSource: A,
|
|
311
|
+
onResolveError: X,
|
|
312
|
+
frontmatter: F,
|
|
313
|
+
codeLanguages: x,
|
|
314
|
+
softBreaks: I,
|
|
315
|
+
onTaskToggle: L
|
|
304
316
|
})
|
|
305
317
|
}),
|
|
306
|
-
|
|
307
|
-
value:
|
|
308
|
-
onChange:
|
|
318
|
+
B === "split" && /* @__PURE__ */ S(k, {
|
|
319
|
+
value: r,
|
|
320
|
+
onChange: i,
|
|
309
321
|
onWikiLinkClick: l,
|
|
310
|
-
readOnly:
|
|
311
|
-
placeholder:
|
|
312
|
-
codeLanguages:
|
|
313
|
-
wikiLinkSource:
|
|
314
|
-
tagSource:
|
|
315
|
-
embedSource:
|
|
316
|
-
onResolveError:
|
|
317
|
-
frontmatter:
|
|
318
|
-
softBreaks:
|
|
319
|
-
onTaskToggle:
|
|
322
|
+
readOnly: f,
|
|
323
|
+
placeholder: h,
|
|
324
|
+
codeLanguages: x,
|
|
325
|
+
wikiLinkSource: w,
|
|
326
|
+
tagSource: T,
|
|
327
|
+
embedSource: A,
|
|
328
|
+
onResolveError: X,
|
|
329
|
+
frontmatter: F,
|
|
330
|
+
softBreaks: I,
|
|
331
|
+
onTaskToggle: L,
|
|
320
332
|
onSave: o,
|
|
321
|
-
onViewChange:
|
|
322
|
-
canvasHeader:
|
|
333
|
+
onViewChange: H,
|
|
334
|
+
canvasHeader: R
|
|
323
335
|
}),
|
|
324
|
-
|
|
325
|
-
fallback: /* @__PURE__ */
|
|
326
|
-
className:
|
|
336
|
+
B === "in-place" && /* @__PURE__ */ S(u, {
|
|
337
|
+
fallback: /* @__PURE__ */ S("div", {
|
|
338
|
+
className: n.inplace,
|
|
327
339
|
"aria-busy": "true"
|
|
328
340
|
}),
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
value:
|
|
331
|
-
onChange:
|
|
332
|
-
readOnly:
|
|
333
|
-
placeholder:
|
|
341
|
+
children: /* @__PURE__ */ S(D, {
|
|
342
|
+
value: r,
|
|
343
|
+
onChange: i,
|
|
344
|
+
readOnly: f,
|
|
345
|
+
placeholder: h,
|
|
334
346
|
onWikiLinkClick: l,
|
|
335
|
-
onLinkClick:
|
|
336
|
-
inPlace:
|
|
337
|
-
codeLanguages:
|
|
338
|
-
wikiLinkSource:
|
|
339
|
-
tagSource:
|
|
340
|
-
embedSource:
|
|
341
|
-
onResolveError:
|
|
347
|
+
onLinkClick: d,
|
|
348
|
+
inPlace: b,
|
|
349
|
+
codeLanguages: x,
|
|
350
|
+
wikiLinkSource: w,
|
|
351
|
+
tagSource: T,
|
|
352
|
+
embedSource: A,
|
|
353
|
+
onResolveError: X,
|
|
342
354
|
onSave: o,
|
|
343
|
-
onViewChange:
|
|
344
|
-
canvasHeader:
|
|
355
|
+
onViewChange: H,
|
|
356
|
+
canvasHeader: R
|
|
345
357
|
})
|
|
346
358
|
})
|
|
347
359
|
]
|
|
348
360
|
});
|
|
349
361
|
});
|
|
350
|
-
|
|
362
|
+
F.displayName = "Stylo";
|
|
351
363
|
//#endregion
|
|
352
|
-
export {
|
|
364
|
+
export { F as Stylo, e as splitFrontmatter };
|
|
353
365
|
|
|
354
366
|
//# sourceMappingURL=stylo.js.map
|