web-toolkit-x 0.0.1 → 0.71.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 (46) hide show
  1. package/AUTHORS +3 -0
  2. package/LICENSE +1 -1
  3. package/NOTICE +7 -0
  4. package/README.md +169 -6
  5. package/dist/release/global.d.ts +10 -0
  6. package/dist/release/index.d.ts +650 -0
  7. package/dist/release/index.d.ts.map +1 -0
  8. package/dist/release/index.js +2837 -0
  9. package/dist/release/index.js.map +1 -0
  10. package/dist/release/toolkit-0.71.0.js +2840 -0
  11. package/dist/release/toolkit-0.71.0.js.map +1 -0
  12. package/package.json +75 -18
  13. package/src/core/bragi.ts +122 -0
  14. package/src/core/browser.ts +555 -0
  15. package/src/core/child-nodes.ts +77 -0
  16. package/src/core/comment.ts +24 -0
  17. package/src/core/component.ts +190 -0
  18. package/src/core/created-roots.ts +38 -0
  19. package/src/core/custom-element.ts +191 -0
  20. package/src/core/description.ts +241 -0
  21. package/src/core/diff.ts +590 -0
  22. package/src/core/dispatcher.ts +221 -0
  23. package/src/core/dom.ts +124 -0
  24. package/src/core/draft.ts +609 -0
  25. package/src/core/lifecycle.ts +301 -0
  26. package/src/core/nodes.ts +13 -0
  27. package/src/core/patch.ts +412 -0
  28. package/src/core/plugins.ts +231 -0
  29. package/src/core/reconciler.ts +185 -0
  30. package/src/core/renderer.ts +75 -0
  31. package/src/core/runtime.ts +36 -0
  32. package/src/core/sandbox.ts +128 -0
  33. package/src/core/service.ts +39 -0
  34. package/src/core/template.ts +472 -0
  35. package/src/core/text.ts +24 -0
  36. package/src/core/toolkit.ts +220 -0
  37. package/src/core/utils.ts +148 -0
  38. package/src/core/virtual-dom.ts +118 -0
  39. package/src/core/virtual-element.ts +72 -0
  40. package/src/core/virtual-node.ts +87 -0
  41. package/src/core/web-component.ts +285 -0
  42. package/src/global.d.ts +10 -0
  43. package/src/index.ts +62 -0
  44. package/src/plugins/logger.ts +38 -0
  45. package/src/release.ts +3 -0
  46. package/index.js +0 -1
