jails-js 5.0.0-beta.7 → 5.0.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/tsconfig.json CHANGED
@@ -1,6 +1,106 @@
1
1
  {
2
- "compilerOptions": {
3
- "lib": [ "dom" ],
4
- "sourceMap": true
5
- }
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ "lib": ["es2015", "dom"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module":"CommonJS", /* Specify what module code is generated. */
29
+ // "rootDir": "./src", /* Specify the root folder within your source files. */
30
+ "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "resolveJsonModule": true, /* Enable importing .json files. */
39
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
+
41
+ /* JavaScript Support */
42
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
+
46
+ /* Emit */
47
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
+ "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
+ // "outFile": "types/index.d.ts", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
+ "outDir": "types", /* Specify an output folder for all emitted files. */
53
+ // "removeComments": true, /* Disable emitting comments. */
54
+ // "noEmit": true, /* Disable emitting files from a compilation. */
55
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
64
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
+ // "declarationDir": "./dist/types", /* Specify the output directory for generated declaration files. */
69
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
+
71
+ /* Interop Constraints */
72
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
+
78
+ /* Type Checking */
79
+ // "strict": true, /* Enable all strict type-checking options. */
80
+ "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
+
99
+ /* Completeness */
100
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
+ },
103
+ "files": [
104
+ "src/index.ts"
105
+ ]
6
106
  }
