@pnnh/atom 0.6.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/assets/client-DyjKaxG-.css +156 -0
- package/dist/assets/client.d-DyjKaxG-.css +156 -0
- package/dist/client.cjs +24752 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.ts +176 -0
- package/dist/client.mjs +24698 -0
- package/dist/client.mjs.map +1 -0
- package/dist/common.cjs +9275 -0
- package/dist/common.cjs.map +1 -0
- package/dist/common.d.ts +220 -0
- package/dist/common.mjs +9191 -0
- package/dist/common.mjs.map +1 -0
- package/dist/server.cjs +5235 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.ts +41 -0
- package/dist/server.mjs +5218 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +173 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { JSX, KeyboardEvent } from 'react';
|
|
3
|
+
import { Element, Text, Descendant, BaseEditor, Node } from 'slate';
|
|
4
|
+
import { ReactEditor } from 'slate-react';
|
|
5
|
+
|
|
6
|
+
declare function copyToClipboard(textToCopy: string): Promise<void>;
|
|
7
|
+
|
|
8
|
+
declare function htmlEncode(text: string): string;
|
|
9
|
+
declare function htmlDecode(text: string): string;
|
|
10
|
+
|
|
11
|
+
declare function clientMakeGet<T>(url: string): Promise<T>;
|
|
12
|
+
declare function clientMakePost<T>(url: string, params: unknown): Promise<T>;
|
|
13
|
+
declare function clientMakePut<T>(url: string, params: unknown): Promise<T>;
|
|
14
|
+
declare function clientMakeDelete<T>(url: string): Promise<T>;
|
|
15
|
+
|
|
16
|
+
declare function clientSetWindowVariable(key: string, value: any): void;
|
|
17
|
+
declare function clientGetWindowVariable(key: string): any;
|
|
18
|
+
|
|
19
|
+
declare class ButtonThrottle {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(duration?: number);
|
|
22
|
+
throttle(): Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
declare function buttonThrottle(duration?: number): Promise<unknown>;
|
|
25
|
+
|
|
26
|
+
declare function setCookie(name: string, value: string, seconds: number): void;
|
|
27
|
+
declare function getCookie(name: string): string | null;
|
|
28
|
+
declare function eraseCookie(name: string): void;
|
|
29
|
+
declare function clearCookies(): void;
|
|
30
|
+
|
|
31
|
+
declare function registerMailbox(component: IMailbox): void;
|
|
32
|
+
declare function unregisterMailbox(component: IMailbox): void;
|
|
33
|
+
interface IMail<T> {
|
|
34
|
+
subject: string;
|
|
35
|
+
content: T;
|
|
36
|
+
}
|
|
37
|
+
interface IMailbox {
|
|
38
|
+
getName(): string;
|
|
39
|
+
sendMail<T>(subject: string, content: T): unknown;
|
|
40
|
+
sendTypedMail<T>(mail: IMail<T>): unknown;
|
|
41
|
+
receiveMail<T>(subject: string): IMail<T> | undefined;
|
|
42
|
+
subscribe<T>(subject: string, callback: (mail: IMail<T>) => void): Symbol;
|
|
43
|
+
unsubscribe(stub: Symbol): void;
|
|
44
|
+
}
|
|
45
|
+
declare class ClientMailbox implements IMailbox {
|
|
46
|
+
private mailList;
|
|
47
|
+
private subscribers;
|
|
48
|
+
private readonly mailboxName;
|
|
49
|
+
constructor(mailboxName: string);
|
|
50
|
+
getName(): string;
|
|
51
|
+
sendMail<T>(subject: string, content: T): unknown;
|
|
52
|
+
sendTypedMail<T>(mail: IMail<T>): unknown;
|
|
53
|
+
receiveMail<T>(subject: string): IMail<T> | undefined;
|
|
54
|
+
subscribe<T>(subject: string, callback: (mail: IMail<T>) => void): Symbol;
|
|
55
|
+
unsubscribe(stub: Symbol): void;
|
|
56
|
+
}
|
|
57
|
+
declare function createClientMailbox(name: string): ClientMailbox;
|
|
58
|
+
|
|
59
|
+
interface SFEditorModel {
|
|
60
|
+
children: SFDescendant[];
|
|
61
|
+
}
|
|
62
|
+
interface SFElement extends Element {
|
|
63
|
+
name: string;
|
|
64
|
+
children: SFDescendant[];
|
|
65
|
+
}
|
|
66
|
+
interface SFText extends Text {
|
|
67
|
+
name: string;
|
|
68
|
+
}
|
|
69
|
+
declare type SFDescendant = SFElement | SFText;
|
|
70
|
+
declare function parseDescendantArray(descendants: Descendant[]): SFDescendant[];
|
|
71
|
+
declare function parseDescendant(descendant: Descendant): SFDescendant;
|
|
72
|
+
declare function parseElement(descendant: Descendant): SFElement;
|
|
73
|
+
declare function parseText(descendant: Descendant): SFText;
|
|
74
|
+
interface SFPlugin {
|
|
75
|
+
renderToolbox(element: SFElement): JSX.Element;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare const CodeBlockName = "code-block";
|
|
79
|
+
declare const CodeName = "code";
|
|
80
|
+
interface SFCodeBlockNode extends Element {
|
|
81
|
+
name: string;
|
|
82
|
+
children: SFCode[];
|
|
83
|
+
language: string;
|
|
84
|
+
}
|
|
85
|
+
interface SFCode extends Text {
|
|
86
|
+
name: string;
|
|
87
|
+
}
|
|
88
|
+
declare function NewCodeNode(text: string): SFCode;
|
|
89
|
+
declare function NewCodeBlockNode(language: string, text: string): SFCodeBlockNode;
|
|
90
|
+
declare function SFCodeBlockView(props: {
|
|
91
|
+
attributes: any;
|
|
92
|
+
children: any;
|
|
93
|
+
node: SFCodeBlockNode;
|
|
94
|
+
}): react_jsx_runtime.JSX.Element;
|
|
95
|
+
declare function isCodeBlockActive(editor: BaseEditor, isActive: (node: any) => boolean): boolean;
|
|
96
|
+
declare function SFCodeBlockLeafView(props: {
|
|
97
|
+
attributes: any;
|
|
98
|
+
children: any;
|
|
99
|
+
node: any;
|
|
100
|
+
}): react_jsx_runtime.JSX.Element;
|
|
101
|
+
declare function SFCodeBlockToolbar(props: {
|
|
102
|
+
node: Node;
|
|
103
|
+
}): react_jsx_runtime.JSX.Element;
|
|
104
|
+
|
|
105
|
+
interface SFHeaderNode extends SFElement {
|
|
106
|
+
header: number;
|
|
107
|
+
}
|
|
108
|
+
declare const HeaderName = "header";
|
|
109
|
+
declare function NewHeaderNode(header: number, text: string): SFHeaderNode;
|
|
110
|
+
declare function isHeaderBlockActive(editor: BaseEditor, isActive: (node: any) => boolean): boolean;
|
|
111
|
+
declare function SFHeaderToolbar(props: {
|
|
112
|
+
node: Node;
|
|
113
|
+
}): react_jsx_runtime.JSX.Element;
|
|
114
|
+
declare function SFHeaderActions(): react_jsx_runtime.JSX.Element;
|
|
115
|
+
declare function SFHeaderView(props: {
|
|
116
|
+
attributes: any;
|
|
117
|
+
children: any;
|
|
118
|
+
node: SFHeaderNode;
|
|
119
|
+
}): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
declare const ParagraphName = "paragraph";
|
|
122
|
+
declare function SFParagraphToolbar(props: {
|
|
123
|
+
disabled: boolean;
|
|
124
|
+
node: SFParagraphNode;
|
|
125
|
+
}): react_jsx_runtime.JSX.Element;
|
|
126
|
+
declare function SFParagraphActions(props: {
|
|
127
|
+
node: SFParagraphNode;
|
|
128
|
+
}): react_jsx_runtime.JSX.Element;
|
|
129
|
+
interface SFParagraphNode extends Element {
|
|
130
|
+
name: string;
|
|
131
|
+
children: SFText[];
|
|
132
|
+
}
|
|
133
|
+
declare function NewParagraphNode(text: string): SFParagraphNode;
|
|
134
|
+
declare function SFParagraphView(props: {
|
|
135
|
+
attributes: any;
|
|
136
|
+
children: any;
|
|
137
|
+
node: SFParagraphNode;
|
|
138
|
+
}): react_jsx_runtime.JSX.Element;
|
|
139
|
+
declare function ParagraphOnKeyDown(editor: BaseEditor, event: KeyboardEvent<HTMLParagraphElement>): void;
|
|
140
|
+
declare function isParagraphBlockActive(editor: BaseEditor, isActive: (node: any) => boolean): boolean;
|
|
141
|
+
|
|
142
|
+
declare const QuoteBlockName = "quote-block";
|
|
143
|
+
declare function SFQuoteBlockToolbar(props: {
|
|
144
|
+
node: SFQuoteBlockNode;
|
|
145
|
+
}): react_jsx_runtime.JSX.Element;
|
|
146
|
+
interface SFQuoteBlockNode extends Element {
|
|
147
|
+
name: string;
|
|
148
|
+
children: SFText[];
|
|
149
|
+
}
|
|
150
|
+
declare function NewQuoteBlockNode(text: string): SFQuoteBlockNode;
|
|
151
|
+
declare function SFQuoteBlockView(props: {
|
|
152
|
+
attributes: any;
|
|
153
|
+
children: any;
|
|
154
|
+
node: SFQuoteBlockNode;
|
|
155
|
+
}): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
157
|
+
declare const TextName = "text";
|
|
158
|
+
declare function NewTextNode(text: string): SFText;
|
|
159
|
+
declare function SFTextView(props: {
|
|
160
|
+
attributes: any;
|
|
161
|
+
children: any;
|
|
162
|
+
node: SFText;
|
|
163
|
+
}): react_jsx_runtime.JSX.Element;
|
|
164
|
+
|
|
165
|
+
declare function SFXEditor({ lang, value, onChange }: {
|
|
166
|
+
lang: string;
|
|
167
|
+
value: SFEditorModel;
|
|
168
|
+
onChange: (value: SFEditorModel) => void;
|
|
169
|
+
}): react_jsx_runtime.JSX.Element;
|
|
170
|
+
|
|
171
|
+
declare function selectNodeLast(editor: ReactEditor, node: Node): void;
|
|
172
|
+
|
|
173
|
+
declare function atomClientHello(): Promise<string>;
|
|
174
|
+
|
|
175
|
+
export { ButtonThrottle, CodeBlockName, CodeName, HeaderName, NewCodeBlockNode, NewCodeNode, NewHeaderNode, NewParagraphNode, NewQuoteBlockNode, NewTextNode, ParagraphName, ParagraphOnKeyDown, QuoteBlockName, SFCodeBlockLeafView, SFCodeBlockToolbar, SFCodeBlockView, SFHeaderActions, SFHeaderToolbar, SFHeaderView, SFParagraphActions, SFParagraphToolbar, SFParagraphView, SFQuoteBlockToolbar, SFQuoteBlockView, SFTextView, SFXEditor, TextName, atomClientHello, buttonThrottle, clearCookies, clientGetWindowVariable, clientMakeDelete, clientMakeGet, clientMakePost, clientMakePut, clientSetWindowVariable, copyToClipboard, createClientMailbox, eraseCookie, getCookie, htmlDecode, htmlEncode, isCodeBlockActive, isHeaderBlockActive, isParagraphBlockActive, parseDescendant, parseDescendantArray, parseElement, parseText, registerMailbox, selectNodeLast, setCookie, unregisterMailbox };
|
|
176
|
+
export type { IMail, IMailbox, SFCode, SFCodeBlockNode, SFDescendant, SFEditorModel, SFElement, SFHeaderNode, SFParagraphNode, SFPlugin, SFQuoteBlockNode, SFText };
|