@@ -0,0 +1,650 @@
1
+ //#region src/core/description.d.ts
2
+ type Props = Record<string, unknown>;
3
+ type Listener$1 = ((event: Event) => unknown) & {
4
+ source?: unknown;
5
+ };
6
+ type NodeDescription = ComponentDescription | ElementDescription | CommentDescription | TextDescription;
7
+ type NormalizedTemplate = unknown[] | string | null;
8
+ declare abstract class Description {
9
+ static ElementDescription: typeof ElementDescription;
10
+ static ComponentDescription: typeof ComponentDescription;
11
+ static CommentDescription: typeof CommentDescription;
12
+ static TextDescription: typeof TextDescription;
13
+ key?: string;
14
+ children?: NodeDescription[];
15
+ abstract get asTemplate(): NormalizedTemplate;
16
+ get childrenAsTemplates(): NormalizedTemplate[] | undefined;
17
+ isCompatible(description: Description): boolean;
18
+ }
19
+ declare class ComponentDescription extends Description {
20
+ component: ComponentClass;
21
+ type: 'component';
22
+ props?: Props;
23
+ attrs?: Record<string, string>;
24
+ constructor(component: ComponentClass);
25
+ isCompatible(description: Description): boolean;
26
+ get isRoot(): boolean;
27
+ get asTemplate(): unknown[];
28
+ }
29
+ declare class ElementDescription extends Description {
30
+ name: string;
31
+ type: 'element';
32
+ class?: string;
33
+ style?: Record<string, string>;
34
+ attrs?: Record<string, string>;
35
+ dataset?: Record<string, string>;
36
+ listeners?: Record<string, Listener$1>;
37
+ properties?: Record<string, unknown>;
38
+ custom?: {
39
+ attrs?: Record<string, string>;
40
+ listeners?: Record<string, Listener$1>;
41
+ };
42
+ constructor(name: string);
43
+ isCompatible(description: Description): boolean;
44
+ get asTemplate(): unknown[];
45
+ }
46
+ declare class CommentDescription extends Description {
47
+ text: string;
48
+ type: 'comment';
49
+ constructor(text: string);
50
+ get asTemplate(): null;
51
+ isCompatible(description: Description): boolean;
52
+ }
53
+ declare class TextDescription extends Description {
54
+ text: string;
55
+ type: 'text';
56
+ constructor(text: string);
57
+ get asTemplate(): string;
58
+ isCompatible(description: Description): boolean;
59
+ }
60
+ //#endregion
61
+ //#region src/core/comment.d.ts
62
+ declare class Comment extends VirtualNode {
63
+ static NodeType: string;
64
+ description: CommentDescription;
65
+ ref: globalThis.Comment;
66
+ constructor(description: CommentDescription, parentNode?: VirtualNode);
67
+ get nodeType(): string;
68
+ attachDOM(): void;
69
+ }
70
+ //#endregion
71
+ //#region src/core/browser.d.ts
72
+ type EventName = 'onAbort' | 'onAfterPrint' | 'onAnimationCancel' | 'onAnimationEnd' | 'onAnimationIteration' | 'onAnimationStart' | 'onAppInstalled' | 'onAuxClick' | 'onBeforeCopy' | 'onBeforeCut' | 'onBeforeInput' | 'onBeforeInstallPrompt' | 'onBeforeMatch' | 'onBeforePaste' | 'onBeforePrint' | 'onBeforeToggle' | 'onBeforeUnload' | 'onBeforeXRSelect' | 'onBlur' | 'onCancel' | 'onCanPlay' | 'onCanPlayThrough' | 'onChange' | 'onClick' | 'onClose' | 'onCommand' | 'onCompositionEnd' | 'onCompositionStart' | 'onCompositionUpdate' | 'onContentVisibilityAutoStateChange' | 'onContextLost' | 'onContextMenu' | 'onContextRestored' | 'onCopy' | 'onCueChange' | 'onCut' | 'onDblClick' | 'onDeviceMotion' | 'onDeviceOrientation' | 'onDeviceOrientationAbsolute' | 'onDoubleClick' | 'onDrag' | 'onDragEnd' | 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDragStart' | 'onDrop' | 'onDurationChange' | 'onEmptied' | 'onEncrypted' | 'onEnded' | 'onEnterPictureInPicture' | 'onError' | 'onFocus' | 'onFormData' | 'onFreeze' | 'onFullscreenChange' | 'onFullscreenError' | 'onGamepadConnected' | 'onGamepadDisconnected' | 'onGotPointerCapture' | 'onHashChange' | 'onInput' | 'onInvalid' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onLanguageChange' | 'onLeavePictureInPicture' | 'onLoad' | 'onLoadedData' | 'onLoadedMetadata' | 'onLoadStart' | 'onLostPointerCapture' | 'onMessage' | 'onMessageError' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseMove' | 'onMouseOut' | 'onMouseOver' | 'onMouseUp' | 'onMouseWheel' | 'onOffline' | 'onOnline' | 'onPageHide' | 'onPageReveal' | 'onPageShow' | 'onPageSwap' | 'onPaste' | 'onPause' | 'onPlay' | 'onPlaying' | 'onPointerCancel' | 'onPointerDown' | 'onPointerEnter' | 'onPointerLeave' | 'onPointerLockChange' | 'onPointerLockError' | 'onPointerMove' | 'onPointerOut' | 'onPointerOver' | 'onPointerRawUpdate' | 'onPointerUp' | 'onPopState' | 'onPrerenderingChange' | 'onProgress' | 'onRateChange' | 'onReadyStateChange' | 'onRejectionHandled' | 'onReset' | 'onResize' | 'onResume' | 'onScroll' | 'onScrollEnd' | 'onScrollSnapChange' | 'onScrollSnapChanging' | 'onSearch' | 'onSecurityPolicyViolation' | 'onSeeked' | 'onSeeking' | 'onSelect' | 'onSelectionChange' | 'onSelectStart' | 'onSlotChange' | 'onStalled' | 'onStorage' | 'onSubmit' | 'onSuspend' | 'onTimeUpdate' | 'onToggle' | 'onTouchCancel' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart' | 'onTransitionCancel' | 'onTransitionEnd' | 'onTransitionRun' | 'onTransitionStart' | 'onUnhandledRejection' | 'onUnload' | 'onVisibilityChange' | 'onVolumeChange' | 'onWaiting' | 'onWaitingForKey' | 'onWebkitAnimationEnd' | 'onWebkitAnimationIteration' | 'onWebkitAnimationStart' | 'onWebkitFullscreenChange' | 'onWebkitFullscreenError' | 'onWebkitTransitionEnd' | 'onWheel';
73
+ type AttributeName = 'abbr' | 'accept' | 'acceptCharset' | 'accessKey' | 'action' | 'adAuctionHeaders' | 'align' | 'aLink' | 'allow' | 'allowFullscreen' | 'allowFullScreen' | 'allowPaymentRequest' | 'alt' | 'archive' | 'ariaActions' | 'ariaActiveDescendant' | 'ariaAtomic' | 'ariaAutoComplete' | 'ariaBrailleLabel' | 'ariaBrailleRoleDescription' | 'ariaBusy' | 'ariaChecked' | 'ariaColCount' | 'ariaColIndex' | 'ariaColIndexText' | 'ariaColSpan' | 'ariaControls' | 'ariaCurrent' | 'ariaDescribedBy' | 'ariaDescription' | 'ariaDetails' | 'ariaDisabled' | 'ariaErrorMessage' | 'ariaExpanded' | 'ariaFlowTo' | 'ariaHasPopup' | 'ariaHidden' | 'ariaInvalid' | 'ariaKeyShortcuts' | 'ariaLabel' | 'ariaLabelledBy' | 'ariaLabelLedBy' | 'ariaLevel' | 'ariaLive' | 'ariaModal' | 'ariaMultiLine' | 'ariaMultiSelectable' | 'ariaOrientation' | 'ariaOwns' | 'ariaPlaceholder' | 'ariaPosInSet' | 'ariaPressed' | 'ariaReadOnly' | 'ariaRelevant' | 'ariaRequired' | 'ariaRoleDescription' | 'ariaRowCount' | 'ariaRowIndex' | 'ariaRowIndexText' | 'ariaRowSpan' | 'ariaSelected' | 'ariaSetSize' | 'ariaSort' | 'ariaValueMax' | 'ariaValueMin' | 'ariaValueNow' | 'ariaValueText' | 'as' | 'async' | 'attributionSrc' | 'autoCapitalize' | 'autoComplete' | 'autoCorrect' | 'autoFocus' | 'autoPlay' | 'axis' | 'background' | 'bgColor' | 'blocking' | 'border' | 'browsingTopics' | 'cellPadding' | 'cellSpacing' | 'charset' | 'checked' | 'cite' | 'clear' | 'closedBy' | 'code' | 'codeBase' | 'codeType' | 'color' | 'cols' | 'colSpan' | 'command' | 'commandFor' | 'compact' | 'content' | 'contentEditable' | 'controls' | 'coords' | 'credentialless' | 'crossOrigin' | 'csp' | 'data' | 'dateTime' | 'declare' | 'decoding' | 'default' | 'defer' | 'dir' | 'dirName' | 'disabled' | 'disablePictureInPicture' | 'disableRemotePlayback' | 'download' | 'draggable' | 'elementTiming' | 'encoding' | 'encType' | 'enterKeyHint' | 'event' | 'fetchPriority' | 'focusGroupStart' | 'for' | 'form' | 'formAction' | 'formEnctype' | 'formMethod' | 'formNoValidate' | 'formTarget' | 'frame' | 'frameBorder' | 'headers' | 'height' | 'hidden' | 'high' | 'href' | 'hrefLang' | 'hspace' | 'httpEquiv' | 'id' | 'imageSizes' | 'imageSrcset' | 'incremental' | 'inert' | 'inputMode' | 'integrity' | 'interestFor' | 'is' | 'isMap' | 'itemProp' | 'kind' | 'label' | 'lang' | 'link' | 'list' | 'loading' | 'longDesc' | 'loop' | 'low' | 'lowSrc' | 'marginHeight' | 'marginWidth' | 'max' | 'maxLength' | 'media' | 'method' | 'min' | 'minLength' | 'multiple' | 'muted' | 'name' | 'noHref' | 'noModule' | 'nonce' | 'noShade' | 'noValidate' | 'noWrap' | 'open' | 'optimum' | 'part' | 'pattern' | 'ping' | 'placeholder' | 'playsInline' | 'popover' | 'popoverTarget' | 'popoverTargetAction' | 'poster' | 'preload' | 'privateToken' | 'readOnly' | 'referrerPolicy' | 'rel' | 'required' | 'rev' | 'reversed' | 'role' | 'rows' | 'rowSpan' | 'rules' | 'sandbox' | 'scheme' | 'scope' | 'scrolling' | 'selected' | 'shadowRootClonable' | 'shadowRootCustomElementRegistry' | 'shadowRootDelegatesFocus' | 'shadowRootMode' | 'shadowRootReferenceTarget' | 'shadowRootSerializable' | 'shadowRootSlotAssignment' | 'shape' | 'size' | 'sizes' | 'slot' | 'span' | 'spellCheck' | 'src' | 'srcDoc' | 'srcLang' | 'srcSet' | 'standby' | 'start' | 'step' | 'summary' | 'tabIndex' | 'target' | 'title' | 'translate' | 'type' | 'useMap' | 'vAlign' | 'value' | 'version' | 'virtualKeyboardPolicy' | 'vLink' | 'vspace' | 'webkitDirectory' | 'width' | 'wrap' | 'writingSuggestions';
74
+ type FilterName = 'blur' | 'brightness' | 'contrast' | 'dropShadow' | 'grayscale' | 'hueRotate' | 'invert' | 'opacity' | 'saturate' | 'sepia' | 'url';
75
+ type TransformName = 'matrix' | 'matrix3d' | 'translate' | 'translate3d' | 'translateX' | 'translateY' | 'translateZ' | 'scale' | 'scale3d' | 'scaleX' | 'scaleY' | 'scaleZ' | 'rotate' | 'rotate3d' | 'rotateX' | 'rotateY' | 'rotateZ' | 'skew' | 'skewX' | 'skewY' | 'perspective';
76
+ //#endregion
77
+ //#region src/core/bragi.d.ts
78
+ type AttributeValue = string | number | bigint | boolean | null | undefined | ReadonlyArray<string | number>;
79
+ type ClassName = string | false | null | undefined | readonly ClassName[] | {
80
+ readonly [name: string]: unknown;
81
+ };
82
+ type StyleValue = string | number | boolean | null | undefined | ReadonlyArray<string | number>;
83
+ type FunctionList<Name extends string> = { readonly [F in Name]?: AttributeValue; };
84
+ type CSSPropertyName = { [K in keyof CSSStyleDeclaration]: K extends string ? CSSStyleDeclaration[K] extends string ? K : never : never; }[keyof CSSStyleDeclaration];
85
+ type Style = { readonly [P in Exclude<CSSPropertyName, 'filter' | 'transform'>]?: StyleValue; } & { readonly [P in `--${string}`]?: StyleValue; } & {
86
+ readonly filter?: StyleValue | FunctionList<FilterName>;
87
+ readonly transform?: StyleValue | FunctionList<TransformName>;
88
+ };
89
+ type DOMEventName<N extends string> = N extends 'onDoubleClick' ? 'dblclick' : N extends `on${infer E}` ? Lowercase<E> : never;
90
+ type Listener<E extends Event = Event> = (event: E) => unknown;
91
+ type EventListenerFor<N extends EventName> = Listener<DOMEventName<N> extends keyof HTMLElementEventMap ? HTMLElementEventMap[DOMEventName<N>] : Event>;
92
+ type SpecialProps = {
93
+ readonly key?: string | number;
94
+ readonly class?: ClassName;
95
+ readonly style?: Style;
96
+ readonly dataset?: {
97
+ readonly [name: string]: AttributeValue;
98
+ };
99
+ readonly properties?: {
100
+ readonly [name: string]: unknown;
101
+ };
102
+ readonly attrs?: {
103
+ readonly [name: string]: AttributeValue;
104
+ };
105
+ readonly on?: {
106
+ readonly [event: string]: Listener | null | false | undefined;
107
+ };
108
+ };
109
+ type AttributeProps = { readonly [A in Exclude<AttributeName, keyof SpecialProps>]?: AttributeValue; };
110
+ type ListenerProps = { readonly [E in EventName]?: EventListenerFor<E> | null | false | undefined; };
111
+ type ElementProps = SpecialProps & AttributeProps & ListenerProps;
112
+ type TagName = keyof HTMLElementTagNameMap | (string & {});
113
+ type Child = Template | string | number | true | null | false;
114
+ type ElementTemplate = readonly [TagName, ...Child[]] | readonly [TagName, ElementProps, ...Child[]];
115
+ type PureComponent = (props: never) => RenderResult;
116
+ type ComponentType = typeof Component<object> | PureComponent;
117
+ type ComponentTemplate = readonly [ComponentType, ...Child[]] | readonly [ComponentType, Props, ...Child[]];
118
+ type Template = ComponentTemplate | ElementTemplate | null | false;
119
+ type RenderResult = Template | undefined;
120
+ //#endregion
121
+ //#region src/core/utils.d.ts
122
+ type AnyFunction = (...args: any[]) => unknown;
123
+ declare const Utils: {
124
+ throttle: <T extends AnyFunction>(fn: T, wait?: number, delayFirstEvent?: boolean) => (this: unknown, ...args: Parameters<T>) => unknown;
125
+ debounce: <T extends AnyFunction>(fn: T, wait?: number, leading?: boolean) => (this: unknown, ...args: Parameters<T>) => unknown;
126
+ createUUID: () => string;
127
+ postRender: (fn: FrameRequestCallback) => void;
128
+ };
129
+ //#endregion
130
+ //#region src/core/dispatcher.d.ts
131
+ type State = Record<string, unknown>;
132
+ type StateUpdate<S = State> = (state: S) => S;
133
+ type CommandMethod<S> = (this: S, ...args: any[]) => void;
134
+ type CommandsAPI<S = any> = Record<string, CommandMethod<S>>;
135
+ type Commands<S = State> = {
136
+ update(overrides: Partial<S>): Promise<boolean>;
137
+ replace(state: S): Promise<boolean>;
138
+ };
139
+ type BoundCommands<C extends CommandsAPI> = { [K in keyof C]: (...args: Parameters<C[K]>) => Promise<boolean>; };
140
+ declare class Command {
141
+ name: string;
142
+ args: unknown[];
143
+ update: StateUpdate;
144
+ resolve?: (executed: boolean) => void;
145
+ reject?: (error: unknown) => void;
146
+ constructor(name: string, args: unknown[], update: StateUpdate);
147
+ invoke(state: State | undefined): State;
148
+ }
149
+ declare class Dispatcher {
150
+ mode: symbol;
151
+ queue: Command[];
152
+ isFlushing: boolean;
153
+ root: WebComponent;
154
+ api: CommandsAPI;
155
+ commands: Commands & Record<string, AnyFunction>;
156
+ names: string[];
157
+ ignoreIncoming(): void;
158
+ constructor(root: WebComponent);
159
+ createCommand(name: string, args: unknown[]): Command;
160
+ issue(name: string, args: unknown[]): Promise<boolean>;
161
+ /**
162
+ * Sets the state right away, when the root is rendered or receives
163
+ * new props from its parent.
164
+ */
165
+ setState(state: State): void;
166
+ /**
167
+ * Updates the root with the state calculated by the commands in turn.
168
+ */
169
+ execute(commands: Command[]): void;
170
+ /**
171
+ * Executes the queued commands, followed by the ones issued in lifecycle
172
+ * methods in turn, until there are none left. When an update fails, its
173
+ * commands reject, and the ones issued in its lifecycle methods are still
174
+ * executed, as the update is completed.
175
+ */
176
+ flush(): void;
177
+ }
178
+ //#endregion
179
+ //#region src/core/sandbox.d.ts
180
+ type ComponentSandbox = Omit<Component, 'children'> & {
181
+ props: Props;
182
+ children: unknown[];
183
+ };
184
+ //#endregion
185
+ //#region src/core/patch.d.ts
186
+ type PatchTarget = VirtualNode & {
187
+ ref: HTMLElement;
188
+ };
189
+ type Patch = {
190
+ type: 'init-root-component';
191
+ root: WebComponent;
192
+ } | {
193
+ type: 'update-node';
194
+ node: VirtualNode;
195
+ prevDescription: NodeDescription;
196
+ description: NodeDescription;
197
+ } | {
198
+ type: 'update-root';
199
+ root: WebComponent;
200
+ description: ComponentDescription;
201
+ } | {
202
+ type: 'set-attribute';
203
+ name: string;
204
+ value: string;
205
+ target: PatchTarget;
206
+ isCustom: boolean;
207
+ } | {
208
+ type: 'remove-attribute';
209
+ name: string;
210
+ target: PatchTarget;
211
+ isCustom: boolean;
212
+ } | {
213
+ type: 'set-data-attribute';
214
+ name: string;
215
+ value: string;
216
+ target: PatchTarget;
217
+ } | {
218
+ type: 'remove-data-attribute';
219
+ name: string;
220
+ target: PatchTarget;
221
+ } | {
222
+ type: 'set-style-property';
223
+ property: string;
224
+ value: string;
225
+ target: PatchTarget;
226
+ } | {
227
+ type: 'remove-style-property';
228
+ property: string;
229
+ target: PatchTarget;
230
+ } | {
231
+ type: 'set-class-name';
232
+ className: string;
233
+ target: PatchTarget;
234
+ } | {
235
+ type: 'add-listener';
236
+ name: string;
237
+ listener: Listener$1;
238
+ target: PatchTarget;
239
+ isCustom: boolean;
240
+ } | {
241
+ type: 'replace-listener';
242
+ name: string;
243
+ removed: Listener$1;
244
+ added: Listener$1;
245
+ target: PatchTarget;
246
+ isCustom: boolean;
247
+ } | {
248
+ type: 'remove-listener';
249
+ name: string;
250
+ listener: Listener$1;
251
+ target: PatchTarget;
252
+ isCustom: boolean;
253
+ } | {
254
+ type: 'set-property';
255
+ key: string;
256
+ value: unknown;
257
+ target: PatchTarget;
258
+ } | {
259
+ type: 'delete-property';
260
+ key: string;
261
+ target: PatchTarget;
262
+ } | {
263
+ type: 'insert-child';
264
+ node: VirtualNode;
265
+ at: number;
266
+ parent: ParentVirtualNode;
267
+ } | {
268
+ type: 'replace-child';
269
+ child: VirtualNode;
270
+ node: VirtualNode;
271
+ parent: ParentVirtualNode;
272
+ } | {
273
+ type: 'move-child';
274
+ child: VirtualNode;
275
+ from: number;
276
+ to: number;
277
+ parent: ParentVirtualNode;
278
+ } | {
279
+ type: 'remove-child';
280
+ child: VirtualNode;
281
+ at: number;
282
+ parent: ParentVirtualNode;
283
+ } | {
284
+ type: 'set-content';
285
+ node: VirtualNode;
286
+ child: VirtualNode;
287
+ parent: Component;
288
+ };
289
+ type PatchOf<T extends Patch['type']> = Extract<Patch, {
290
+ type: T;
291
+ }>;
292
+ declare const Patch: {
293
+ Type: {
294
+ readonly INIT_ROOT_COMPONENT: "init-root-component";
295
+ readonly UPDATE_NODE: "update-node";
296
+ readonly UPDATE_ROOT: "update-root";
297
+ readonly SET_ATTRIBUTE: "set-attribute";
298
+ readonly REMOVE_ATTRIBUTE: "remove-attribute";
299
+ readonly SET_DATA_ATTRIBUTE: "set-data-attribute";
300
+ readonly REMOVE_DATA_ATTRIBUTE: "remove-data-attribute";
301
+ readonly SET_STYLE_PROPERTY: "set-style-property";
302
+ readonly REMOVE_STYLE_PROPERTY: "remove-style-property";
303
+ readonly SET_CLASS_NAME: "set-class-name";
304
+ readonly ADD_LISTENER: "add-listener";
305
+ readonly REPLACE_LISTENER: "replace-listener";
306
+ readonly REMOVE_LISTENER: "remove-listener";
307
+ readonly SET_PROPERTY: "set-property";
308
+ readonly DELETE_PROPERTY: "delete-property";
309
+ readonly INSERT_CHILD: "insert-child";
310
+ readonly REPLACE_CHILD: "replace-child";
311
+ readonly MOVE_CHILD: "move-child";
312
+ readonly REMOVE_CHILD: "remove-child";
313
+ readonly SET_CONTENT: "set-content";
314
+ };
315
+ /**
316
+ * Applies the change to the virtual and rendered DOM.
317
+ */
318
+ apply(patch: Patch): void;
319
+ initRootComponent(root: WebComponent): PatchOf<"init-root-component">;
320
+ updateNode(node: VirtualNode, description: NodeDescription): PatchOf<"update-node">;
321
+ updateRoot(root: WebComponent, description: ComponentDescription): PatchOf<"update-root">;
322
+ insertChild(node: VirtualNode, at: number, parent: ParentVirtualNode): PatchOf<"insert-child">;
323
+ moveChild(child: VirtualNode, from: number, to: number, parent: ParentVirtualNode): PatchOf<"move-child">;
324
+ replaceChild(child: VirtualNode, node: VirtualNode, parent: ParentVirtualNode): PatchOf<"replace-child">;
325
+ removeChild(child: VirtualNode, at: number, parent: ParentVirtualNode): PatchOf<"remove-child">;
326
+ setContent(node: VirtualNode, parent: Component): PatchOf<"set-content">;
327
+ setAttribute(name: string, value: string, target: VirtualElement | WebComponent, isCustom: boolean): PatchOf<"set-attribute">;
328
+ removeAttribute(name: string, target: VirtualElement | WebComponent, isCustom: boolean): PatchOf<"remove-attribute">;
329
+ setDataAttribute(name: string, value: string, target: VirtualElement): PatchOf<"set-data-attribute">;
330
+ removeDataAttribute(name: string, target: VirtualElement): PatchOf<"remove-data-attribute">;
331
+ setStyleProperty(property: string, value: string, target: VirtualElement): PatchOf<"set-style-property">;
332
+ removeStyleProperty(property: string, target: VirtualElement): PatchOf<"remove-style-property">;
333
+ setClassName(className: string, target: VirtualElement): PatchOf<"set-class-name">;
334
+ addListener(name: string, listener: Listener$1, target: VirtualElement, isCustom: boolean): PatchOf<"add-listener">;
335
+ replaceListener(name: string, removed: Listener$1, added: Listener$1, target: VirtualElement, isCustom: boolean): PatchOf<"replace-listener">;
336
+ removeListener(name: string, listener: Listener$1, target: VirtualElement, isCustom: boolean): PatchOf<"remove-listener">;
337
+ setProperty(key: string, value: unknown, target: VirtualElement): PatchOf<"set-property">;
338
+ deleteProperty(key: string, target: VirtualElement): PatchOf<"delete-property">;
339
+ };
340
+ //#endregion
341
+ //#region src/core/renderer.d.ts
342
+ interface Update {
343
+ commands: Command[];
344
+ root: WebComponent;
345
+ state: {
346
+ from: State | undefined;
347
+ to: State;
348
+ };
349
+ patches?: Patch[];
350
+ }
351
+ //#endregion
352
+ //#region src/core/plugins.d.ts
353
+ interface PluginSandbox {
354
+ registerMethod?(name: string): void;
355
+ }
356
+ interface PluginManifest {
357
+ name: string;
358
+ permissions?: string[];
359
+ register?(sandbox: PluginSandbox): void;
360
+ install?(root: WebComponent): () => void;
361
+ onBeforeUpdate?(update: Update): void;
362
+ onAfterUpdate?(update: Update): void;
363
+ getStylesheets?(): string[];
364
+ [key: string]: unknown;
365
+ }
366
+ declare class Plugin {
367
+ name: string;
368
+ permissions: string[];
369
+ origin: PluginManifest;
370
+ register?: () => void;
371
+ install?: (root: WebComponent) => () => void;
372
+ onBeforeUpdate?: (update: Update) => void;
373
+ onAfterUpdate?: (update: Update) => void;
374
+ getStylesheets?: () => string[];
375
+ constructor(manifest: PluginManifest);
376
+ isListener(): boolean;
377
+ isStylesheetProvider(): boolean;
378
+ createSandbox(): PluginSandbox;
379
+ }
380
+ declare class Registry {
381
+ plugins: Map<string, Plugin>;
382
+ cache: {
383
+ listeners: Plugin[];
384
+ };
385
+ [Symbol.iterator]: () => Iterator<Plugin>;
386
+ constructor();
387
+ /**
388
+ * Adds the plugin to the registry
389
+ */
390
+ add(plugin: Plugin): void;
391
+ /**
392
+ * Removes the plugin with specified name from the registry.
393
+ */
394
+ remove(name: string): void;
395
+ /**
396
+ * Checks if plugin with specified name exists in the registry.
397
+ */
398
+ isRegistered(name: string): boolean;
399
+ /**
400
+ * Updates the cache.
401
+ */
402
+ updateCache(): void;
403
+ }
404
+ declare class Plugins {
405
+ static Plugin: typeof Plugin;
406
+ root: WebComponent | null;
407
+ registry: Registry;
408
+ uninstalls: Map<string, () => void>;
409
+ [Symbol.iterator]: () => Iterator<Plugin>;
410
+ constructor(root: WebComponent | null);
411
+ /**
412
+ * Creates a Plugin instance from the manifest object and registers it.
413
+ */
414
+ register(plugin: Plugin | PluginManifest): void;
415
+ installAll(): void;
416
+ install(plugin: Plugin | PluginManifest): void;
417
+ /**
418
+ * Removes the plugin from the registry and invokes it's uninstall method
419
+ * if present.
420
+ */
421
+ uninstall(name: string): void;
422
+ /**
423
+ * Uninstalls all the plugins from the registry.
424
+ */
425
+ destroy(): void;
426
+ /**
427
+ * Invokes listener methods on registered listener plugins.
428
+ */
429
+ notify(action: 'before-update' | 'after-update', event: Update): void;
430
+ }
431
+ //#endregion
432
+ //#region src/core/web-component.d.ts
433
+ declare const CONTAINER: unique symbol;
434
+ declare const CUSTOM_ELEMENT: unique symbol;
435
+ declare const DISPATCHER: unique symbol;
436
+ declare class WebComponent<P extends object = object, S extends object = P, C extends CommandsAPI<S> = {}> extends Component<S> {
437
+ static NodeType: string;
438
+ static styles: string[];
439
+ childNodes?: VirtualNode[];
440
+ subroots: Set<WebComponent>;
441
+ ready: Promise<void>;
442
+ markAsReady: () => void;
443
+ markAsFailed: (error: Error) => void;
444
+ plugins: Plugins | null;
445
+ shadow: ShadowRoot | null;
446
+ state?: S;
447
+ pendingDescription?: ComponentDescription;
448
+ stopTracking?: () => void;
449
+ elementClass?: CustomElementConstructor;
450
+ [CONTAINER]?: Element;
451
+ [CUSTOM_ELEMENT]?: HTMLElement | null;
452
+ [DISPATCHER]: Dispatcher;
453
+ constructor(description: ComponentDescription, parent?: VirtualNode | null, context?: WebComponent | null);
454
+ attachDOM(): void;
455
+ createPlaceholder(): VirtualNode;
456
+ /**
457
+ * Triggers the initial rendering of the component in given container.
458
+ */
459
+ init(): Promise<void>;
460
+ setState(state: S): void;
461
+ /**
462
+ * Triggers the component update.
463
+ */
464
+ update(description: ComponentDescription): void;
465
+ /**
466
+ * The default implementation delegating the calculation of initial state
467
+ * to the state manager.
468
+ */
469
+ getInitialState(props: P): S | Promise<S>;
470
+ /**
471
+ * The default implementation delegating the calculation of updated state
472
+ * to the state manager.
473
+ */
474
+ getUpdatedState(props: P, state: S): S;
475
+ get dispatcher(): Dispatcher;
476
+ set dispatcher(dispatcher: Dispatcher);
477
+ get commands(): Commands<S> & BoundCommands<C>;
478
+ createPlugins(): Plugins;
479
+ mount(container: Element): Promise<this>;
480
+ getStylesheets(): string[];
481
+ get ref(): NodeRef;
482
+ set ref(ref: HTMLElement | null);
483
+ set container(container: Element | undefined);
484
+ get container(): Element | undefined;
485
+ get tracked(): WebComponent[];
486
+ destroy(): void;
487
+ setChildNodes(nodes: VirtualNode[]): void;
488
+ insertChild(child: VirtualNode, index?: number): void;
489
+ replaceChild(child: VirtualNode, node: VirtualNode): void;
490
+ moveChild(child: VirtualNode, from: number, to: number): void;
491
+ removeChild(child: VirtualNode): void;
492
+ get nodeType(): string;
493
+ }
494
+ //#endregion
495
+ //#region src/core/component.d.ts
496
+ type CleanUpTask = (() => void) & {
497
+ service?: unknown;
498
+ };
499
+ interface Connectable {
500
+ connect(listeners: Record<string, unknown>): () => void;
501
+ }
502
+ type ComponentClass = typeof Component<object>;
503
+ declare class Component<P extends object = object> extends VirtualNode {
504
+ static NodeType: string;
505
+ static elementName?: string;
506
+ static defaultProps?: Props;
507
+ static commands?: CommandsAPI | CommandsAPI[];
508
+ static get displayName(): string;
509
+ description: ComponentDescription;
510
+ sandbox: ComponentSandbox;
511
+ cleanUpTasks: CleanUpTask[];
512
+ isInitialized: boolean;
513
+ content: VirtualNode | null;
514
+ props: P;
515
+ children: Child[];
516
+ onCreated?(): void;
517
+ onAttached?(): void;
518
+ onPropsReceived?(nextProps: P): void;
519
+ onUpdated?(prevProps: P): void;
520
+ onDestroyed?(): void;
521
+ onDetached?(): void;
522
+ constructor(description: ComponentDescription, parent?: VirtualNode | null, context?: WebComponent | null, attachDOM?: boolean);
523
+ /**
524
+ * Sets the component content.
525
+ */
526
+ setContent(node: VirtualNode): void;
527
+ hasOwnMethod(method: string): boolean;
528
+ connectTo(service: Connectable, listeners: Record<string, unknown>): void;
529
+ get childElement(): VirtualNode | null;
530
+ get placeholder(): VirtualNode | null;
531
+ render(): RenderResult;
532
+ /**
533
+ * Calls the render method and transforms the returned template
534
+ * into the normalised description of the rendered node.
535
+ */
536
+ renderDescription(props?: Props, children?: unknown[]): NodeDescription | null;
537
+ get commands(): Commands<unknown> & Record<string, AnyFunction>;
538
+ get dispatcher(): Dispatcher;
539
+ destroy(): void;
540
+ get nodeType(): string;
541
+ get ref(): NodeRef;
542
+ isCompatible(node: VirtualNode | null | undefined): boolean | null | undefined;
543
+ attachDOM(): void;
544
+ }
545
+ //#endregion
546
+ //#region src/core/text.d.ts
547
+ declare class Text extends VirtualNode {
548
+ static NodeType: string;
549
+ description: TextDescription;
550
+ ref: globalThis.Text;
551
+ constructor(description: TextDescription, parentNode?: VirtualNode);
552
+ get nodeType(): string;
553
+ attachDOM(): void;
554
+ }
555
+ //#endregion
556
+ //#region src/core/virtual-node.d.ts
557
+ type NodeRef = Element | CharacterData;
558
+ declare abstract class VirtualNode {
559
+ description: NodeDescription;
560
+ key?: string;
561
+ parentNode: VirtualNode | null;
562
+ context: WebComponent | null;
563
+ abstract ref: NodeRef;
564
+ abstract get nodeType(): string;
565
+ abstract attachDOM(): void;
566
+ constructor(description: NodeDescription, parentNode?: VirtualNode | null, context?: WebComponent | null);
567
+ get parentElement(): VirtualNode | null;
568
+ get container(): Element | VirtualNode | undefined;
569
+ get rootNode(): WebComponent;
570
+ isRoot(): this is WebComponent;
571
+ isComponent(): this is Component;
572
+ isElement(): this is VirtualElement;
573
+ isComment(): this is Comment;
574
+ isText(): this is Text;
575
+ isCompatible(node: VirtualNode | null | undefined): boolean | null | undefined;
576
+ }
577
+ //#endregion
578
+ //#region src/core/virtual-element.d.ts
579
+ declare class VirtualElement extends VirtualNode {
580
+ static NodeType: string;
581
+ description: ElementDescription;
582
+ ref: HTMLElement;
583
+ children?: VirtualNode[];
584
+ constructor(description: ElementDescription, parent?: VirtualNode | null, context?: WebComponent | null);
585
+ get childNodes(): VirtualNode[] | undefined;
586
+ set childNodes(nodes: VirtualNode[] | undefined);
587
+ get nodeType(): string;
588
+ isCompatible(node: VirtualNode | null | undefined): boolean | null | undefined;
589
+ setChildNodes(nodes: VirtualNode[]): void;
590
+ insertChild(child: VirtualNode, index?: number): void;
591
+ replaceChild(child: VirtualNode, node: VirtualNode): void;
592
+ moveChild(child: VirtualNode, from: number, to: number): void;
593
+ removeChild(child: VirtualNode): void;
594
+ attachDOM(): void;
595
+ }
596
+ //#endregion
597
+ //#region src/core/child-nodes.d.ts
598
+ type ParentVirtualNode = VirtualElement | WebComponent;
599
+ //#endregion
600
+ //#region src/core/service.d.ts
601
+ declare class Service {
602
+ static events: string[];
603
+ static validate(listeners: Record<string, unknown>): string[];
604
+ }
605
+ //#endregion
606
+ //#region src/core/toolkit.d.ts
607
+ interface Settings {
608
+ readonly debug: boolean;
609
+ }
610
+ interface Options {
611
+ debug?: boolean;
612
+ plugins?: PluginManifest[];
613
+ }
614
+ declare class Toolkit {
615
+ settings: Settings;
616
+ assert: (condition: unknown, message?: string) => void;
617
+ constructor();
618
+ /**
619
+ * Configures Toolkit with given options, keeping the current values
620
+ * of the options not provided, by default no debug mode and no plugins.
621
+ * Changed plugins are uninstalled from the created roots, and the new
622
+ * ones installed in their place, with their stylesheets loaded.
623
+ */
624
+ configure(options: Options): void;
625
+ /**
626
+ * Resets Toolkit to a pristine state, with the default settings
627
+ * and no plugins, forgetting the created roots.
628
+ */
629
+ reset(): void;
630
+ get tracked(): WebComponent[];
631
+ isDebug(): boolean;
632
+ warn(...messages: unknown[]): void;
633
+ createRoot(component: ComponentClass, props?: Props): Promise<WebComponent>;
634
+ render(component: ComponentClass, container: Element, props?: Props): Promise<WebComponent>;
635
+ }
636
+ //#endregion
637
+ //#region src/index.d.ts
638
+ type ToolkitClasses = {
639
+ Component: typeof Component;
640
+ WebComponent: typeof WebComponent;
641
+ Root: typeof WebComponent;
642
+ Service: typeof Service;
643
+ utils: typeof Utils;
644
+ noop: () => void;
645
+ };
646
+ export type ToolkitAPI = Toolkit & ToolkitClasses;
647
+ declare const _default: ToolkitAPI;
648
+ //#endregion
649
+ export { type AttributeName, type AttributeValue, type BoundCommands, type Child, type ClassName, type CommandMethod, type Commands, type CommandsAPI, Component, type ComponentClass, type ComponentTemplate, type ComponentType, type Connectable, type ElementProps, type ElementTemplate, type EventListenerFor, type EventName, type Listener, type Options, type PluginManifest, type PluginSandbox, type Props, type PureComponent, type RenderResult, WebComponent as Root, WebComponent, Service, type Settings, type State, type Style, type TagName, type Template, type Update, _default as default, Utils as utils };
650
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":["Listener","Listener","Root","utils"],"sources":["../../src/core/description.ts","../../src/core/comment.ts","../../src/core/browser.ts","../../src/core/bragi.ts","../../src/core/utils.ts","../../src/core/dispatcher.ts","../../src/core/sandbox.ts","../../src/core/patch.ts","../../src/core/renderer.ts","../../src/core/plugins.ts","../../src/core/web-component.ts","../../src/core/component.ts","../../src/core/text.ts","../../src/core/virtual-node.ts","../../src/core/virtual-element.ts","../../src/core/child-nodes.ts","../../src/core/service.ts","../../src/core/toolkit.ts","../../src/index.ts"],"mappings":";KAEY,QAAQ;KAGRA,eAAa,OAAO;EAAuB;;KAE3C,kBACR,uBACA,qBACA,qBACA;KAGQ;uBAMG;SACE,2BAA2B;SAC3B,6BAA6B;SAC7B,2BAA2B;SAC3B,wBAAwB;EAE/B;EACA,WAAW;eAEN,cAAc;MAEvB,uBAAuB;EAO3B,aAAa,aAAa;;cAiBtB,6BAA6B;EACzB,WAAW;EACX;EACA,QAAQ;EACR,QAAQ;EAEJ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