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