@damiro/stylo 0.11.0 → 0.12.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.
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { EditorView } from "@codemirror/view";
3
- import type { CodeLanguages, EmbedSource, FrontmatterDisplay, ResolveErrorInfo, WikiLinkSource } from "./types";
3
+ import type { CodeLanguages, EmbedSource, FrontmatterDisplay, ResolveErrorInfo, TagSource, WikiLinkSource } from "./types";
4
4
  export interface SplitViewProps {
5
5
  value: string;
6
6
  onChange: (next: string) => void;
@@ -9,6 +9,7 @@ export interface SplitViewProps {
9
9
  placeholder?: string;
10
10
  codeLanguages?: CodeLanguages;
11
11
  wikiLinkSource?: WikiLinkSource;
12
+ tagSource?: TagSource;
12
13
  embedSource?: EmbedSource;
13
14
  onResolveError?: (error: unknown, info: ResolveErrorInfo) => void;
14
15
  frontmatter?: FrontmatterDisplay;
@@ -27,5 +28,5 @@ export interface SplitViewProps {
27
28
  * Stylo root to have a bounded height — otherwise both panes grow and the page
28
29
  * scrolls instead.
29
30
  */
30
- export declare function SplitView({ value, onChange, onWikiLinkClick, readOnly, placeholder, codeLanguages, wikiLinkSource, embedSource, onResolveError, frontmatter, onSave, onViewChange, canvasHeader, }: SplitViewProps): import("react").JSX.Element;
31
+ export declare function SplitView({ value, onChange, onWikiLinkClick, readOnly, placeholder, codeLanguages, wikiLinkSource, tagSource, embedSource, onResolveError, frontmatter, onSave, onViewChange, canvasHeader, }: SplitViewProps): import("react").JSX.Element;
31
32
  //# sourceMappingURL=SplitView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplitView.d.ts","sourceRoot":"","sources":["../src/SplitView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EACV,aA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1 +1 @@
1
- {"version":3,"file":"Stylo.d.ts","sourceRoot":"","sources":["../src/Stylo.tsx"],"names":[],"mappings":"AAUA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAoB,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAExE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,oGAqLhB,CAAA"}
1
+ {"version":3,"file":"Stylo.d.ts","sourceRoot":"","sources":["../src/Stylo.tsx"],"names":[],"mappings":"AAUA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAoB,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAExE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,oGAyLhB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { EditorView } from "@codemirror/view";
3
- import type { CodeLanguages, ResolveErrorInfo, WikiLinkSource } from "../types";
3
+ import type { CodeLanguages, ResolveErrorInfo, TagSource, WikiLinkSource } from "../types";
4
4
  export interface SourceViewProps {
5
5
  value: string;
6
6
  onChange: (next: string) => void;
@@ -10,7 +10,9 @@ export interface SourceViewProps {
10
10
  codeLanguages?: CodeLanguages;
11
11
  /** `[[wikilink]]` autocomplete source. Read once. */
12
12
  wikiLinkSource?: WikiLinkSource;
13
- /** Notified when `wikiLinkSource` rejects. */
13
+ /** `#tag` autocomplete source. Read once. */
14
+ tagSource?: TagSource;
15
+ /** Notified when `wikiLinkSource` or `tagSource` rejects. */
14
16
  onResolveError?: (error: unknown, info: ResolveErrorInfo) => void;
15
17
  /** Called with the doc string on `Mod-s`. */
16
18
  onSave?: (value: string) => void;
@@ -22,5 +24,5 @@ export interface SourceViewProps {
22
24
  }) => ReactNode;
23
25
  }
24
26
  /** Raw CodeMirror 6 Markdown surface bound to the canonical string. */
25
- export declare function SourceView({ value, onChange, readOnly, placeholder, codeLanguages, wikiLinkSource, onResolveError, onSave, onViewChange, canvasHeader, }: SourceViewProps): import("react").JSX.Element;
27
+ export declare function SourceView({ value, onChange, readOnly, placeholder, codeLanguages, wikiLinkSource, tagSource, onResolveError, onSave, onViewChange, canvasHeader, }: SourceViewProps): import("react").JSX.Element;
26
28
  //# sourceMappingURL=SourceView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SourceView.d.ts","sourceRoot":"","sources":["../../src/editor/SourceView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO/E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,qDAAqD;IACrD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,8CAA8C;IAC9C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjE,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAA;IAChD,kFAAkF;IAClF,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;KAAE,KAAK,SAAS,CAAA;CAC/D;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,Q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R,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,MAAM,EACN,YAAY,EACZ,YAAY,GACb,EAAE,eAAe,+BAyCjB"}
@@ -1,5 +1,5 @@
1
1
  import { type Extension } from "@codemirror/state";
2
- import type { CodeLanguages, ResolveErrorInfo, WikiLinkSource } from "../types";
2
+ import type { CodeLanguages, ResolveErrorInfo, TagSource, WikiLinkSource } from "../types";
3
3
  /**
4
4
  * Static extensions — created once with the view.
5
5
  *
@@ -10,7 +10,7 @@ import type { CodeLanguages, ResolveErrorInfo, WikiLinkSource } from "../types";
10
10
  * consumer opts in with exactly the set they want. See the 2026-09-01 journal
11
11
  * note and the ADR-001 amendment.
12
12
  */
13
- export declare function baseExtensions(codeLanguages?: CodeLanguages, wikiLinkSource?: WikiLinkSource, onResolveError?: (error: unknown, info: ResolveErrorInfo) => void): Extension;
13
+ export declare function baseExtensions(codeLanguages?: CodeLanguages, wikiLinkSource?: WikiLinkSource, onResolveError?: (error: unknown, info: ResolveErrorInfo) => void, tagSource?: TagSource): Extension;
14
14
  /** Extensions that depend on props and are swapped via a compartment on change. */
15
15
  export declare function dynamicConfig(opts: {
16
16
  readOnly: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/editor/extensions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAA;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO/E;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,cAAc,EAC/B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAChE,SAAS,CAuBX;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,GAAG,SAAS,CAOZ"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/editor/extensions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAA;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAQ1F;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,cAAc,EAC/B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,EACjE,SAAS,CAAC,EAAE,SAAS,GACpB,SAAS,CAyBX;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,GAAG,SAAS,CAOZ"}
@@ -0,0 +1,16 @@
1
+ import { type CompletionContext, type CompletionResult } from "@codemirror/autocomplete";
2
+ import type { Extension } from "@codemirror/state";
3
+ import type { ResolveErrorInfo, TagSource } from "../types";
4
+ type OnResolveError = (error: unknown, info: ResolveErrorInfo) => void;
5
+ /**
6
+ * The completion source. Exposed for unit tests; consumers use `tagCompletion`.
7
+ */
8
+ export declare function tagCompletionSource(source: TagSource, onError?: OnResolveError): (ctx: CompletionContext) => Promise<CompletionResult | null>;
9
+ /**
10
+ * `#tag` autocomplete. Off unless the host passes `tagSource`. Registered
11
+ * through the Markdown language data, so it is inert inside a fenced code
12
+ * block and leaves any embedded-language completions intact.
13
+ */
14
+ export declare function tagCompletion(source?: TagSource, onError?: OnResolveError): Extension;
15
+ export {};
16
+ //# sourceMappingURL=tag-complete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-complete.d.ts","sourceRoot":"","sources":["../../src/editor/tag-complete.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAiB,SAAS,EAAE,MAAM,UAAU,CAAA;AAE1E,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;AAyBtE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,SAC1D,iBAAiB,KAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA8BxE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAMrF"}
@@ -1,6 +1,6 @@
1
1
  import { type Extension } from "@codemirror/state";
2
2
  import { EditorView } from "@codemirror/view";
3
- import type { CodeLanguages, ResolveErrorInfo, WikiLinkSource } from "../types";
3
+ import type { CodeLanguages, ResolveErrorInfo, TagSource, WikiLinkSource } from "../types";
4
4
  export interface UseCodeMirrorOptions {
5
5
  value: string;
6
6
  onChange: (next: string) => void;
@@ -19,12 +19,17 @@ export interface UseCodeMirrorOptions {
19
19
  codeLanguages?: CodeLanguages;
20
20
  /** `[[wikilink]]` autocomplete source. Read once. */
21
21
  wikiLinkSource?: WikiLinkSource;
22
- /** Notified when `wikiLinkSource` rejects. Reached through a stable wrapper. */
22
+ /** `#tag` autocomplete source. Read once. */
23
+ tagSource?: TagSource;
24
+ /**
25
+ * Notified when `wikiLinkSource` or `tagSource` rejects. Reached through a
26
+ * stable wrapper.
27
+ */
23
28
  onResolveError?: (error: unknown, info: ResolveErrorInfo) => void;
24
29
  }
25
30
  /**
26
31
  * Owns a CodeMirror `EditorView` for the lifetime of the host element and keeps
27
32
  * it in sync with a controlled Markdown string. Returns a ref for the container.
28
33
  */
29
- export declare function useCodeMirror({ value, onChange, readOnly, placeholder, onSave, onViewChange, extensions, codeLanguages, wikiLinkSource, onResolveError, }: UseCodeMirrorOptions): import("react").RefObject<HTMLDivElement | null>;
34
+ export declare function useCodeMirror({ value, onChange, readOnly, placeholder, onSave, onViewChange, extensions, codeLanguages, wikiLinkSource, tagSource, onResolveError, }: UseCodeMirrorOptions): import("react").RefObject<HTMLDivElement | null>;
30
35
  //# sourceMappingURL=useCodeMirror.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../../src/editor/useCodeMirror.ts"],"names":[],"mappings":"AACA,OAAO,EAAwC,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAA;AAC9F,OAAO,EAAE,UAAU,EAAU,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO/E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,oFAAoF;IACpF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAA;IAChD;;;OAGG;IACH,UAAU,CAAC,E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AA;IAC/B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAClE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,GACf,EAAE,oBAAoB,oDA8EtB"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Stylo } from "./Stylo";
2
2
  export { splitFrontmatter } from "./frontmatter";
3
- export type { CodeLanguages, EmbedSource, FrontmatterDisplay, InPlaceConfig, InPlaceDecorationToggles, ResolveErrorInfo, RevealMode, SelectionUI, StyloHandle, StyloMode, StyloProps, TableEditing, ToolbarCommandId, ToolbarConfig, ToolbarCustomItem, ToolbarItem, WikiLinkCompletion, WikiLinkSource, } from "./types";
3
+ export type { CodeLanguages, EmbedSource, FrontmatterDisplay, InPlaceConfig, InPlaceDecorationToggles, ResolveErrorInfo, RevealMode, SelectionUI, StyloHandle, StyloMode, StyloProps, TableEditing, TagCompletion, TagSource, ToolbarCommandId, ToolbarConfig, ToolbarCustomItem, ToolbarItem, WikiLinkCompletion, WikiLinkSource, } from "./types";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,SAAS,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { EditorView } from "@codemirror/view";
3
- import type { CodeLanguages, EmbedSource, InPlaceConfig, ResolveErrorInfo, WikiLinkSource } from "../types";
3
+ import type { CodeLanguages, EmbedSource, InPlaceConfig, ResolveErrorInfo, TagSource, WikiLinkSource } from "../types";
4
4
  export interface InPlaceViewProps {
5
5
  value: string;
6
6
  onChange: (next: string) => void;
@@ -15,9 +15,11 @@ export interface InPlaceViewProps {
15
15
  codeLanguages?: CodeLanguages;
16
16
  /** `[[wikilink]]` autocomplete source. Read once. */
17
17
  wikiLinkSource?: WikiLinkSource;
18
+ /** `#tag` autocomplete source. Read once. */
19
+ tagSource?: TagSource;
18
20
  /** Resolves `![[ref]]` embeds. Read once, at mount — see ADR-009. */
19
21
  embedSource?: EmbedSource;
20
- /** Notified when `embedSource` or `wikiLinkSource` rejects. */
22
+ /** Notified when `embedSource`, `wikiLinkSource`, or `tagSource` rejects. */
21
23
  onResolveError?: (error: unknown, info: ResolveErrorInfo) => void;
22
24
  /** Called with the doc string on `Mod-s`. */
23
25
  onSave?: (value: string) => void;
@@ -42,5 +44,5 @@ export interface InPlaceViewProps {
42
44
  * `EmbedRegistry` and portals a host `<Embed>` into every live slot, so one
43
45
  * React tree — reusing `Embed` verbatim — serves the canvas and `preview` alike.
44
46
  */
45
- export declare function InPlaceView({ value, onChange, readOnly, placeholder, onWikiLinkClick, onLinkClick, inPlace, codeLanguages, wikiLinkSource, embedSource, onResolveError, onSave, onViewChange, canvasHeader, }: InPlaceViewProps): import("react").JSX.Element;
47
+ export declare function InPlaceView({ value, onChange, readOnly, placeholder, onWikiLinkClick, onLinkClick, inPlace, codeLanguages, wikiLinkSource, tagSource, embedSource, onResolveError, onSave, onViewChange, canvasHeader, }: InPlaceViewProps): import("react").JSX.Element;
46
48
  //# sourceMappingURL=InPlaceView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InPlaceView.d.ts","sourceRoot":"","sources":["../../src/inplace/InPlaceView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAA;AAOjB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,aAA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WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,qDAAqD;IACrD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,qEAAqE;IACrE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjE,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAA;IAChD,kFAAkF;IAClF,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;KAAE,KAAK,SAAS,CAAA;CAC/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACX,OAAO,EACP,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,MAAM,EACN,YAAY,EACZ,YAAY,GACb,EAAE,gBAAgB,+BAqElB"}
package/dist/stylo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as e, n as t } from "./frontmatter-DTCC0gaa.js";
2
- import { S as n, n as r, t as i } from "./useCodeMirror-CjG9CwpB.js";
2
+ import { S as n, n as r, t as i } from "./useCodeMirror-BI1kEPRE.js";
3
3
  import { n as a, r as o } from "./config-DTBxVhtH.js";
4
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
5
  import { EditorView as g, showPanel as _ } from "@codemirror/view";
@@ -7,52 +7,53 @@ import { createPortal as v } from "react-dom";
7
7
  import { jsx as y, jsxs as b } from "react/jsx-runtime";
8
8
  //#region src/editor/SourceView.tsx
9
9
  var x = () => () => {}, S = () => null;
10
- function C({ value: t, onChange: r, readOnly: a, placeholder: o, codeLanguages: s, wikiLinkSource: c, onResolveError: l, onSave: u, onViewChange: d, canvasHeader: f }) {
11
- let [g, b] = m(null), C = p(d);
12
- C.current = d;
13
- let w = p((e) => {
14
- b(e), C.current?.(e);
15
- }).current, T = p(f);
16
- T.current = f;
17
- let [E] = m(() => f ? new n() : null), D = h(E?.subscribe ?? x, E?.getSnapshot ?? S), [O] = m(() => E ? [_.of(E.panel)] : []), k = i({
10
+ function C({ value: t, 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({
18
18
  value: t,
19
19
  onChange: r,
20
20
  readOnly: a,
21
21
  placeholder: o,
22
22
  codeLanguages: s,
23
23
  wikiLinkSource: c,
24
- onResolveError: l,
25
- onSave: u,
26
- onViewChange: w,
27
- extensions: O
24
+ tagSource: l,
25
+ onResolveError: u,
26
+ onSave: d,
27
+ onViewChange: T,
28
+ extensions: k
28
29
  });
29
30
  return /* @__PURE__ */ y("div", {
30
31
  className: e.source,
31
- ref: k,
32
- children: D && T.current && v(T.current({ view: g }), D)
32
+ ref: A,
33
+ children: O && E.current && v(E.current({ view: b }), O)
33
34
  });
34
35
  }
35
36
  //#endregion
36
37
  //#region src/inplace/lazyInPlace.ts
37
- var w = l(async () => ({ default: (await import("./InPlaceView-Dyf7I4XQ.js")).InPlaceView })), T = l(async () => ({ default: (await import("./Preview-DIsFdBFA.js")).Preview }));
38
+ var w = l(async () => ({ default: (await import("./InPlaceView-BWc06Jso.js")).InPlaceView })), T = l(async () => ({ default: (await import("./Preview-DIsFdBFA.js")).Preview }));
38
39
  //#endregion
39
40
  //#region src/SplitView.tsx
40
- function E({ value: t, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder: a, codeLanguages: o, wikiLinkSource: c, embedSource: l, onResolveError: d, frontmatter: f, onSave: h, onViewChange: g, canvasHeader: _ }) {
41
- let [v, x] = m(null), S = p(null), w = p(!1);
41
+ function E({ value: t, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder: a, codeLanguages: o, wikiLinkSource: c, tagSource: l, embedSource: d, onResolveError: f, frontmatter: h, onSave: g, onViewChange: _, canvasHeader: v }) {
42
+ let [x, S] = m(null), w = p(null), E = p(!1);
42
43
  return u(() => {
43
- let e = v?.scrollDOM, t = S.current;
44
+ let e = x?.scrollDOM, t = w.current;
44
45
  if (!e || !t) return;
45
46
  let n = (e, t) => {
46
- if (w.current) return;
47
+ if (E.current) return;
47
48
  let n = e.scrollHeight - e.clientHeight;
48
- n <= 0 || (w.current = !0, t.scrollTop = e.scrollTop / n * (t.scrollHeight - t.clientHeight), requestAnimationFrame(() => {
49
- w.current = !1;
49
+ n <= 0 || (E.current = !0, t.scrollTop = e.scrollTop / n * (t.scrollHeight - t.clientHeight), requestAnimationFrame(() => {
50
+ E.current = !1;
50
51
  }));
51
52
  }, r = () => n(e, t), i = () => n(t, e);
52
53
  return e.addEventListener("scroll", r, { passive: !0 }), t.addEventListener("scroll", i, { passive: !0 }), () => {
53
54
  e.removeEventListener("scroll", r), t.removeEventListener("scroll", i);
54
55
  };
55
- }, [v]), /* @__PURE__ */ b("div", {
56
+ }, [x]), /* @__PURE__ */ b("div", {
56
57
  className: e.split,
57
58
  children: [/* @__PURE__ */ y("div", {
58
59
  className: e.splitPane,
@@ -63,16 +64,17 @@ function E({ value: t, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder
63
64
  placeholder: a,
64
65
  codeLanguages: o,
65
66
  wikiLinkSource: c,
66
- onResolveError: d,
67
- onSave: h,
67
+ tagSource: l,
68
+ onResolveError: f,
69
+ onSave: g,
68
70
  onViewChange: (e) => {
69
- x(e), g?.(e);
71
+ S(e), _?.(e);
70
72
  },
71
- canvasHeader: _
73
+ canvasHeader: v
72
74
  })
73
75
  }), /* @__PURE__ */ y("div", {
74
76
  className: e.splitPane,
75
- ref: S,
77
+ ref: w,
76
78
  children: /* @__PURE__ */ y(s, {
77
79
  fallback: /* @__PURE__ */ y("div", {
78
80
  className: e.preview,
@@ -81,9 +83,9 @@ function E({ value: t, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder
81
83
  children: /* @__PURE__ */ y(T, {
82
84
  value: t,
83
85
  onWikiLinkClick: r,
84
- embedSource: l,
85
- onResolveError: d,
86
- frontmatter: f
86
+ embedSource: d,
87
+ onResolveError: f,
88
+ frontmatter: h
87
89
  })
88
90
  })
89
91
  })]
@@ -217,71 +219,72 @@ function j({ view: t, items: n, icons: r, disabled: i, sticky: a, stickyVisibili
217
219
  }
218
220
  //#endregion
219
221
  //#region src/Stylo.tsx
220
- 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, embedSource: O, onResolveError: k, toolbar: A, icons: M, frontmatter: N, canvasHeader: P }, F) {
221
- let I = i === "preview" || i === "split" || i === "in-place" ? i : "source", [L, R] = m(null), z = I === "preview" ? null : a(A), B = A && typeof A == "object" ? A.render : void 0, V = A && typeof A == "object" ? A.sticky : void 0, H = V === "top" ? "top" : V ? "bottom" : !1, U = A && typeof A == "object" ? A.stickyVisibility : void 0, W = p(c);
222
- W.current = c;
223
- let G = p(k);
224
- G.current = k;
225
- let K = p((e, t) => {
226
- G.current?.(e, t);
227
- }).current, q = p(void 0);
222
+ 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, canvasHeader: F }, I) {
223
+ let L = i === "preview" || i === "split" || i === "in-place" ? i : "source", [R, z] = m(null), B = L === "preview" ? null : a(M), V = M && typeof M == "object" ? M.render : void 0, H = M && typeof M == "object" ? M.sticky : void 0, U = H === "top" ? "top" : H ? "bottom" : !1, W = M && typeof M == "object" ? M.stickyVisibility : void 0, G = p(c);
224
+ G.current = c;
225
+ let K = p(A);
226
+ K.current = A;
227
+ let q = p((e, t) => {
228
+ K.current?.(e, t);
229
+ }).current, J = p(void 0);
228
230
  u(() => {
229
231
  let e = t(n)?.frontmatter ?? null;
230
- e !== q.current && (q.current = e, W.current?.(e));
231
- }, [n]), d(F, () => ({
232
- focus: () => L?.focus(),
233
- getView: () => L,
232
+ e !== J.current && (J.current = e, G.current?.(e));
233
+ }, [n]), d(I, () => ({
234
+ focus: () => R?.focus(),
235
+ getView: () => R,
234
236
  insertAtCursor: (e) => {
235
- L && (L.dispatch(L.state.replaceSelection(e)), L.focus());
237
+ R && (R.dispatch(R.state.replaceSelection(e)), R.focus());
236
238
  },
237
239
  scrollToHeading: (e) => {
238
- if (!L) return !1;
239
- let t = e.trim().toLowerCase(), { doc: n } = L.state;
240
+ if (!R) return !1;
241
+ let t = e.trim().toLowerCase(), { doc: n } = R.state;
240
242
  for (let e = 1; e <= n.lines; e++) {
241
243
  let r = n.line(e), i = /^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(r.text);
242
- if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return L.dispatch({
244
+ if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return R.dispatch({
243
245
  selection: { anchor: r.from },
244
246
  effects: g.scrollIntoView(r.from, { y: "start" })
245
- }), L.focus(), !0;
247
+ }), R.focus(), !0;
246
248
  }
247
249
  return !1;
248
250
  }
249
- }), [L]);
250
- let J = [
251
+ }), [R]);
252
+ let Y = [
251
253
  e.root,
252
- H === "bottom" && e.stickyToolbarRootBottom,
253
- H === "top" && e.stickyToolbarRootTop,
254
+ U === "bottom" && e.stickyToolbarRootBottom,
255
+ U === "top" && e.stickyToolbarRootTop,
254
256
  "stylo",
255
257
  v
256
258
  ].filter(Boolean).join(" ");
257
259
  return /* @__PURE__ */ b("div", {
258
- className: J,
259
- "data-stylo-mode": I,
260
+ className: Y,
261
+ "data-stylo-mode": L,
260
262
  children: [
261
- z && (() => {
263
+ B && (() => {
262
264
  let e = /* @__PURE__ */ y(j, {
263
- view: L,
264
- items: z,
265
- icons: M,
265
+ view: R,
266
+ items: B,
267
+ icons: N,
266
268
  disabled: h,
267
- sticky: H,
268
- stickyVisibility: U
269
+ sticky: U,
270
+ stickyVisibility: W
269
271
  });
270
- return B ? B(e, { view: L }) : e;
272
+ return V ? V(e, { view: R }) : e;
271
273
  })(),
272
- I === "source" && /* @__PURE__ */ y(C, {
274
+ L === "source" && /* @__PURE__ */ y(C, {
273
275
  value: n,
274
276
  onChange: r,
275
277
  readOnly: h,
276
278
  placeholder: _,
277
279
  codeLanguages: S,
278
280
  wikiLinkSource: D,
279
- onResolveError: K,
281
+ tagSource: O,
282
+ onResolveError: q,
280
283
  onSave: o,
281
- onViewChange: R,
282
- canvasHeader: P
284
+ onViewChange: z,
285
+ canvasHeader: F
283
286
  }),
284
- I === "preview" && /* @__PURE__ */ y(s, {
287
+ L === "preview" && /* @__PURE__ */ y(s, {
285
288
  fallback: /* @__PURE__ */ y("div", {
286
289
  className: e.preview,
287
290
  "aria-busy": "true"
@@ -289,12 +292,12 @@ var M = c(function({ value: n, onChange: r, mode: i = "in-place", onSave: o, onF
289
292
  children: /* @__PURE__ */ y(T, {
290
293
  value: n,
291
294
  onWikiLinkClick: l,
292
- embedSource: O,
293
- onResolveError: K,
294
- frontmatter: N
295
+ embedSource: k,
296
+ onResolveError: q,
297
+ frontmatter: P
295
298
  })
296
299
  }),
297
- I === "split" && /* @__PURE__ */ y(E, {
300
+ L === "split" && /* @__PURE__ */ y(E, {
298
301
  value: n,
299
302
  onChange: r,
300
303
  onWikiLinkClick: l,
@@ -302,14 +305,15 @@ var M = c(function({ value: n, onChange: r, mode: i = "in-place", onSave: o, onF
302
305
  placeholder: _,
303
306
  codeLanguages: S,
304
307
  wikiLinkSource: D,
305
- embedSource: O,
306
- onResolveError: K,
307
- frontmatter: N,
308
+ tagSource: O,
309
+ embedSource: k,
310
+ onResolveError: q,
311
+ frontmatter: P,
308
312
  onSave: o,
309
- onViewChange: R,
310
- canvasHeader: P
313
+ onViewChange: z,
314
+ canvasHeader: F
311
315
  }),
312
- I === "in-place" && /* @__PURE__ */ y(s, {
316
+ L === "in-place" && /* @__PURE__ */ y(s, {
313
317
  fallback: /* @__PURE__ */ y("div", {
314
318
  className: e.inplace,
315
319
  "aria-busy": "true"
@@ -324,11 +328,12 @@ var M = c(function({ value: n, onChange: r, mode: i = "in-place", onSave: o, onF
324
328
  inPlace: x,
325
329
  codeLanguages: S,
326
330
  wikiLinkSource: D,
327
- embedSource: O,
328
- onResolveError: K,
331
+ tagSource: O,
332
+ embedSource: k,
333
+ onResolveError: q,
329
334
  onSave: o,
330
- onViewChange: R,
331
- canvasHeader: P
335
+ onViewChange: z,
336
+ canvasHeader: F
332
337
  })
333
338
  })
334
339
  ]