@@ -0,0 +1,32 @@
1
+ export default function Component(elm: any, { module, dependencies, templates, components }: {
2
+ module: any;
3
+ dependencies: any;
4
+ templates: any;
5
+ components: any;
6
+ }): {
7
+ base: {
8
+ template: any;
9
+ elm: any;
10
+ dependencies: any;
11
+ publish: (name: any, params: any) => void;
12
+ subscribe: (name: any, method: any) => () => void;
13
+ main(fn: any): void;
14
+ unmount(fn: any): void;
15
+ onupdate(fn: any): void;
16
+ on(eventName: any, selectorOrCallback: any, callback: any): void;
17
+ off(eventName: any, callback: any): void;
18
+ trigger(eventName: any, target: any, args: any): void;
19
+ emit: (...args: any[]) => void;
20
+ state: {
21
+ set(data: any): Promise<unknown>;
22
+ get(): any;
23
+ };
24
+ render(data?: any): void;
25
+ };
26
+ options: {
27
+ main: (a: any) => any;
28
+ unmount: (a: any) => any;
29
+ onupdate: (a: any) => any;
30
+ view: any;
31
+ };
32
+ };
@@ -0,0 +1,311 @@
1
+ export default function Element(module: any, dependencies: any, templates: any, components: any): {
2
+ new (): {
3
+ base: any;
4
+ options: any;
5
+ __events: any;
6
+ connectedCallback(): void;
7
+ disconnectedCallback(): void;
8
+ attributeChangedCallback(): void;
9
+ accessKey: string;
10
+ readonly accessKeyLabel: string;
11
+ autocapitalize: string;
12
+ dir: string;
13
+ draggable: boolean;
14
+ hidden: boolean;
15
+ innerText: string;
16
+ lang: string;
17
+ readonly offsetHeight: number;
18
+ readonly offsetLeft: number;
19
+ readonly offsetParent: Element;
20
+ readonly offsetTop: number;
21
+ readonly offsetWidth: number;
22
+ outerText: string;
23
+ spellcheck: boolean;
24
+ title: string;
25
+ translate: boolean;
26
+ attachInternals(): ElementInternals;
27
+ click(): void;
28
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
29
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
30
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions): void;
31
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
32
+ readonly attributes: NamedNodeMap;
33
+ readonly classList: DOMTokenList;
34
+ className: string;
35
+ readonly clientHeight: number;
36
+ readonly clientLeft: number;
37
+ readonly clientTop: number;
38
+ readonly clientWidth: number;
39
+ id: string;
40
+ readonly localName: string;
41
+ readonly namespaceURI: string;
42
+ onfullscreenchange: (this: Element, ev: Event) => any;
43
+ onfullscreenerror: (this: Element, ev: Event) => any;
44
+ outerHTML: string;
45
+ readonly ownerDocument: Document;
46
+ readonly part: DOMTokenList;
47
+ readonly prefix: string;
48
+ readonly scrollHeight: number;
49
+ scrollLeft: number;
50
+ scrollTop: number;
51
+ readonly scrollWidth: number;
52
+ readonly shadowRoot: ShadowRoot;
53
+ slot: string;
54
+ readonly tagName: string;
55
+ attachShadow(init: ShadowRootInit): ShadowRoot;
56
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2];
57
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3];
58
+ closest<E extends Element = Element>(selectors: string): E;
59
+ getAttribute(qualifiedName: string): string;
60
+ getAttributeNS(namespace: string, localName: string): string;
61
+ getAttributeNames(): string[];
62
+ getAttributeNode(qualifiedName: string): Attr;
63
+ getAttributeNodeNS(namespace: string, localName: string): Attr;
64
+ getBoundingClientRect(): DOMRect;
65
+ getClientRects(): DOMRectList;
66
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
67
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
68
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
69
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
70
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
71
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
72
+ getElementsByTagNameNS(namespace: string, localName: string): HTMLCollectionOf<Element>;
73
+ hasAttribute(qualifiedName: string): boolean;
74
+ hasAttributeNS(namespace: string, localName: string): boolean;
75
+ hasAttributes(): boolean;
76
+ hasPointerCapture(pointerId: number): boolean;
77
+ insertAdjacentElement(where: InsertPosition, element: Element): Element;
78
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
79
+ insertAdjacentText(where: InsertPosition, data: string): void;
80
+ matches(selectors: string): boolean;
81
+ releasePointerCapture(pointerId: number): void;
82
+ removeAttribute(qualifiedName: string): void;
83
+ removeAttributeNS(namespace: string, localName: string): void;
84
+ removeAttributeNode(attr: Attr): Attr;
85
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
86
+ requestPointerLock(): void;
87
+ scroll(options?: ScrollToOptions): void;
88
+ scroll(x: number, y: number): void;
89
+ scrollBy(options?: ScrollToOptions): void;
90
+ scrollBy(x: number, y: number): void;
91
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
92
+ scrollTo(options?: ScrollToOptions): void;
93
+ scrollTo(x: number, y: number): void;
94
+ setAttribute(qualifiedName: string, value: string): void;
95
+ setAttributeNS(namespace: string, qualifiedName: string, value: string): void;
96
+ setAttributeNode(attr: Attr): Attr;
97
+ setAttributeNodeNS(attr: Attr): Attr;
98
+ setPointerCapture(pointerId: number): void;
99
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
100
+ webkitMatchesSelector(selectors: string): boolean;
101
+ readonly baseURI: string;
102
+ readonly childNodes: NodeListOf<ChildNode>;
103
+ readonly firstChild: ChildNode;
104
+ readonly isConnected: boolean;
105
+ readonly lastChild: ChildNode;
106
+ readonly nextSibling: ChildNode;
107
+ readonly nodeName: string;
108
+ readonly nodeType: number;
109
+ nodeValue: string;
110
+ readonly parentElement: HTMLElement;
111
+ readonly parentNode: ParentNode;
112
+ readonly previousSibling: ChildNode;
113
+ textContent: string;
114
+ appendChild<T extends Node>(node: T): T;
115
+ cloneNode(deep?: boolean): Node;
116
+ compareDocumentPosition(other: Node): number;
117
+ contains(other: Node): boolean;
118
+ getRootNode(options?: GetRootNodeOptions): Node;
119
+ hasChildNodes(): boolean;
120
+ insertBefore<T_1 extends Node>(node: T_1, child: Node): T_1;
121
+ isDefaultNamespace(namespace: string): boolean;
122
+ isEqualNode(otherNode: Node): boolean;
123
+ isSameNode(otherNode: Node): boolean;
124
+ lookupNamespaceURI(prefix: string): string;
125
+ lookupPrefix(namespace: string): string;
126
+ normalize(): void;
127
+ removeChild<T_2 extends Node>(child: T_2): T_2;
128
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
129
+ readonly ATTRIBUTE_NODE: number;
130
+ readonly CDATA_SECTION_NODE: number;
131
+ readonly COMMENT_NODE: number;
132
+ readonly DOCUMENT_FRAGMENT_NODE: number;
133
+ readonly DOCUMENT_NODE: number;
134
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
135
+ readonly DOCUMENT_POSITION_CONTAINS: number;
136
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
137
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
138
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
139
+ readonly DOCUMENT_POSITION_PRECEDING: number;
140
+ readonly DOCUMENT_TYPE_NODE: number;
141
+ readonly ELEMENT_NODE: number;
142
+ readonly ENTITY_NODE: number;
143
+ readonly ENTITY_REFERENCE_NODE: number;
144
+ readonly NOTATION_NODE: number;
145
+ readonly PROCESSING_INSTRUCTION_NODE: number;
146
+ readonly TEXT_NODE: number;
147
+ dispatchEvent(event: Event): boolean;
148
+ ariaAtomic: string;
149
+ ariaAutoComplete: string;
150
+ ariaBusy: string;
151
+ ariaChecked: string;
152
+ ariaColCount: string;
153
+ ariaColIndex: string;
154
+ ariaColSpan: string;
155
+ ariaCurrent: string;
156
+ ariaDisabled: string;
157
+ ariaExpanded: string;
158
+ ariaHasPopup: string;
159
+ ariaHidden: string;
160
+ ariaKeyShortcuts: string;
161
+ ariaLabel: string;
162
+ ariaLevel: string;
163
+ ariaLive: string;
164
+ ariaModal: string;
165
+ ariaMultiLine: string;
166
+ ariaMultiSelectable: string;
167
+ ariaOrientation: string;
168
+ ariaPlaceholder: string;
169
+ ariaPosInSet: string;
170
+ ariaPressed: string;
171
+ ariaReadOnly: string;
172
+ ariaRequired: string;
173
+ ariaRoleDescription: string;
174
+ ariaRowCount: string;
175
+ ariaRowIndex: string;
176
+ ariaRowSpan: string;
177
+ ariaSelected: string;
178
+ ariaSetSize: string;
179
+ ariaSort: string;
180
+ ariaValueMax: string;
181
+ ariaValueMin: string;
182
+ ariaValueNow: string;
183
+ ariaValueText: string;
184
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation;
185
+ getAnimations(options?: GetAnimationsOptions): Animation[];
186
+ after(...nodes: (string | Node)[]): void;
187
+ before(...nodes: (string | Node)[]): void;
188
+ remove(): void;
189
+ replaceWith(...nodes: (string | Node)[]): void;
190
+ innerHTML: string;
191
+ readonly nextElementSibling: Element;
192
+ readonly previousElementSibling: Element;
193
+ readonly childElementCount: number;
194
+ readonly children: HTMLCollection;
195
+ readonly firstElementChild: Element;
196
+ readonly lastElementChild: Element;
197
+ append(...nodes: (string | Node)[]): void;
198
+ prepend(...nodes: (string | Node)[]): void;
199
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6];
200
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7];
201
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1;
202
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
203
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
204
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
205
+ replaceChildren(...nodes: (string | Node)[]): void;
206
+ readonly assignedSlot: HTMLSlotElement;
207
+ oncopy: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
208
+ oncut: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
209
+ onpaste: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
210
+ readonly style: CSSStyleDeclaration;
211
+ contentEditable: string;
212
+ enterKeyHint: string;
213
+ inputMode: string;
214
+ readonly isContentEditable: boolean;
215
+ onabort: (this: GlobalEventHandlers, ev: UIEvent) => any;
216
+ onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
217
+ onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
218
+ onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
219
+ onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
220
+ onauxclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
221
+ onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any;
222
+ oncanplay: (this: GlobalEventHandlers, ev: Event) => any;
223
+ oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any;
224
+ onchange: (this: GlobalEventHandlers, ev: Event) => any;
225
+ onclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
226
+ onclose: (this: GlobalEventHandlers, ev: Event) => any;
227
+ oncontextmenu: (this: GlobalEventHandlers, ev: MouseEvent) => any;
228
+ oncuechange: (this: GlobalEventHandlers, ev: Event) => any;
229
+ ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
230
+ ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any;
231
+ ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any;
232
+ ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any;
233
+ ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any;
234
+ ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any;
235
+ ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any;
236
+ ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any;
237
+ ondurationchange: (this: GlobalEventHandlers, ev: Event) => any;
238
+ onemptied: (this: GlobalEventHandlers, ev: Event) => any;
239
+ onended: (this: GlobalEventHandlers, ev: Event) => any;
240
+ onerror: OnErrorEventHandlerNonNull;
241
+ onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any;
242
+ onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any;
243
+ ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
244
+ oninput: (this: GlobalEventHandlers, ev: Event) => any;
245
+ oninvalid: (this: GlobalEventHandlers, ev: Event) => any;
246
+ onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
247
+ onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
248
+ onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
249
+ onload: (this: GlobalEventHandlers, ev: Event) => any;
250
+ onloadeddata: (this: GlobalEventHandlers, ev: Event) => any;
251
+ onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any;
252
+ onloadstart: (this: GlobalEventHandlers, ev: Event) => any;
253
+ onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
254
+ onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any;
255
+ onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any;
256
+ onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any;
257
+ onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any;
258
+ onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
259
+ onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any;
260
+ onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any;
261
+ onpause: (this: GlobalEventHandlers, ev: Event) => any;
262
+ onplay: (this: GlobalEventHandlers, ev: Event) => any;
263
+ onplaying: (this: GlobalEventHandlers, ev: Event) => any;
264
+ onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any;
265
+ onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any;
266
+ onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any;
267
+ onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any;
268
+ onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any;
269
+ onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any;
270
+ onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any;
271
+ onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any;
272
+ onprogress: (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any;
273
+ onratechange: (this: GlobalEventHandlers, ev: Event) => any;
274
+ onreset: (this: GlobalEventHandlers, ev: Event) => any;
275
+ onresize: (this: GlobalEventHandlers, ev: UIEvent) => any;
276
+ onscroll: (this: GlobalEventHandlers, ev: Event) => any;
277
+ onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any;
278
+ onseeked: (this: GlobalEventHandlers, ev: Event) => any;
279
+ onseeking: (this: GlobalEventHandlers, ev: Event) => any;
280
+ onselect: (this: GlobalEventHandlers, ev: Event) => any;
281
+ onselectionchange: (this: GlobalEventHandlers, ev: Event) => any;
282
+ onselectstart: (this: GlobalEventHandlers, ev: Event) => any;
283
+ onslotchange: (this: GlobalEventHandlers, ev: Event) => any;
284
+ onstalled: (this: GlobalEventHandlers, ev: Event) => any;
285
+ onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any;
286
+ onsuspend: (this: GlobalEventHandlers, ev: Event) => any;
287
+ ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any;
288
+ ontoggle: (this: GlobalEventHandlers, ev: Event) => any;
289
+ ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
290
+ ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
291
+ ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
292
+ ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
293
+ ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
294
+ ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
295
+ ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
296
+ ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
297
+ onvolumechange: (this: GlobalEventHandlers, ev: Event) => any;
298
+ onwaiting: (this: GlobalEventHandlers, ev: Event) => any;
299
+ onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any;
300
+ onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any;
301
+ onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any;
302
+ onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any;
303
+ onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any;
304
+ autofocus: boolean;
305
+ readonly dataset: DOMStringMap;
306
+ nonce?: string;
307
+ tabIndex: number;
308
+ blur(): void;
309
+ focus(options?: FocusOptions): void;
310
+ };
311
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ register(name: string, module: any, dependencies: object): void;
3
+ start(): void;
4
+ };
5
+ export default _default;
package/types/index.ts ADDED
@@ -0,0 +1,41 @@
1
+ export type Component = {
2
+
3
+ elm: HTMLElement
4
+ dependencies: object
5
+
6
+ state : {
7
+ set( data: object ) : void
8
+ set( callback: ( state: object ) => any ) : void
9
+ get() : object
10
+ }
11
+
12
+ main( mainArgs: ( t: any ) => Array<Function> ): void
13
+
14
+ publish( name: string, value: any ) : void
15
+
16
+ subscribe( name: string, value: Function ) : Function
17
+
18
+ template( data: object ) : void
19
+
20
+ unmount( callback: () => void ) : void
21
+
22
+ onupdate( callback: () => void ) : void
23
+
24
+ on( eventName: string, selector: string, callback: () => void ): void
25
+
26
+ on( eventName: string, callback: () => void ): void
27
+
28
+ emit( eventName: string, data: any ) : void
29
+
30
+ off( eventName: string, callback: () => void ): void
31
+
32
+ trigger( eventName: string, selector :string, data: any ): void
33
+
34
+ render( data: object ) : void
35
+ }
36
+
37
+ export type Model = {
38
+ [key: string] : object
39
+ }
40
+
41
+ export type View = ( state: object ) => object
@@ -0,0 +1 @@
1
+ export default function templateSystem(element: any): (data: any) => string;
@@ -0,0 +1,3 @@
1
+ export declare const on: (node: any, ev: any, selectorOrCallback: any, callback: any) => void;
2
+ export declare const off: (node: any, ev: any, fn: any) => void;
3
+ export declare const trigger: (node: any, name: any, args: any) => void;
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" />
2
+ export declare const rAF: (fn: any) => number | NodeJS.Timeout;
3
+ export declare const uuid: () => string;
4
+ export declare const stripTemplateTag: (element: any) => void;
5
+ export declare const dup: (o: any) => any;
6
+ export declare const createTemplateId: (element: any, templates: any) => void;
7
+ export declare const buildtemplates: (target: any, components: any, templates: any) => unknown[];
8
+ export declare const decodeHtmlEntities: (str: any) => string;
@@ -0,0 +1,2 @@
1
+ export declare const publish: (name: any, params: any) => void;
2
+ export declare const subscribe: (name: any, method: any) => () => void;
package/webpack.config.js CHANGED
@@ -9,27 +9,27 @@ module.exports = {
9
9
  },
