quoin-editor 0.4.2 → 1.0.1
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/CHANGELOG.md +251 -0
- package/MIGRATION.md +233 -0
- package/README.md +78 -716
- package/dist/ai.cjs +1148 -0
- package/dist/ai.cjs.map +1 -0
- package/dist/ai.d.cts +68 -0
- package/dist/ai.d.ts +68 -0
- package/dist/ai.js +1148 -0
- package/dist/ai.js.map +1 -0
- package/dist/catalogue.cjs +59 -0
- package/dist/catalogue.cjs.map +1 -0
- package/dist/catalogue.d.cts +39 -0
- package/dist/catalogue.d.ts +39 -0
- package/dist/catalogue.js +59 -0
- package/dist/catalogue.js.map +1 -0
- package/dist/chunk-26Q4LSIU.js +100 -0
- package/dist/chunk-26Q4LSIU.js.map +1 -0
- package/dist/chunk-56C7GCKO.cjs +1385 -0
- package/dist/chunk-56C7GCKO.cjs.map +1 -0
- package/dist/chunk-5M4QG3ZC.cjs +3303 -0
- package/dist/chunk-5M4QG3ZC.cjs.map +1 -0
- package/dist/chunk-5R3ISX4A.cjs +6643 -0
- package/dist/chunk-5R3ISX4A.cjs.map +1 -0
- package/dist/chunk-62WKUAQY.js +3335 -0
- package/dist/chunk-62WKUAQY.js.map +1 -0
- package/dist/chunk-6LMS5J3Y.js +320 -0
- package/dist/chunk-6LMS5J3Y.js.map +1 -0
- package/dist/chunk-6PKVJZQV.cjs +100 -0
- package/dist/chunk-6PKVJZQV.cjs.map +1 -0
- package/dist/chunk-6YSGUAVW.js +376 -0
- package/dist/chunk-6YSGUAVW.js.map +1 -0
- package/dist/chunk-75C6PX2L.cjs +239 -0
- package/dist/chunk-75C6PX2L.cjs.map +1 -0
- package/dist/chunk-A4IJSJKL.js +598 -0
- package/dist/chunk-A4IJSJKL.js.map +1 -0
- package/dist/chunk-BTBHHBVR.cjs +3335 -0
- package/dist/chunk-BTBHHBVR.cjs.map +1 -0
- package/dist/chunk-CLTHD5GO.cjs +34 -0
- package/dist/chunk-CLTHD5GO.cjs.map +1 -0
- package/dist/chunk-EH5KXQXY.cjs +62 -0
- package/dist/chunk-EH5KXQXY.cjs.map +1 -0
- package/dist/chunk-ESMAW4NK.cjs +184 -0
- package/dist/chunk-ESMAW4NK.cjs.map +1 -0
- package/dist/chunk-EYFCOV3T.cjs +30 -0
- package/dist/chunk-EYFCOV3T.cjs.map +1 -0
- package/dist/chunk-F5V3IEEE.cjs +326 -0
- package/dist/chunk-F5V3IEEE.cjs.map +1 -0
- package/dist/chunk-GPIDU3GN.js +239 -0
- package/dist/chunk-GPIDU3GN.js.map +1 -0
- package/dist/chunk-HOIDJEVI.cjs +4063 -0
- package/dist/chunk-HOIDJEVI.cjs.map +1 -0
- package/dist/chunk-JJ3RASQS.cjs +706 -0
- package/dist/chunk-JJ3RASQS.cjs.map +1 -0
- package/dist/chunk-LE3F7WIP.js +6643 -0
- package/dist/chunk-LE3F7WIP.js.map +1 -0
- package/dist/chunk-LE5XMIFJ.cjs +14 -0
- package/dist/chunk-LE5XMIFJ.cjs.map +1 -0
- package/dist/chunk-LMAEPFTX.js +30 -0
- package/dist/chunk-LMAEPFTX.js.map +1 -0
- package/dist/chunk-LV6EYPJO.js +34 -0
- package/dist/chunk-LV6EYPJO.js.map +1 -0
- package/dist/chunk-MLRAVUFG.cjs +376 -0
- package/dist/chunk-MLRAVUFG.cjs.map +1 -0
- package/dist/chunk-MQUCCSWG.js +14 -0
- package/dist/chunk-MQUCCSWG.js.map +1 -0
- package/dist/chunk-O4Z2WMFF.js +62 -0
- package/dist/chunk-O4Z2WMFF.js.map +1 -0
- package/dist/chunk-OCCKQHCY.js +25 -0
- package/dist/chunk-OCCKQHCY.js.map +1 -0
- package/dist/chunk-PGSS4IOS.js +706 -0
- package/dist/chunk-PGSS4IOS.js.map +1 -0
- package/dist/chunk-PIWRSX7U.js +562 -0
- package/dist/chunk-PIWRSX7U.js.map +1 -0
- package/dist/chunk-PX6LZMH4.cjs +598 -0
- package/dist/chunk-PX6LZMH4.cjs.map +1 -0
- package/dist/chunk-QXG3HWDS.js +184 -0
- package/dist/chunk-QXG3HWDS.js.map +1 -0
- package/dist/chunk-RQW3P3GH.js +504 -0
- package/dist/chunk-RQW3P3GH.js.map +1 -0
- package/dist/chunk-SSIRYUCK.js +3303 -0
- package/dist/chunk-SSIRYUCK.js.map +1 -0
- package/dist/chunk-UBNG5YCG.js +326 -0
- package/dist/chunk-UBNG5YCG.js.map +1 -0
- package/dist/chunk-UCXLRRWY.js +1385 -0
- package/dist/chunk-UCXLRRWY.js.map +1 -0
- package/dist/chunk-UDAVVEFC.cjs +562 -0
- package/dist/chunk-UDAVVEFC.cjs.map +1 -0
- package/dist/chunk-UPSLDTLT.js +4063 -0
- package/dist/chunk-UPSLDTLT.js.map +1 -0
- package/dist/chunk-UWNZG2SD.cjs +25 -0
- package/dist/chunk-UWNZG2SD.cjs.map +1 -0
- package/dist/chunk-V3KLMSRO.cjs +504 -0
- package/dist/chunk-V3KLMSRO.cjs.map +1 -0
- package/dist/chunk-VACTAZWS.cjs +249 -0
- package/dist/chunk-VACTAZWS.cjs.map +1 -0
- package/dist/chunk-WMN6566P.js +249 -0
- package/dist/chunk-WMN6566P.js.map +1 -0
- package/dist/chunk-XX5FTPJR.cjs +320 -0
- package/dist/chunk-XX5FTPJR.cjs.map +1 -0
- package/dist/comments.cjs +1008 -0
- package/dist/comments.cjs.map +1 -0
- package/dist/comments.d.cts +93 -0
- package/dist/comments.d.ts +93 -0
- package/dist/comments.js +1008 -0
- package/dist/comments.js.map +1 -0
- package/dist/diff.cjs +346 -0
- package/dist/diff.cjs.map +1 -0
- package/dist/diff.d.cts +67 -0
- package/dist/diff.d.ts +67 -0
- package/dist/diff.js +346 -0
- package/dist/diff.js.map +1 -0
- package/dist/docx.cjs +874 -0
- package/dist/docx.cjs.map +1 -0
- package/dist/docx.d.cts +33 -0
- package/dist/docx.d.ts +33 -0
- package/dist/docx.js +874 -0
- package/dist/docx.js.map +1 -0
- package/dist/embed-provider-jXwlRmnp.d.cts +19 -0
- package/dist/embed-provider-jXwlRmnp.d.ts +19 -0
- package/dist/embed.cjs +17 -0
- package/dist/embed.cjs.map +1 -0
- package/dist/embed.d.cts +56 -0
- package/dist/embed.d.ts +56 -0
- package/dist/embed.js +17 -0
- package/dist/embed.js.map +1 -0
- package/dist/emoji-data.cjs +1968 -0
- package/dist/emoji-data.cjs.map +1 -0
- package/dist/emoji-data.js +1968 -0
- package/dist/emoji-data.js.map +1 -0
- package/dist/emoji-extension-CmPlRssm.d.ts +46 -0
- package/dist/emoji-extension-zJ6F7hW8.d.cts +46 -0
- package/dist/emoji.cjs +18 -0
- package/dist/emoji.cjs.map +1 -0
- package/dist/emoji.d.cts +31 -0
- package/dist/emoji.d.ts +31 -0
- package/dist/emoji.js +18 -0
- package/dist/emoji.js.map +1 -0
- package/dist/engine.cjs +119 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +144 -0
- package/dist/engine.d.ts +144 -0
- package/dist/engine.js +119 -0
- package/dist/engine.js.map +1 -0
- package/dist/find-extension-BcRyE9K4.d.cts +41 -0
- package/dist/find-extension-CmFehyul.d.ts +41 -0
- package/dist/find.cjs +20 -0
- package/dist/find.cjs.map +1 -0
- package/dist/find.d.cts +44 -0
- package/dist/find.d.ts +44 -0
- package/dist/find.js +20 -0
- package/dist/find.js.map +1 -0
- package/dist/headless.cjs +151 -518
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.d.cts +102 -69
- package/dist/headless.d.ts +102 -69
- package/dist/headless.js +149 -467
- package/dist/headless.js.map +1 -1
- package/dist/index-CFPmCee4.d.cts +68 -0
- package/dist/index-DiCGV60d.d.ts +68 -0
- package/dist/index.cjs +183 -2753
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -253
- package/dist/index.d.ts +345 -253
- package/dist/index.js +168 -2696
- package/dist/index.js.map +1 -1
- package/dist/math.cjs +18 -0
- package/dist/math.cjs.map +1 -0
- package/dist/math.d.cts +49 -0
- package/dist/math.d.ts +49 -0
- package/dist/math.js +18 -0
- package/dist/math.js.map +1 -0
- package/dist/mention.cjs +18 -0
- package/dist/mention.cjs.map +1 -0
- package/dist/mention.d.cts +50 -0
- package/dist/mention.d.ts +50 -0
- package/dist/mention.js +18 -0
- package/dist/mention.js.map +1 -0
- package/dist/presence.cjs +562 -0
- package/dist/presence.cjs.map +1 -0
- package/dist/presence.d.cts +30 -0
- package/dist/presence.d.ts +30 -0
- package/dist/presence.js +562 -0
- package/dist/presence.js.map +1 -0
- package/dist/registry-CWBOSAHm.d.cts +121 -0
- package/dist/registry-CWBOSAHm.d.ts +121 -0
- package/dist/stats-extension-DisOEbbI.d.ts +40 -0
- package/dist/stats-extension-Dt1lgP3m.d.cts +40 -0
- package/dist/stats.cjs +19 -0
- package/dist/stats.cjs.map +1 -0
- package/dist/stats.d.cts +19 -0
- package/dist/stats.d.ts +19 -0
- package/dist/stats.js +19 -0
- package/dist/stats.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/table-extension-BTMJnT7J.d.ts +57 -0
- package/dist/table-extension-DxZz3jqp.d.cts +57 -0
- package/dist/table.cjs +50 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +57 -0
- package/dist/table.d.ts +57 -0
- package/dist/table.js +50 -0
- package/dist/table.js.map +1 -0
- package/dist/to-html-C5t7xyaM.d.ts +21 -0
- package/dist/to-html-CNCITCln.d.cts +21 -0
- package/dist/toc-extension-CR9U-l6j.d.ts +25 -0
- package/dist/toc-extension-DGHywOBv.d.cts +25 -0
- package/dist/toc.cjs +18 -0
- package/dist/toc.cjs.map +1 -0
- package/dist/toc.d.cts +24 -0
- package/dist/toc.d.ts +24 -0
- package/dist/toc.js +18 -0
- package/dist/toc.js.map +1 -0
- package/dist/types-C6_QkXzy.d.ts +358 -0
- package/dist/types-CJ7Gq3GX.d.cts +358 -0
- package/dist/types-DULc8wwg.d.cts +120 -0
- package/dist/types-DULc8wwg.d.ts +120 -0
- package/dist/view-controller-BD1KwYfE.d.cts +105 -0
- package/dist/view-controller-y4cb60ue.d.ts +105 -0
- package/dist/view.cjs +23 -0
- package/dist/view.cjs.map +1 -0
- package/dist/view.d.cts +40 -0
- package/dist/view.d.ts +40 -0
- package/dist/view.js +23 -0
- package/dist/view.js.map +1 -0
- package/dist/yjs.cjs +864 -0
- package/dist/yjs.cjs.map +1 -0
- package/dist/yjs.d.cts +22 -0
- package/dist/yjs.d.ts +22 -0
- package/dist/yjs.js +864 -0
- package/dist/yjs.js.map +1 -0
- package/package.json +217 -18
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { c as EditorState, D as Decoration, a as Editor, T as Transaction, b as Command } from './types-C6_QkXzy.js';
|
|
2
|
+
import { a as Selection, b as AtomNode, P as Pos } from './types-DULc8wwg.js';
|
|
3
|
+
|
|
4
|
+
type Spoken = {
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly state: EditorState | undefined;
|
|
7
|
+
readonly serial: number;
|
|
8
|
+
readonly at: number;
|
|
9
|
+
};
|
|
10
|
+
type Announcer = {
|
|
11
|
+
announce(message: string): void;
|
|
12
|
+
current(): Spoken | null;
|
|
13
|
+
subscribe(listener: () => void): () => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type NodeReveal = {
|
|
17
|
+
/** Marks a block a press is selecting, which is under the pointer already. */
|
|
18
|
+
pressed(block: string): void;
|
|
19
|
+
/** Forgets the block shown once the selection leaves it, however it leaves, so coming back brings it into view. */
|
|
20
|
+
follow(selection: Selection | null): void;
|
|
21
|
+
/** Brings the block into view once; a change made here also brings in the block a settle left where it was. */
|
|
22
|
+
show(selection: Selection | null, local?: boolean): void;
|
|
23
|
+
/** Counts the block a selection holds as shown, and as owed to the next change made here if it was not shown yet. */
|
|
24
|
+
settle(selection: Selection | null): void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type AtomRenderer = (node: AtomNode, doc: Document) => HTMLElement;
|
|
28
|
+
type WidgetRenderer = (decoration: Extract<Decoration, {
|
|
29
|
+
kind: 'widget';
|
|
30
|
+
}>, doc: Document) => HTMLElement;
|
|
31
|
+
type RenderOptions = {
|
|
32
|
+
atoms?: Readonly<Record<string, AtomRenderer>>;
|
|
33
|
+
widgets?: Readonly<Record<string, WidgetRenderer>>;
|
|
34
|
+
atomText?: (node: AtomNode) => string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type KeyInterceptor = (event: KeyboardEvent) => boolean;
|
|
38
|
+
|
|
39
|
+
type FocusTarget = Pos | 'start' | 'end';
|
|
40
|
+
|
|
41
|
+
type HostEntry = {
|
|
42
|
+
readonly block: string;
|
|
43
|
+
readonly region: string;
|
|
44
|
+
readonly element: HTMLElement;
|
|
45
|
+
};
|
|
46
|
+
type HostRegistry = {
|
|
47
|
+
register(block: string, region: string, element: HTMLElement): () => void;
|
|
48
|
+
get(block: string, region: string): HTMLElement | undefined;
|
|
49
|
+
locate(node: Node | null): HostEntry | null;
|
|
50
|
+
all(): IterableIterator<HostEntry>;
|
|
51
|
+
};
|
|
52
|
+
declare function hostKey(block: string, region: string): string;
|
|
53
|
+
|
|
54
|
+
type ViewControllerOptions = {
|
|
55
|
+
editor: Editor;
|
|
56
|
+
flush?: (fn: () => void) => void;
|
|
57
|
+
render?: RenderOptions;
|
|
58
|
+
onFiles?: (files: File[], at: Pos | null) => void;
|
|
59
|
+
readOnly?: boolean;
|
|
60
|
+
/** Which key is Mod. Defaults to the platform, as the editor's own isMac does, and must agree with it. */
|
|
61
|
+
isMac?: boolean;
|
|
62
|
+
};
|
|
63
|
+
declare class ViewController {
|
|
64
|
+
#private;
|
|
65
|
+
readonly editor: Editor;
|
|
66
|
+
readonly registry: HostRegistry;
|
|
67
|
+
readonly keyInterceptors: Set<KeyInterceptor>;
|
|
68
|
+
readonly nodeReveal: NodeReveal;
|
|
69
|
+
readonly announcer: Announcer;
|
|
70
|
+
readonly isMac: boolean;
|
|
71
|
+
readonly onFiles: ViewControllerOptions['onFiles'];
|
|
72
|
+
goalX: number | null;
|
|
73
|
+
nativeVerticalMove: boolean;
|
|
74
|
+
dragging: boolean;
|
|
75
|
+
composingKey: string | null;
|
|
76
|
+
constructor(options: ViewControllerOptions);
|
|
77
|
+
get root(): HTMLElement | null;
|
|
78
|
+
get readOnly(): boolean;
|
|
79
|
+
get sink(): HTMLElement | null;
|
|
80
|
+
get emptyHost(): HTMLElement | null;
|
|
81
|
+
attach(root: HTMLElement): () => void;
|
|
82
|
+
registerBlockElement(id: string, element: HTMLElement): () => void;
|
|
83
|
+
blockElement(id: string): HTMLElement | undefined;
|
|
84
|
+
blockAt(node: Node): string | undefined;
|
|
85
|
+
registerSink(element: HTMLElement): () => void;
|
|
86
|
+
registerEmptyHost(element: HTMLElement): () => void;
|
|
87
|
+
isEditorElement(element: Element): boolean;
|
|
88
|
+
decorationsFor(block: string, region: string): readonly Decoration[];
|
|
89
|
+
dispatch(tr: Transaction): void;
|
|
90
|
+
edit(change: () => boolean): boolean;
|
|
91
|
+
afterRender(): void;
|
|
92
|
+
refreshHosts(): void;
|
|
93
|
+
run(command: Command): boolean;
|
|
94
|
+
announce(message: string): void;
|
|
95
|
+
renderHost(block: string, region: string): void;
|
|
96
|
+
domSelection(): globalThis.Selection | null;
|
|
97
|
+
syncSelectionToDom(local?: boolean): void;
|
|
98
|
+
readSelectionFromDom(): void;
|
|
99
|
+
focus(target?: FocusTarget): void;
|
|
100
|
+
setReadOnly(readOnly: boolean): void;
|
|
101
|
+
subscribeReadOnly(listener: () => void): () => void;
|
|
102
|
+
destroy(): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { type AtomRenderer as A, type KeyInterceptor as K, type RenderOptions as R, ViewController as V, type WidgetRenderer as W, type ViewControllerOptions as a, hostKey as h };
|
package/dist/view.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk6PKVJZQVcjs = require('./chunk-6PKVJZQV.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkEH5KXQXYcjs = require('./chunk-EH5KXQXY.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkBTBHHBVRcjs = require('./chunk-BTBHHBVR.cjs');
|
|
11
|
+
|
|
12
|
+
// src/view-static/QuoinView.tsx
|
|
13
|
+
var _react = require('react');
|
|
14
|
+
function QuoinView({ blocks, blockTypes, highlight, className, ...options }) {
|
|
15
|
+
const slots = /* @__PURE__ */ new Map();
|
|
16
|
+
const nodes = _chunkBTBHHBVRcjs.documentNodes.call(void 0, blocks, options, _chunk6PKVJZQVcjs.viewRenderer.call(void 0, { blockTypes, highlight }, slots));
|
|
17
|
+
return _react.createElement.call(void 0, "div", { className: className ? `quoin-view ${className}` : "quoin-view" }, ..._chunk6PKVJZQVcjs.reactNodes.call(void 0, nodes, slots));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.QuoinView = QuoinView; exports.defineBlock = _chunkEH5KXQXYcjs.defineBlock;
|
|
23
|
+
//# sourceMappingURL=view.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["view.cjs","../src/view-static/QuoinView.tsx"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACXA,8BAA8C;AAuCvC,SAAS,SAAA,CAAU,EAAE,MAAA,EAAQ,UAAA,EAAY,SAAA,EAAW,SAAA,EAAW,GAAG,QAAQ,CAAA,EAAmB;AAClG,EAAA,MAAM,MAAA,kBAAQ,IAAI,GAAA,CAA4B,CAAA;AAC9C,EAAA,MAAM,MAAA,EAAQ,6CAAA,MAAc,EAAQ,OAAA,EAAS,4CAAA,EAAe,UAAA,EAAY,UAAU,CAAA,EAAG,KAAK,CAAC,CAAA;AAC3F,EAAA,OAAO,kCAAA,KAAc,EAAO,EAAE,SAAA,EAAW,UAAA,EAAY,CAAA,WAAA,EAAc,SAAS,CAAA,EAAA;AAC9E;ADzB+E;AACA;AACA;AACA","file":"/home/runner/work/quoin-editor/quoin-editor/dist/view.cjs"}
|
package/dist/view.d.cts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { A as AnyBlockDefinition, C as CodeHighlighter } from './registry-CWBOSAHm.cjs';
|
|
3
|
+
export { B as BlockDefinition, d as defineBlock } from './registry-CWBOSAHm.cjs';
|
|
4
|
+
import { Q as QuoinBlock } from './types-DULc8wwg.cjs';
|
|
5
|
+
import { H as HTMLOptions } from './to-html-CNCITCln.cjs';
|
|
6
|
+
import './embed-provider-jXwlRmnp.cjs';
|
|
7
|
+
|
|
8
|
+
type QuoinViewProps = {
|
|
9
|
+
blocks: readonly QuoinBlock[];
|
|
10
|
+
/**
|
|
11
|
+
* The definitions of the host's own block types, each drawn by its `preview`. Called during a server render, so a
|
|
12
|
+
* preview of a React Server Component tree must use no client hooks. A type Quoin draws itself keeps Quoin's drawing.
|
|
13
|
+
*/
|
|
14
|
+
blockTypes?: readonly AnyBlockDefinition[];
|
|
15
|
+
/** The address of a stored picture or file. One that is no http, https, blob, data or relative address is left out. */
|
|
16
|
+
resolveAssetUrl?: HTMLOptions['resolveAssetUrl'];
|
|
17
|
+
/** Its markup is trusted and inserted as it is. */
|
|
18
|
+
renderMath?: HTMLOptions['renderMath'];
|
|
19
|
+
/** Highlights the code of code blocks; without it their code is plain text. */
|
|
20
|
+
highlight?: CodeHighlighter;
|
|
21
|
+
/** Embeds as links by default, or as sandboxed frames for the pages of known providers. */
|
|
22
|
+
embeds?: HTMLOptions['embeds'];
|
|
23
|
+
/** Tried before the built in providers, in order. Only used when `embeds` is `'iframe'`. */
|
|
24
|
+
embedProviders?: HTMLOptions['embedProviders'];
|
|
25
|
+
/** The title of a frame given its provider's name, the name itself by default. */
|
|
26
|
+
frameTitle?: HTMLOptions['frameTitle'];
|
|
27
|
+
/** The accessible name of a task checkbox whose item has no text, `'Task'` by default. */
|
|
28
|
+
taskLabel?: HTMLOptions['taskLabel'];
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A read-only document drawn with the HTML `toHTML` writes, as React elements. It uses no hook, effect or browser API,
|
|
33
|
+
* so it renders in a React Server Component and in a static export. Toggles are native `details`. A canvas that is
|
|
34
|
+
* read-only stays the interactive way to show a document in the browser.
|
|
35
|
+
*/
|
|
36
|
+
declare function QuoinView({ blocks, blockTypes, highlight, className, ...options }: QuoinViewProps): react.DetailedReactHTMLElement<{
|
|
37
|
+
className: string;
|
|
38
|
+
}, HTMLElement>;
|
|
39
|
+
|
|
40
|
+
export { AnyBlockDefinition, QuoinView, type QuoinViewProps };
|
package/dist/view.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { A as AnyBlockDefinition, C as CodeHighlighter } from './registry-CWBOSAHm.js';
|
|
3
|
+
export { B as BlockDefinition, d as defineBlock } from './registry-CWBOSAHm.js';
|
|
4
|
+
import { Q as QuoinBlock } from './types-DULc8wwg.js';
|
|
5
|
+
import { H as HTMLOptions } from './to-html-C5t7xyaM.js';
|
|
6
|
+
import './embed-provider-jXwlRmnp.js';
|
|
7
|
+
|
|
8
|
+
type QuoinViewProps = {
|
|
9
|
+
blocks: readonly QuoinBlock[];
|
|
10
|
+
/**
|
|
11
|
+
* The definitions of the host's own block types, each drawn by its `preview`. Called during a server render, so a
|
|
12
|
+
* preview of a React Server Component tree must use no client hooks. A type Quoin draws itself keeps Quoin's drawing.
|
|
13
|
+
*/
|
|
14
|
+
blockTypes?: readonly AnyBlockDefinition[];
|
|
15
|
+
/** The address of a stored picture or file. One that is no http, https, blob, data or relative address is left out. */
|
|
16
|
+
resolveAssetUrl?: HTMLOptions['resolveAssetUrl'];
|
|
17
|
+
/** Its markup is trusted and inserted as it is. */
|
|
18
|
+
renderMath?: HTMLOptions['renderMath'];
|
|
19
|
+
/** Highlights the code of code blocks; without it their code is plain text. */
|
|
20
|
+
highlight?: CodeHighlighter;
|
|
21
|
+
/** Embeds as links by default, or as sandboxed frames for the pages of known providers. */
|
|
22
|
+
embeds?: HTMLOptions['embeds'];
|
|
23
|
+
/** Tried before the built in providers, in order. Only used when `embeds` is `'iframe'`. */
|
|
24
|
+
embedProviders?: HTMLOptions['embedProviders'];
|
|
25
|
+
/** The title of a frame given its provider's name, the name itself by default. */
|
|
26
|
+
frameTitle?: HTMLOptions['frameTitle'];
|
|
27
|
+
/** The accessible name of a task checkbox whose item has no text, `'Task'` by default. */
|
|
28
|
+
taskLabel?: HTMLOptions['taskLabel'];
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A read-only document drawn with the HTML `toHTML` writes, as React elements. It uses no hook, effect or browser API,
|
|
33
|
+
* so it renders in a React Server Component and in a static export. Toggles are native `details`. A canvas that is
|
|
34
|
+
* read-only stays the interactive way to show a document in the browser.
|
|
35
|
+
*/
|
|
36
|
+
declare function QuoinView({ blocks, blockTypes, highlight, className, ...options }: QuoinViewProps): react.DetailedReactHTMLElement<{
|
|
37
|
+
className: string;
|
|
38
|
+
}, HTMLElement>;
|
|
39
|
+
|
|
40
|
+
export { AnyBlockDefinition, QuoinView, type QuoinViewProps };
|
package/dist/view.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
reactNodes,
|
|
3
|
+
viewRenderer
|
|
4
|
+
} from "./chunk-26Q4LSIU.js";
|
|
5
|
+
import {
|
|
6
|
+
defineBlock
|
|
7
|
+
} from "./chunk-O4Z2WMFF.js";
|
|
8
|
+
import {
|
|
9
|
+
documentNodes
|
|
10
|
+
} from "./chunk-62WKUAQY.js";
|
|
11
|
+
|
|
12
|
+
// src/view-static/QuoinView.tsx
|
|
13
|
+
import { createElement } from "react";
|
|
14
|
+
function QuoinView({ blocks, blockTypes, highlight, className, ...options }) {
|
|
15
|
+
const slots = /* @__PURE__ */ new Map();
|
|
16
|
+
const nodes = documentNodes(blocks, options, viewRenderer({ blockTypes, highlight }, slots));
|
|
17
|
+
return createElement("div", { className: className ? `quoin-view ${className}` : "quoin-view" }, ...reactNodes(nodes, slots));
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
QuoinView,
|
|
21
|
+
defineBlock
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=view.js.map
|
package/dist/view.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/view-static/QuoinView.tsx"],"mappings":";;;;;;;;;;;;AAAA,SAAS,qBAAqC;AAuCvC,SAAS,UAAU,EAAE,QAAQ,YAAY,WAAW,WAAW,GAAG,QAAQ,GAAmB;AAClG,QAAM,QAAQ,oBAAI,IAA4B;AAC9C,QAAM,QAAQ,cAAc,QAAQ,SAAS,aAAa,EAAE,YAAY,UAAU,GAAG,KAAK,CAAC;AAC3F,SAAO,cAAc,OAAO,EAAE,WAAW,YAAY,cAAc,SAAS,KAAK,aAAa,GAAG,GAAG,WAAW,OAAO,KAAK,CAAC;AAC9H;","names":[]}
|