10
10
 
11
11
  entry: {
12
- jails: './src/index.ts'
12
+ index: './src/index.ts'
13
13
  },
14
14
 
15
15
  module: {
16
- rules: [
17
- {
18
- test: /\.ts$/,
19
- exclude: [/node_modules/],
20
- loader: 'ts-loader',
16
+ rules: [
17
+ {
18
+ test: /\.ts$/,
19
+ exclude: [/node_modules/],
20
+ loader: 'ts-loader',
21
21
  options: {
22
22
  transpileOnly: true
23
23
  }
24
- }
25
- ]
26
- },
24
+ }
25
+ ]
26
+ },
27
27
 
28
28
  output: {
29
- path : path.resolve(__dirname, './dist'),
30
- filename : '[name].js',
31
- libraryTarget : 'umd',
32
- library : 'jails',
29
+ path: path.resolve(__dirname, './dist'),
30
+ filename: '[name].js',
31
+ libraryTarget: 'umd',
32
+ library: 'jails',
33
33
  umdNamedDefine: true
34
34
  }
35
35
  }
package/dist/jails.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("jails",[],t):"object"==typeof exports?exports.jails=t():e.jails=t()}(self,(function(){return(()=>{var e={492:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{default:()=>f});var i="undefined"==typeof document?void 0:document,o=!!i&&"content"in i.createElement("template"),a=!!i&&i.createRange&&"createContextualFragment"in i.createRange();function s(e,t){var n,r,i=e.nodeName,o=t.nodeName;return i===o||(n=i.charCodeAt(0),r=o.charCodeAt(0),n<=90&&r>=97?i===o.toUpperCase():r<=90&&n>=97&&o===i.toUpperCase())}function u(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var l={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();"OPTGROUP"===r&&(r=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==r||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}u(e,t,"selected")},INPUT:function(e,t){u(e,t,"checked"),u(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,r,i=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(r=a.nodeName&&a.nodeName.toUpperCase()))a=(n=a).firstChild;else{if("OPTION"===r){if(a.hasAttribute("selected")){i=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=i}}};function c(){}function d(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}const f=function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var u=t;(t=i.createElement("html")).innerHTML=u}else f=(f=t).trim(),t=o?function(e){var t=i.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(f):a?function(e){return r||(r=i.createRange()).selectNode(i.body),r.createContextualFragment(e).childNodes[0]}(f):function(e){var t=i.createElement("body");return t.innerHTML=e,t.childNodes[0]}(f);var f,p=n.getNodeKey||d,v=n.onBeforeNodeAdded||c,m=n.onNodeAdded||c,h=n.onBeforeElUpdated||c,g=n.onElUpdated||c,b=n.onBeforeNodeDiscarded||c,y=n.onNodeDiscarded||c,_=n.onBeforeElChildrenUpdated||c,E=!0===n.childrenOnly,x=Object.create(null),N=[];function O(e){N.push(e)}function A(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var r=void 0;t&&(r=p(n))?O(r):(y(n),n.firstChild&&A(n,t)),n=n.nextSibling}}function T(e,t,n){!1!==b(e)&&(t&&t.removeChild(e),y(e),A(e,n))}function S(e){m(e);for(var t=e.firstChild;t;){var n=t.nextSibling,r=p(t);if(r){var i=x[r];i&&s(t,i)?(t.parentNode.replaceChild(i,t),R(i,t)):S(t)}else S(t);t=n}}function R(e,t,n){var r=p(t);if(r&&delete x[r],!n){if(!1===h(e,t))return;if(function(e,t){var n,r,i,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var s=a.length-1;s>=0;s--)r=(n=a[s]).name,i=n.namespaceURI,o=n.value,i?(r=n.localName||r,e.getAttributeNS(i,r)!==o&&("xmlns"===n.prefix&&(r=n.name),e.setAttributeNS(i,r,o))):e.getAttribute(r)!==o&&e.setAttribute(r,o);for(var u=e.attributes,l=u.length-1;l>=0;l--)r=(n=u[l]).name,(i=n.namespaceURI)?(r=n.localName||r,t.hasAttributeNS(i,r)||e.removeAttributeNS(i,r)):t.hasAttribute(r)||e.removeAttribute(r)}}(e,t),g(e),!1===_(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,r,o,a,u,c=t.firstChild,d=e.firstChild;e:for(;c;){for(a=c.nextSibling,n=p(c);d;){if(o=d.nextSibling,c.isSameNode&&c.isSameNode(d)){c=a,d=o;continue e}r=p(d);var f=d.nodeType,m=void 0;if(f===c.nodeType&&(1===f?(n?n!==r&&((u=x[n])?o===u?m=!1:(e.insertBefore(u,d),r?O(r):T(d,e,!0),d=u):m=!1):r&&(m=!1),(m=!1!==m&&s(d,c))&&R(d,c)):3!==f&&8!=f||(m=!0,d.nodeValue!==c.nodeValue&&(d.nodeValue=c.nodeValue))),m){c=a,d=o;continue e}r?O(r):T(d,e,!0),d=o}if(n&&(u=x[n])&&s(u,c))e.appendChild(u),R(u,c);else{var h=v(c);!1!==h&&(h&&(c=h),c.actualize&&(c=c.actualize(e.ownerDocument||i)),e.appendChild(c),S(c))}c=a,d=o}!function(e,t,n){for(;t;){var r=t.nextSibling;(n=p(t))?O(n):T(t,e,!0),t=r}}(e,d,r);var g=l[e.nodeName];g&&g(e,t)}(e,t):l.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var r=p(n);r&&(x[r]=n),e(n),n=n.nextSibling}}(e);var C,M,w=e,j=w.nodeType,P=t.nodeType;if(!E)if(1===j)1===P?s(e,t)||(y(e),w=function(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}(e,(C=t.nodeName,(M=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==M?i.createElementNS(M,C):i.createElement(C)))):w=t;else if(3===j||8===j){if(P===j)return w.nodeValue!==t.nodeValue&&(w.nodeValue=t.nodeValue),w;w=t}if(w===t)y(e);else{if(t.isSameNode&&t.isSameNode(w))return;if(R(w,t,E),N)for(var G=0,k=N.length;G<k;G++){var L=x[N[G]];L&&T(L,L.parentNode,!1)}}return!E&&w!==e&&e.parentNode&&(w.actualize&&(w=w.actualize(e.ownerDocument||i)),e.parentNode.replaceChild(w,e)),w}},17:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=n(2);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u="undefined"!=typeof document?document:{},l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"soda-";s(this,e),this._prefix=t}return i(e,[{key:"setDocument",value:function(e){u=e}},{key:"run",value:function(e,t){var n=this,r=u.createElement("div");u.documentMode<9&&(r.style.display="none",u.body.appendChild(r)),r.innerHTML=e,(0,a.nodes2Arr)(r.childNodes).map((function(e){n.compileNode(e,t)}));var i=r.innerHTML;return u.documentMode<9&&u.body.removeChild(r),i}},{key:"prefix",value:function(e){this._prefix=e}},{key:"_getPrefixReg",value:function(){return new RegExp("^"+this._prefix)}},{key:"_getPrefixedDirectiveMap",value:function(){var t=this,n={};return e.sodaDirectives.map((function(e){var r=t._prefix+e.name;n[r]=e})),n}},{key:"_removeSodaMark",value:function(e,t){e.removeAttribute(t)}},{key:"compileNode",value:function(t,n){var i=this,s=this._getPrefixReg(),l=e.sodaDirectives,c=this._getPrefixedDirectiveMap();!function e(t,n){t.nodeType===(t.TEXT_NODE||3)&&(t.nodeValue=t.nodeValue.replace(o.VALUE_OUT_REG,(function(e,t){var o=i.parseSodaExpression(t,n);return"object"===(void 0===o?"undefined":r(o))&&(o=JSON.stringify(o,null,2)),o}))),t.attributes&&t.attributes.length&&(l.map((function(e){var r=e.name,o=e.opt,s=i._prefix+r;if((0,a.exist)(t.getAttribute(s))){var l=t.getAttribute(s);o.link.bind(i)({expression:l,scope:n,el:t,parseSodaExpression:i.parseSodaExpression.bind(i),getValue:i.getValue.bind(i),compileNode:i.compileNode.bind(i),document:u}),i._removeSodaMark(t,s)}})),(0,a.nodes2Arr)(t.attributes).filter((function(e){return!c[e.name]})).map((function(e){if(s.test(e.name)){var r=e.name.replace(s,"");if(r&&(0,a.exist)(e.value)){var o=i.parseComplexExpression(e.value,n);!1!==o&&(0,a.exist)(o)&&t.setAttribute(r,o),i._removeSodaMark(t,e.name)}}else(0,a.exist)(e.value)&&(e.value=i.parseComplexExpression(e.value,n))}))),(0,a.nodes2Arr)(t.childNodes).map((function(t){e(t,n)}))}(t,n)}},{key:"getEvalFunc",value:function(t){return new Function("getValue","sodaFilterMap","return function sodaExp(scope){ return "+t+"}")(this.getValue,e.sodaFilterMap)}},{key:"getValue",value:function(e,t){return o.CONST_REGG.lastIndex=0,t.replace(o.CONST_REGG,(function(t){return void 0===e[t]?t:e[t]})),"true"===t||"false"!==t&&function t(n,r){var i=r.indexOf(".");if(i>-1){var a=r.substr(0,i);return r=r.substr(i+1),void 0!==e[a]&&o.CONST_REG.test(a)&&(a=e[a]),void 0!==n[a]&&null!==n[a]?t(n[a],r):""}return r=r.trim(),void 0!==e[r]&&o.CONST_REG.test(r)&&(r=e[r]),void 0!==n[r]?n[r]:""}(e,t)}},{key:"parseComplexExpression",value:function(e,t){var n=this,r=o.ONLY_VALUE_OUT_REG.exec(e);if(r){var i=r[1];return this.parseSodaExpression(i,t)}return e.replace(o.VALUE_OUT_REG,(function(e,r){return n.parseSodaExpression(r,t)}))}},{key:"parseSodaExpression",value:function(e,t){var n=this;e=(e=e.replace(o.STRING_REG,(function(e,n,r){var i=(0,a.getRandom)();return t[i]=n||r,i}))).replace(o.OR_REG,o.OR_REPLACE).split("|");for(var r=0;r<e.length;r++)e[r]=(e[r].replace(new RegExp(o.OR_REPLACE,"g"),"||")||"").trim();for(var i=e[0]||"",s=e.slice(1);o.ATTR_REG_NG.test(i);)o.ATTR_REG.lastIndex=0,i=i.replace(o.ATTR_REG,(function(e,r){var i=(0,a.getAttrVarKey)(),o=n.parseSodaExpression(r,t);return t[i]=o,"."+i}));return i=i.replace(o.OBJECT_REG,(function(e){return"getValue(scope,'"+e.trim()+"')"})),i=this.parseFilter(s,i),this.getEvalFunc(i)(t)}},{key:"parseFilter",value:function(t,n){var r=e.sodaFilterMap;return function e(){if(i=t.shift()){for(var i,a=(i=i.split(":")).slice(1)||[],s=(i[0]||"").trim(),u=0;u<a.length;u++)o.OBJECT_REG_NG.test(a[u])&&(a[u]="getValue(scope,'"+a[u]+"')");r[s]&&(a.unshift(n),a=a.join(","),n="sodaFilterMap['"+s+"']("+a+")"),e()}}(),n}}],[{key:"filter",value:function(e,t){this.sodaFilterMap[e]=t}},{key:"getFilter",value:function(e){return this.sodaFilterMap[e]}},{key:"directive",value:function(e,t){var n=t.priority,r=void 0===n?0:n,i=void 0;for(i=0;i<this.sodaDirectives.length;i++){var o=this.sodaDirectives[i].opt.priority,a=void 0===o?0:o;if(r<a);else if(r>=a)break}this.sodaDirectives.splice(i,0,{name:e,opt:t})}},{key:"discribe",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{compile:!0};this.template[e]={funcOrStr:t,option:n}}},{key:"getTmpl",value:function(e,t){var n=this.template[e],r=n.funcOrStr,i=n.option,o=void 0===i?{}:i;return{template:"function"==typeof r?r.apply(null,t):r,option:o}}}]),e}();l.sodaDirectives=[],l.sodaFilterMap={},l.template={},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDENTOR_REG=/[a-zA-Z_\$]+[\w\$]*/g,t.STRING_REG=/"([^"]*)"|'([^']*)'/g,t.NUMBER_REG=/\d+|\d*\.\d+/g,t.OBJECT_REG=/[a-zA-Z_\$]+[\w\$]*(?:\s*\.\s*(?:[a-zA-Z_\$]+[\w\$]*|\d+))*/g,t.OBJECT_REG_NG=/[a-zA-Z_\$]+[\w\$]*(?:\s*\.\s*(?:[a-zA-Z_\$]+[\w\$]*|\d+))*/,t.ATTR_REG=/\[([^\[\]]*)\]/g,t.ATTR_REG_NG=/\[([^\[\]]*)\]/,t.ATTR_REG_DOT=/\.([a-zA-Z_\$]+[\w\$]*)/g,t.NOT_ATTR_REG=/[^\.|]([a-zA-Z_\$]+[\w\$]*)/g,t.OR_REG=/\|\|/g,t.OR_REPLACE="OR_OPERATOR",t.CONST_PRIFIX="_$C$_",t.CONST_REG=/^_\$C\$_/,t.CONST_REGG=/_\$C\$_[^\.]+/g,t.VALUE_OUT_REG=/\{\{([^\}]*)\}\}/g,t.ONLY_VALUE_OUT_REG=/^\{\{([^\}]*)\}\}$/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assign=t.nodes2Arr=t.exist=t.getRandom=t.getAttrVarKey=void 0;var r=n(1),i=(t.getAttrVarKey=function(){return r.CONST_PRIFIX+~~(1e6*Math.random())},t.getRandom=function(){return"$$"+~~(1e6*Math.random())},t.exist=function(e){return null!=e&&""!==e&&void 0!==e},t.nodes2Arr=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},Object.getOwnPropertySymbols),o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)};t.assign=Object.assign||function(e,t){for(var n,r,u=s(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(u[c]=n[c]);if(i){r=i(n);for(var d=0;d<r.length;d++)a.call(n,r[d])&&(u[r[d]]=n[r[d]])}}return u}},function(e,t,n){"use strict";var r,i=(r=n(0))&&r.__esModule?r:{default:r},o=n(2);n(4),n(5),n(6),n(7),n(8),n(9),n(10);var a=new i.default,s={prefix:function(e){a.prefix(e)},filter:function(e,t){i.default.filter(e,t)},directive:function(e,t){i.default.directive(e,t)},setDocument:function(e){a.setDocument(e)},discribe:function(e,t,n){i.default.discribe(e,t,n)},Soda:i.default},u=(0,o.assign)((function(e,t){return a.run(e,t)}),s);e.exports=u},function(e,t,n){"use strict";var r;((r=n(0))&&r.__esModule?r:{default:r}).default.directive("repeat",{priority:10,link:function(e){var t,n,r,i=this,o=e.scope,a=e.el,s=e.expression,u=e.getValue,l=(e.parseSodaExpression,e.compileNode),c=s.replace(/\s+by\s+([^\s]+)$/,(function(e,t){return t&&(r=(t||"").trim()),""})),d=/([^\s]+)\s+in\s+([^\s]+)|\(([^,]+)\s*,\s*([^)]+)\)\s+in\s+([^\s]+)/.exec(c);if(d){if(d[1]&&d[2]){if(t=(d[1]||"").trim(),n=(d[2]||"").trim(),!t||!n)return}else d[3]&&d[4]&&d[5]&&(r=(d[3]||"").trim(),t=(d[4]||"").trim(),n=(d[5]||"").trim());r=r||"$index";var f=u(o,n)||[],p=function(e){var n=a.cloneNode(!0),s=Object.create(o);s[r]=e,s[t]=f[e],n.removeAttribute(i._prefix+"repeat"),a.parentNode.insertBefore(n,a),l(n,s)};if("length"in f)for(var v=0;v<f.length;v++)p(v);else for(var v in f)f.hasOwnProperty(v)&&p(v);a.parentNode.removeChild(a),a.childNodes&&a.childNodes.length&&(a.innerHTML="")}}})},function(e,t,n){"use strict";var r;((r=n(0))&&r.__esModule?r:{default:r}).default.directive("if",{priority:9,link:function(e){var t=e.expression,n=e.parseSodaExpression,r=e.scope,i=e.el;n(t,r)||(i.parentNode&&i.parentNode.removeChild(i),i.innerHTML="")}})},function(e,t,n){"use strict";var r,i=(r=n(0))&&r.__esModule?r:{default:r};i.default.directive("class",{link:function(e){var t=e.scope,n=e.el,r=e.expression,i=(0,e.parseSodaExpression)(r,t);i&&function(e,t){e.className?e.className.match(function(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)","g")}(t))||(e.className+=" "+t):e.className=t}(n,i)}})},function(e,t,n){"use strict";var r;((r=n(0))&&r.__esModule?r:{default:r}).default.directive("html",{link:function(e){var t=e.expression,n=e.scope,r=e.el,i=(0,e.parseSodaExpression)(t,n);i&&(r.innerHTML=i)}})},function(e,t,n){"use strict";var r;((r=n(0))&&r.__esModule?r:{default:r}).default.directive("replace",{link:function(e){var t=e.scope,n=e.el,r=e.expression,i=e.parseSodaExpression,o=e.document,a=i(r,t);if(a){var s=o.createElement("div");if(s.innerHTML=a,n.parentNode)for(;s.childNodes[0];)n.parentNode.insertBefore(s.childNodes[0],n)}n.parentNode&&n.parentNode.removeChild(n)}})},function(e,t,n){"use strict";var r;((r=n(0))&&r.__esModule?r:{default:r}).default.directive("style",{link:function(e){var t=e.scope,n=e.el,r=e.expression,i=(0,e.parseSodaExpression)(r,t),o=function(e,t){return/opacity|z-index/.test(e)?parseFloat(t):isNaN(t)?t:t+"px"};if(i){var a=[];for(var s in i)if(i.hasOwnProperty(s)){var u=o(s,i[s]);a.push([s,u].join(":"))}var l=n.style;for(s=0;s<l.length;s++){var c=l[s];i[c]||a.push([c,l[c]].join(":"))}var d=a.join(";");n.setAttribute("style",d)}}})},function(e,t,n){"use strict";var r,i=(r=n(0))&&r.__esModule?r:{default:r};i.default.directive("include",{priority:8,link:function(e){var t=e.scope,n=e.el,r=e.parseSodaExpression,o=e.expression.replace(/\{\{([^\}]*)\}\}/g,(function(e,n){return r(n,t)})),a=(o=o.split(":"))[0],s=o.slice(1),u=i.default.getTmpl(a,s),l=u.template,c=u.option;l&&((void 0===c?{}:c).compile?n.outerHTML=this.run(l,t):n.outerHTML=l)}})}])},e.exports=t()},126:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(436),i=n(242),o=n(624),a=n(602);t.Component=function(e){var t,n=e.name,s=e.element,u=e.dependencies,l=e.ElementInterface,c=[],d=[],f=new Promise((function(e){return t=e})),p={name:n,dependencies:u,elm:s,publish:r.publish,unsubscribe:r.unsubscribe,__initialize:function(){t(p)},main:function(e){f.then((function(t){return e().forEach((function(e){return e(p)}))})).catch((function(e){return console.error(e)}))},expose:function(e){l.instances[n].methods=e},state:{set:function(e){if(e.constructor===Function){var t=l.model;e(t),l.update(t)}else l.update(e);return d.forEach((function(e){return e(l.model)})),new Promise((function(e){return(0,o.rAF)((function(t){return(0,o.rAF)(e)}))}))},get:function(){return l.model},subscribe:function(e){d.push(e)},unsubscribe:function(e){d=d.filter((function(t){return t!==e}))}},destroy:function(e){l.destroyers.push(e)},on:function(e,t,n){(0,i.on)(s,e,t,n)},off:function(e,t){(0,i.off)(s,e,t)},trigger:function(e,t,n){t.constructor===String?(0,i.trigger)(s.querySelector(t),e,{args:n}):(0,i.trigger)(s,e,{args:t})},emit:function(e,t){var n=Array.prototype.slice.call(arguments);(0,i.trigger)(s,n.shift(),{args:n})},update:function(e){l.parentUpdate=e},get:function(e,t){return function(){var n=Array.prototype.slice.call(arguments),r=n.shift(),i="[data-component*=".concat(e,"]");if(t=t?i+t:i,Array.from(s.querySelectorAll(t)).forEach((function(t){var i=a.Instances.get(t).instances[e];i&&r in i.methods&&i.methods[r].apply(null,n)})),s.matches(t)){var o=a.Instances.get(s).instances[e];o&&r in o.methods&&o.methods[r].apply(null,n)}}},subscribe:function(e,t){c.push({name:e,method:t}),r.subscribe(e,t)}};return p}},491:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Element=void 0;var o=n(624),a=n(492),s=n(539),u=n(602),l=(0,s.setSodaConfig)(),c={};t.Element=function(e){(0,o.stripTemplateTag)(e);var t=[],n=Object.assign({},JSON.parse(e.dataset.initialState||"{}")),s=d(e),c=p(e),f=c.template,v={tplid:c.tplid,template:f,model:n,parent:{},view:function(e){return e},instances:{},destroyers:[],promises:[],parentUpdate:function(e){return null},dispose:function(){v.promises.length?Promise.all(v.promises).then((function(e){return v.destroyers.forEach((function(e){return e(v)}))})):v.destroyers.forEach((function(e){return e(v)}))},update:function(n,c){void 0===n&&(n={}),document.body.contains(e)&&(t.push(n),(0,o.rAF)((function(n){if(t.length){var d={};t.forEach((function(e){return Object.assign(d,e)})),t=[],v.model=Object.assign(v.model,d),c&&v.parentUpdate(v.model);var p=l(f,v.view((0,o.dup)(v.model)));(0,a.default)(e,p,s),Array.from(e.querySelectorAll("[data-component]")).forEach((function(e){if(u.Instances.get(e)){var t=v.model,n=t.parent,o=i(t,["parent"]),a=e.dataset.initialState?JSON.parse(e.dataset.initialState):{},s=Object.assign(a,{parent:r(r({},o),n)});u.Instances.get(e).update(s,!0)}}))}})))}};return u.Instances.set(e,v),v};var d=function(e){return{onBeforeElUpdated:f(e),onBeforeElChildrenUpdated:f(e),getNodeKey:function(e){return!(1!==e.nodeType||!e.getAttribute("tplid"))&&(e.dataset.key||e.getAttribute("tplid"))}}},f=function(e){return function(t,n){if(1==t.nodeType){if("static"in t.dataset)return!1;if(t.dataset.component&&u.Instances.get(t)&&t!==e)return!1}return!0}},p=function(e){return Array.from(e.querySelectorAll("[data-component]")).forEach(v),v(e)},v=function(e){if(e.getAttribute("tplid"))return{tplid:t=e.getAttribute("tplid"),template:c[t]};var t=(0,o.uuid)();return e.setAttribute("tplid",t),c[t]=(0,o.createTemplate)(e.outerHTML,c),{tplid:t,template:c[t]}}},602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=void 0,t.Instances=new WeakMap},610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scanner=void 0,t.Scanner={scan:function(e,t){if(1===e.nodeType){var n=Array.from(e.querySelectorAll("[data-component]")),r=e.dataset.component?[e].concat(n):n;r.length&&r.reverse().forEach(t)}},observe:function(e,n,r){new MutationObserver((function(e){return e.forEach((function(e){"childList"===e.type&&(e.addedNodes.length?Array.from(e.addedNodes).forEach((function(e){return t.Scanner.scan(e,n)})):e.removedNodes.length&&Array.from(e.removedNodes).forEach((function(e){return t.Scanner.scan(e,r)})))}))})).observe(e,{childList:!0,subtree:!0})}}},539:(e,t,n)=>{"use strict";n.r(t),n.d(t,{setSodaConfig:()=>o});var r=n(17),i=n.n(r);const o=()=>(i().prefix("v-"),i().directive("repeat",{priority:10,link({scope:e,el:t,expression:n,getValue:r,compileNode:i}){let o,a,s;const u=n.replace(/\s+by\s+([^\s]+)$/,((e,t)=>(t&&(s=(t||"").trim()),""))),l=/([^\s]+)\s+in\s+([^\s]+)|\(([^,]+)\s*,\s*([^)]+)\)\s+in\s+([^\s]+)/.exec(u);if(!l)return;if(l[1]&&l[2]){if(o=(l[1]||"").trim(),a=(l[2]||"").trim(),!o||!a)return}else l[3]&&l[4]&&l[5]&&(s=(l[3]||"").trim(),o=(l[4]||"").trim(),a=(l[5]||"").trim());s=s||"$index";const c=r(e,a)||[],d=n=>{const r=t.cloneNode(!0),a=Object.create(e);a[s]=n,a[o]=c[n],r.removeAttribute(`${this._prefix}repeat`),t.parentNode.insertBefore(r,t),Array.from(r.querySelectorAll("[data-component]")).forEach((e=>e.setAttribute("data-initial-state",JSON.stringify(a)))),i(r,a)};if("length"in c)for(var f=0;f<c.length;f++)d(f);else for(var f in c)c.hasOwnProperty(f)&&d(f);t.parentNode.removeChild(t),t.childNodes&&t.childNodes.length&&(t.innerHTML="")}}),i())},242:(e,t,n)=>{"use strict";n.r(t),n.d(t,{on:()=>s,off:()=>u,trigger:()=>l});const r="CustomEvent"in window&&"function"==typeof window.CustomEvent?(e,t)=>new CustomEvent(e,t):(e,t)=>{const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!0,!0,t),n},i=(e,t)=>function(n){const r=this,i=n.detail||{};e.__events[t].forEach((e=>{e.handler.apply(r,[n].concat(i.args))}))},o=(e,t)=>{e.__events[t]&&e.__events[t].listener&&(e.removeEventListener(t,e.__events[t].listener,"focus"==t||"blur"==t||"mouseenter"==t||"mouseleave"==t),delete e.__events[t])},a=(e,t,n)=>function(r){const i=this,o=r.detail||{};let a=r.target;for(;a&&(a.matches(t)&&(r.delegateTarget=a,n.apply(i,[r].concat(o.args))),a!==e);)a=a.parentNode},s=(e,t,n,r)=>{if(e.__events=e.__events||{},e.__events[t]=e.__events[t]||[],!e.__events[t].length){const n=i(e,t);e.addEventListener(t,n,"focus"==t||"blur"==t||"mouseenter"==t||"mouseleave"==t),e.__events[t].listener=n}n.call?e.__events[t].push({handler:n,callback:n}):e.__events[t].push({handler:a(e,n,r),callback:r})},u=(e,t,n)=>{if(n&&e.__events[t]&&e.__events[t].length){var r=e.__events[t];e.__events[t]=e.__events[t].filter((function(e){return e.callback!=n})),e.__events[t].listener=r.listener,e.__events[t].length||o(e,t)}else o(e,t)},l=(e,t,n)=>{e.dispatchEvent(r(t,{bubbles:!0,detail:n}))}},624:(e,t,n)=>{"use strict";n.r(t),n.d(t,{rAF:()=>r,uuid:()=>i,stripTemplateTag:()=>o,dup:()=>a,createTemplate:()=>s});const r=e=>{(requestAnimationFrame||setTimeout)(e,1e3/60)},i=()=>"xxxxxxxx".replace(/[xy]/g,(e=>{const t=8*Math.random()|0;return("x"==e?t:3&t|8).toString(8)})),o=e=>{Array.from(e.querySelectorAll("template")).forEach((e=>{e.parentNode.replaceChild(e.content,e)}))},a=e=>JSON.parse(JSON.stringify(e)),s=(e,t)=>{const n=document.createElement("div");return n.innerHTML=e,o(n),Array.from(n.querySelectorAll("[data-component]")).forEach((e=>{const n=e.getAttribute("tplid"),r=t[n];r&&(e.outerHTML=r)})),n.innerHTML}},436:(e,t,n)=>{"use strict";n.r(t),n.d(t,{publish:()=>o,subscribe:()=>a,unsubscribe:()=>s});const r={},i={},o=(e,t)=>{i[e]=Object.assign({},i[e],t),r[e]&&r[e].forEach((e=>e(t)))},a=(e,t)=>{r[e]=r[e]||[],r[e].push(t),e in i&&t(i[e])},s=e=>{r[e.name]=(r[e.name]||[]).filter((t=>t!=e.method)),r[e.name].length||(delete r[e.name],delete i[e.name])}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});var t=n(491),i=n(610),o=n(126),a=n(602),s=n(624),u={};e.default={start:function(){var e=document.body;(0,s.stripTemplateTag)(e),i.Scanner.observe(e,l,c),i.Scanner.scan(e,l)},register:function(e,t,n){void 0===n&&(n={}),u[e]={name:e,module:t,dependencies:n}}};var l=function(e){var n=(0,t.Element)(e);e.dataset.component.split(/\s/).forEach((function(t){var r=u[t];if(r){var i=r.module,a=r.dependencies;n.model=Object.assign({},i.model?(0,s.dup)(i.model):null,n.model);var l=(0,o.Component)({name:t,element:e,dependencies:a,ElementInterface:n}),c=i.default(l);c&&c.then&&n.promises.push(c),l.__initialize(),n.view=i.view||n.view,n.instances[t]={methods:{}}}else console.warn("Jails - Module ".concat(t," not registered"))})),n.update()},c=function(e){var t=a.Instances.get(e);a.Instances.get(e)&&t.dispose()}})(),r})()}));
2
- //# sourceMappingURL=jails.js.map