@knowark/componarkjs 1.13.4 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +57 -45
  2. package/lib/base/component/component.js +142 -20
  3. package/lib/base/component/component.test.js +753 -374
  4. package/lib/base/component/index.js +3 -0
  5. package/lib/base/styles/index.js +4 -1
  6. package/lib/base/utils/define.js +30 -7
  7. package/lib/base/utils/define.test.js +129 -42
  8. package/lib/base/utils/format.js +12 -6
  9. package/lib/base/utils/format.test.js +16 -16
  10. package/lib/base/utils/helpers.js +42 -9
  11. package/lib/base/utils/helpers.test.js +134 -115
  12. package/lib/base/utils/index.js +1 -0
  13. package/lib/base/utils/slots.js +3 -2
  14. package/lib/base/utils/slots.test.js +38 -38
  15. package/lib/base/utils/uuid.js +1 -1
  16. package/lib/base/utils/uuid.test.js +13 -13
  17. package/lib/components/audio/components/audio.js +36 -3
  18. package/lib/components/audio/components/audio.test.js +120 -90
  19. package/lib/components/audio/index.js +1 -0
  20. package/lib/components/audio/styles/index.js +5 -1
  21. package/lib/components/camera/components/camera.js +15 -0
  22. package/lib/components/camera/components/camera.test.js +96 -91
  23. package/lib/components/camera/index.js +1 -0
  24. package/lib/components/camera/styles/index.js +5 -1
  25. package/lib/components/capture/components/capture.js +48 -4
  26. package/lib/components/capture/components/capture.test.js +165 -97
  27. package/lib/components/capture/index.js +1 -0
  28. package/lib/components/droparea/components/droparea-preview.js +114 -19
  29. package/lib/components/droparea/components/droparea-preview.test.js +344 -80
  30. package/lib/components/droparea/components/droparea.js +82 -6
  31. package/lib/components/droparea/components/droparea.test.js +309 -299
  32. package/lib/components/droparea/index.js +1 -0
  33. package/lib/components/droparea/styles/index.js +5 -1
  34. package/lib/components/emit/components/emit.js +34 -4
  35. package/lib/components/emit/components/emit.test.js +192 -134
  36. package/lib/components/emit/index.js +1 -0
  37. package/lib/components/index.js +2 -1
  38. package/lib/components/list/components/item.js +6 -0
  39. package/lib/components/list/components/item.test.js +69 -68
  40. package/lib/components/list/components/list.js +51 -7
  41. package/lib/components/list/components/list.test.js +358 -227
  42. package/lib/components/list/index.js +1 -0
  43. package/lib/components/paginator/components/paginator.js +34 -8
  44. package/lib/components/paginator/components/paginator.test.js +146 -143
  45. package/lib/components/paginator/index.js +1 -0
  46. package/lib/components/paginator/styles/index.js +5 -1
  47. package/lib/components/spinner/components/spinner.js +10 -0
  48. package/lib/components/spinner/components/spinner.test.js +36 -41
  49. package/lib/components/spinner/index.js +1 -0
  50. package/lib/components/spinner/styles/index.js +5 -1
  51. package/lib/components/splitview/components/splitview.detail.js +10 -1
  52. package/lib/components/splitview/components/splitview.detail.test.js +75 -73
  53. package/lib/components/splitview/components/splitview.js +54 -11
  54. package/lib/components/splitview/components/splitview.master.js +37 -2
  55. package/lib/components/splitview/components/splitview.master.test.js +52 -52
  56. package/lib/components/splitview/components/splitview.test.js +135 -31
  57. package/lib/components/splitview/index.js +1 -0
  58. package/lib/components/translate/components/translate.js +65 -14
  59. package/lib/components/translate/components/translate.test.js +658 -131
  60. package/lib/components/translate/index.js +1 -0
  61. package/lib/index.js +3 -0
  62. package/package.json +4 -27
  63. package/scripts/node-test-setup.js +94 -0
  64. package/tsconfig.json +1 -1
  65. package/types/base/component/component.d.ts +43 -8
  66. package/types/base/component/component.d.ts.map +1 -1
  67. package/types/base/component/index.d.ts +4 -6
  68. package/types/base/component/index.d.ts.map +1 -1
  69. package/types/base/styles/index.d.ts +3 -2
  70. package/types/base/styles/index.d.ts.map +1 -1
  71. package/types/base/utils/define.d.ts +3 -2
  72. package/types/base/utils/define.d.ts.map +1 -1
  73. package/types/base/utils/format.d.ts +12 -6
  74. package/types/base/utils/format.d.ts.map +1 -1
  75. package/types/base/utils/helpers.d.ts +27 -7
  76. package/types/base/utils/helpers.d.ts.map +1 -1
  77. package/types/base/utils/slots.d.ts +8 -10
  78. package/types/base/utils/slots.d.ts.map +1 -1
  79. package/types/base/utils/uuid.d.ts +1 -1
  80. package/types/base/utils/uuid.d.ts.map +1 -1
  81. package/types/components/audio/components/audio.d.ts +23 -9
  82. package/types/components/audio/components/audio.d.ts.map +1 -1
  83. package/types/components/audio/styles/index.d.ts +3 -2
  84. package/types/components/audio/styles/index.d.ts.map +1 -1
  85. package/types/components/camera/components/camera.d.ts +11 -3
  86. package/types/components/camera/components/camera.d.ts.map +1 -1
  87. package/types/components/camera/styles/index.d.ts +3 -2
  88. package/types/components/camera/styles/index.d.ts.map +1 -1
  89. package/types/components/capture/components/capture.d.ts +23 -3
  90. package/types/components/capture/components/capture.d.ts.map +1 -1
  91. package/types/components/droparea/components/droparea-preview.d.ts +64 -11
  92. package/types/components/droparea/components/droparea-preview.d.ts.map +1 -1
  93. package/types/components/droparea/components/droparea.d.ts +58 -13
  94. package/types/components/droparea/components/droparea.d.ts.map +1 -1
  95. package/types/components/droparea/styles/index.d.ts +3 -2
  96. package/types/components/droparea/styles/index.d.ts.map +1 -1
  97. package/types/components/emit/components/emit.d.ts +15 -3
  98. package/types/components/emit/components/emit.d.ts.map +1 -1
  99. package/types/components/list/components/item.d.ts +8 -1
  100. package/types/components/list/components/item.d.ts.map +1 -1
  101. package/types/components/list/components/list.d.ts +23 -5
  102. package/types/components/list/components/list.d.ts.map +1 -1
  103. package/types/components/paginator/components/paginator.d.ts +32 -8
  104. package/types/components/paginator/components/paginator.d.ts.map +1 -1
  105. package/types/components/paginator/styles/index.d.ts +3 -2
  106. package/types/components/paginator/styles/index.d.ts.map +1 -1
  107. package/types/components/spinner/components/spinner.d.ts +14 -3
  108. package/types/components/spinner/components/spinner.d.ts.map +1 -1
  109. package/types/components/spinner/styles/index.d.ts +3 -2
  110. package/types/components/spinner/styles/index.d.ts.map +1 -1
  111. package/types/components/splitview/components/splitview.d.ts +22 -4
  112. package/types/components/splitview/components/splitview.d.ts.map +1 -1
  113. package/types/components/splitview/components/splitview.detail.d.ts +12 -2
  114. package/types/components/splitview/components/splitview.detail.d.ts.map +1 -1
  115. package/types/components/splitview/components/splitview.master.d.ts +12 -1
  116. package/types/components/splitview/components/splitview.master.d.ts.map +1 -1
  117. package/types/components/translate/components/translate.d.ts +44 -10
  118. package/types/components/translate/components/translate.d.ts.map +1 -1
@@ -1 +1,2 @@
1
+ /** Translation component. */
1
2
  export { Translate } from './components/translate.js'
package/lib/index.js CHANGED
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @module componark
3
+ */
1
4
  export * from './base/index.js'
2
5
  export * from './components/index.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowark/componarkjs",
3
- "version": "1.13.4",
3
+ "version": "1.14.1",
4
4
  "author": "Knowark",
5
5
  "description": "Knowark's Web Components Library",
6
6
  "license": "ISC",
@@ -8,7 +8,8 @@
8
8
  "main": "lib/index.js",
9
9
  "types": "types/index.d.ts",
10
10
  "scripts": {
11
- "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' npx jest --coverage",
11
+ "test": "NODE_OPTIONS='--no-warnings' node --test --experimental-test-coverage --test-coverage-include='lib/**/*.js' --test-coverage-exclude='**/*.test.js' --import ./scripts/node-test-setup.js",
12
+ "types": "tsc -p tsconfig.json --emitDeclarationOnly false --noEmit --checkJs false",
12
13
  "dev": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' webpack serve --mode development --env development",
13
14
  "prod": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' webpack --mode production --env production"
14
15
  },
@@ -23,14 +24,10 @@
23
24
  "devDependencies": {
24
25
  "@knowark/injectarkjs": "^0.10.6",
25
26
  "@knowark/routarkjs": "^0.6.6",
26
- "@types/jest": "^29.5.11",
27
27
  "clean-webpack-plugin": "^4.0.0",
28
28
  "copy-webpack-plugin": "^12.0.2",
29
29
  "file-loader": "^6.2.0",
30
30
  "html-webpack-plugin": "^5.6.0",
31
- "jest": "^29.7.0",
32
- "jest-canvas-mock": "^2.5.2",
33
- "jest-environment-jsdom": "^29.7.0",
34
31
  "jsdom": "^24.0.0",
35
32
  "npm-check-updates": "^16.14.12",
36
33
  "webpack": "^5.90.0",
@@ -42,27 +39,7 @@
42
39
  },
43
40
  "standard": {
44
41
  "env": [
45
- "jest"
46
- ]
47
- },
48
- "jest": {
49
- "verbose": true,
50
- "clearMocks": true,
51
- "testEnvironment": "jsdom",
52
- "transform": {},
53
- "setupFiles": [
54
- "jest-canvas-mock"
55
- ],
56
- "moduleDirectories": [
57
- "node_modules",
58
- "lib"
59
- ],
60
- "collectCoverageFrom": [
61
- "**/lib/**",
62
- "!**/showcase/**"
63
- ],
64
- "transformIgnorePatterns": [
65
- "node_modules/(?!@knowark)"
42
+ "node"
66
43
  ]
67
44
  },
68
45
  "imports": {
@@ -0,0 +1,94 @@
1
+ import { JSDOM } from 'jsdom'
2
+
3
+ const dom = new JSDOM('<!doctype html><html><head></head><body></body></html>', {
4
+ url: 'http://localhost'
5
+ })
6
+
7
+ const { window } = dom
8
+
9
+ globalThis.window = window
10
+ globalThis.document = window.document
11
+ globalThis.self = window
12
+ globalThis.global = globalThis
13
+ globalThis.addEventListener = window.addEventListener.bind(window)
14
+ globalThis.removeEventListener = window.removeEventListener.bind(window)
15
+ globalThis.dispatchEvent = window.dispatchEvent.bind(window)
16
+
17
+ Object.defineProperty(globalThis, 'navigator', {
18
+ configurable: true,
19
+ value: window.navigator
20
+ })
21
+
22
+ const forceGlobals = [
23
+ 'Event',
24
+ 'CustomEvent',
25
+ 'InputEvent',
26
+ 'MouseEvent',
27
+ 'KeyboardEvent',
28
+ 'EventTarget',
29
+ 'HTMLElement',
30
+ 'Element',
31
+ 'Node',
32
+ 'NodeList',
33
+ 'DocumentFragment',
34
+ 'DOMParser',
35
+ 'MutationObserver',
36
+ 'CustomElementRegistry',
37
+ 'CSSStyleSheet',
38
+ 'URL',
39
+ 'File',
40
+ 'Blob',
41
+ 'MediaStream'
42
+ ]
43
+
44
+ for (const key of forceGlobals) {
45
+ if (!window[key]) continue
46
+ globalThis[key] = window[key]
47
+ }
48
+
49
+ for (const key of Object.getOwnPropertyNames(window)) {
50
+ if (key in globalThis) continue
51
+ globalThis[key] = window[key]
52
+ }
53
+
54
+ if (!globalThis.requestAnimationFrame) {
55
+ globalThis.requestAnimationFrame = (callback) => {
56
+ return setTimeout(() => callback(Date.now()), 0)
57
+ }
58
+ }
59
+
60
+ if (!globalThis.cancelAnimationFrame) {
61
+ globalThis.cancelAnimationFrame = (id) => clearTimeout(id)
62
+ }
63
+
64
+ if (globalThis.HTMLCanvasElement) {
65
+ globalThis.HTMLCanvasElement.prototype.getContext = () => ({
66
+ drawImage: () => {},
67
+ clearRect: () => {},
68
+ fillRect: () => {},
69
+ getImageData: () => ({ data: [] }),
70
+ putImageData: () => {},
71
+ createImageData: () => [],
72
+ setTransform: () => {},
73
+ resetTransform: () => {},
74
+ fillText: () => {},
75
+ measureText: () => ({ width: 0 }),
76
+ save: () => {},
77
+ restore: () => {},
78
+ beginPath: () => {},
79
+ moveTo: () => {},
80
+ lineTo: () => {},
81
+ closePath: () => {},
82
+ stroke: () => {},
83
+ translate: () => {},
84
+ scale: () => {},
85
+ rotate: () => {},
86
+ arc: () => {},
87
+ fill: () => {}
88
+ })
89
+ globalThis.HTMLCanvasElement.prototype.toDataURL = () => 'data:image/png;base64,mock'
90
+ }
91
+
92
+ if (!globalThis.URL.createObjectURL) {
93
+ globalThis.URL.createObjectURL = () => 'mock://data/url'
94
+ }
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "module": "nodenext",
6
6
  "moduleResolution": "nodenext",
7
7
  "allowJs": true,
8
- "checkJs": true,
8
+ "checkJs": false,
9
9
  "baseUrl": "lib",
10
10
  "declaration": true,
11
11
  "emitDeclarationOnly": true,
@@ -1,11 +1,22 @@
1
+ /**
2
+ * Base composable UI component.
3
+ * @extends {globalThis.HTMLElement}
4
+ */
1
5
  export class Component extends HTMLElement {
2
6
  /**
3
- * @param {string} tag
7
+ * Register a custom element and optional CSS for the same tag.
8
+ * @param {string} tagName
4
9
  * @param {CustomElementConstructor} element
5
- * @param {string} styles **/
6
- static define(tag: string, element: CustomElementConstructor, styles?: string): void;
10
+ * @param {string} [styles]
11
+ * @returns {void}
12
+ */
13
+ static define(tagName: string, element: CustomElementConstructor, styles?: string): void;
7
14
  binding: string;
8
15
  local: {};
16
+ _isConnected: boolean;
17
+ _cleanupCallbacks: any[];
18
+ _needsBinding: boolean;
19
+ global: typeof globalThis;
9
20
  /**
10
21
  * @param {object} styleMap
11
22
  * @return {string} **/
@@ -16,18 +27,24 @@ export class Component extends HTMLElement {
16
27
  init(context?: object): Component;
17
28
  /** @return {string[]} */
18
29
  reflectedProperties(): string[];
19
- get slots(): {
20
- [x: string]: HTMLElement[];
21
- };
30
+ get slots(): Record<string, HTMLElement[]>;
22
31
  /** @param {string} content */
23
32
  set content(content: string);
24
33
  /** @return {string} */
25
34
  get content(): string;
35
+ /** @returns {void} */
26
36
  connectedCallback(): void;
37
+ /** @returns {void} */
38
+ disconnectedCallback(): void;
39
+ /**
40
+ * @param {Function} callback
41
+ * @return {Function} */
42
+ registerCleanup(callback: Function): Function;
27
43
  /** @return {Component} */
28
44
  render(): Component;
29
- /** @param {object} context */
30
- load(context?: object): Promise<void>;
45
+ /** @param {object} context
46
+ * @returns {void | Promise<void>} */
47
+ load(context?: object): void | Promise<void>;
31
48
  /**
32
49
  * @param {string} selectors
33
50
  * @return {Component} */
@@ -44,5 +61,23 @@ export class Component extends HTMLElement {
44
61
  * @param {string} resource
45
62
  * @return {any} */
46
63
  resolve(resource: string): any;
64
+ /**
65
+ * @param {any} detail
66
+ * @param {string} phase
67
+ * @return {Error} */
68
+ _enhanceError(detail: any, phase: string): Error;
69
+ /** @returns {void} */
70
+ _cleanup(): void;
71
+ /**
72
+ * Creates an event object for dispatch.
73
+ * @param {string} type
74
+ * @param {any} detail
75
+ * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]
76
+ * @returns {CustomEvent}
77
+ */
78
+ _createEvent(type: string, detail: any, options?: {
79
+ bubbles?: boolean;
80
+ cancelable?: boolean;
81
+ }): CustomEvent;
47
82
  }
48
83
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../lib/base/component/component.js"],"names":[],"mappings":"AAIA;IAQE;;;iCAG6B;IAC7B,mBAHW,MAAM,WACN,wBAAwB,WACxB,MAAM,QAGhB;IAXC,gBAAuB;IACvB,UAAe;IAYjB;;2BAEuB;IACvB,qBAFW,MAAM,GACL,MAAM,CAGjB;IAED;;6BAEyB;IACzB,eAFW,MAAM,GACL,SAAS,CAGpB;IAED,yBAAyB;IACzB,uBADa,MAAM,EAAE,CAGpB;IAED;;MAEC;IAED,8BAA8B;IAC9B,6BAEC;IAED,uBAAuB;IACvB,sBAEC;IAED,0BASC;IAED,0BAA0B;IAC1B,UADa,SAAS,CAKrB;IAED,8BAA8B;IAC9B,eADY,MAAM,iBACU;IAE5B;;6BAEyB;IACzB,kBAFW,MAAM,GACL,SAAS,CAGpB;IAED;;yCAEqC;IACrC,qBAFW,MAAM,GACL,UAAU,CAAC,SAAS,CAAC,CAKhC;IAED;;6BAEyB;IACzB,WAFW,MAAM,UACN,GAAG,QASb;IAED;;uBAEmB;IACnB,kBAFW,MAAM,GACL,GAAG,CASd;CACF"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../lib/base/component/component.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IAYE;;;;;;OAMG;IACH,uBALW,MAAM,WACN,wBAAwB,WACxB,MAAM,GACJ,IAAI,CAIhB;IAlBC,gBAAuB;IACvB,UAAe;IACf,sBAAyB;IACzB,yBAA2B;IAC3B,uBAAyB;IACzB,0BAAwB;IAe1B;;2BAEuB;IACvB,qBAFW,MAAM,GACL,MAAM,CAGjB;IAED;;6BAEyB;IACzB,eAFW,MAAM,GACL,SAAS,CAGpB;IAED,yBAAyB;IACzB,uBADa,MAAM,EAAE,CAGpB;IAED,2CAEC;IAED,8BAA8B;IAC9B,6BAGC;IAED,uBAAuB;IACvB,sBAEC;IAED,sBAAsB;IACtB,qBADc,IAAI,CAqBjB;IAED,sBAAsB;IACtB,wBADc,IAAI,CAIjB;IAED;;4BAEwB;IACxB,8CASC;IAED,0BAA0B;IAC1B,UADa,SAAS,CAQrB;IAED;yCACqC;IACrC,eAFY,MAAM,GACL,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CACX;IAEtB;;6BAEyB;IACzB,kBAFW,MAAM,GACL,SAAS,CAGpB;IAED;;yCAEqC;IACrC,qBAFW,MAAM,GACL,UAAU,CAAC,SAAS,CAAC,CAKhC;IAED;;6BAEyB;IACzB,WAFW,MAAM,UACN,GAAG,QAMb;IAED;;uBAEmB;IACnB,kBAFW,MAAM,GACL,GAAG,CAQd;IAED;;;yBAGqB;IACrB,sBAHW,GAAG,SACH,MAAM,GACL,KAAK,CAYhB;IAED,sBAAsB;IACtB,YADc,IAAI,CAYjB;IAED;;;;;;OAMG;IACH,mBALW,MAAM,UACN,GAAG,YACH;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GACzC,WAAW,CAkBvB;CACF"}
@@ -1,8 +1,6 @@
1
1
  export { Component } from "./component.js";
2
- export const css: (template: {
3
- raw: readonly string[] | ArrayLike<string>;
4
- }, ...substitutions: any[]) => string;
5
- export const html: (template: {
6
- raw: readonly string[] | ArrayLike<string>;
7
- }, ...substitutions: any[]) => string;
2
+ /** @type {typeof String.raw} */
3
+ export const css: typeof String.raw;
4
+ /** @type {typeof String.raw} */
5
+ export const html: typeof String.raw;
8
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/component/index.js"],"names":[],"mappings":";AACA;;sCAA6B;AAC7B;;sCAA8B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/component/index.js"],"names":[],"mappings":";AAEA,gCAAgC;AAChC,kBADW,OAAO,MAAM,CAAC,GAAG,CACC;AAC7B,gCAAgC;AAChC,mBADW,OAAO,MAAM,CAAC,GAAG,CACE"}
@@ -1,3 +1,4 @@
1
- export default styles;
2
- import styles from './styles.js';
1
+ export default stylesText;
2
+ /** @type {string} */
3
+ declare const stylesText: string;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/styles/index.js"],"names":[],"mappings":";mBAAmB,aAAa"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/styles/index.js"],"names":[],"mappings":";AAEA,qBAAqB;AACrB,0BADW,MAAM,CACQ"}
@@ -1,5 +1,6 @@
1
1
  /** @param {string} tag
2
2
  * @param {CustomElementConstructor} element
3
- * @param {string} styles **/
4
- export function define(tag: string, element: CustomElementConstructor, styles?: string): CSSStyleSheet[];
3
+ * @param {string} [styles]
4
+ * @returns {CSSStyleSheet|HTMLStyleElement|undefined} */
5
+ export function define(tag: string, element: CustomElementConstructor, styles?: string): CSSStyleSheet | HTMLStyleElement | undefined;
5
6
  //# sourceMappingURL=define.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/define.js"],"names":[],"mappings":"AAEA;;6BAE6B;AAC7B,4BAHY,MAAM,WACP,wBAAwB,WACxB,MAAM,mBAehB"}
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/define.js"],"names":[],"mappings":"AAKA;;;yDAGyD;AACzD,4BAJY,MAAM,WACP,wBAAwB,WACxB,MAAM,GACJ,aAAa,GAAC,gBAAgB,GAAC,SAAS,CAkCpD"}
@@ -1,13 +1,19 @@
1
1
  /**
2
- * Convert Strings from camelCase to kebab-case
3
- * @param {string} input @returns {string} */
2
+ * Convert Strings from camelCase to kebab-case.
3
+ * @param {string} input
4
+ * @returns {string}
5
+ */
4
6
  export function camelToKebab(input: string): string;
5
7
  /**
6
- * Convert Strings from kebab-case to camelCase
7
- * @param {string} input @returns {string} */
8
+ * Convert Strings from kebab-case to camelCase.
9
+ * @param {string} input
10
+ * @returns {string}
11
+ */
8
12
  export function kebabToCamel(input: string): string;
9
13
  /**
10
- * Convert Strings from snake to camelCase
11
- * @param {string} input @returns {string} */
14
+ * Convert Strings from snake to camelCase.
15
+ * @param {string} input
16
+ * @returns {string}
17
+ */
12
18
  export function snakeToCamel(input: string): string;
13
19
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/format.js"],"names":[],"mappings":"AAAA;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAGxC;AAED;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAKxC;AAED;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAKxC"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/format.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,oCAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;;GAIG;AACH,oCAHW,MAAM,GACJ,MAAM,CAMlB"}
@@ -1,11 +1,31 @@
1
- /** @param {HTMLElement} self */
2
- export function listen(self: HTMLElement): void;
1
+ /**
2
+ * Binds declarative event handlers in descendant nodes for a component.
3
+ * @param {Component|HTMLElement} self
4
+ * @returns {void}
5
+ */
6
+ export function listen(self: Component | HTMLElement): void;
3
7
  /** @param {HTMLElement} self @param {string[]} properties */
4
8
  export function reflect(self: HTMLElement, properties: string[]): void;
5
- /** @param {object} object @param {string} path @param {any} value */
6
- export function set(object: object, path: string, value: any): void;
7
- /** @param {object} object @param {string} path @param {any} fallback */
8
- export function get(object: object, path: string, fallback: any): any;
9
- /** @param {object} object @return {string} */
9
+ /**
10
+ * Sets a nested property value by object path.
11
+ * @param {unknown} object
12
+ * @param {string} path
13
+ * @param {any} value
14
+ * @returns {void}
15
+ */
16
+ export function set(object: unknown, path: string, value: any): void;
17
+ /**
18
+ * Reads a nested property value by path.
19
+ * @param {unknown} object
20
+ * @param {string} path
21
+ * @param {any} fallback
22
+ * @returns {any}
23
+ */
24
+ export function get(object: unknown, path: string, fallback: any): any;
25
+ /** @param {object} object
26
+ * @return {string}
27
+ * @description Returns truthy CSS class names from object values.
28
+ */
10
29
  export function keys(object: object): string;
30
+ import type { Component } from '../component/component.js';
11
31
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/helpers.js"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,6BADY,WAAW,QAyDtB;AAeD,6DAA6D;AAC7D,8BADY,WAAW,cAAe,MAAM,EAAE,QAiB7C;AAUD,qEAAqE;AACrE,4BADY,MAAM,QAAiB,MAAM,SAAe,GAAG,QAS1D;AAED,wEAAwE;AACxE,4BADY,MAAM,QAAiB,MAAM,YAAe,GAAG,OAM1D;AAED,8CAA8C;AAC9C,6BADY,MAAM,GAAkB,MAAM,CAIzC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/helpers.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,6BAHW,SAAS,GAAC,WAAW,GACnB,IAAI,CA6DhB;AAmBD,6DAA6D;AAC7D,8BADY,WAAW,cAAe,MAAM,EAAE,QAiB7C;AAUD;;;;;;GAMG;AACH,4BALW,OAAO,QACP,MAAM,SACN,GAAG,GACD,IAAI,CAWhB;AAED;;;;;;GAMG;AACH,4BALW,OAAO,QACP,MAAM,YACN,GAAG,GACD,GAAG,CAUf;AAED;;;GAGG;AACH,6BAJY,MAAM,GACN,MAAM,CAMjB;+BA5J6B,2BAA2B"}
@@ -1,15 +1,13 @@
1
1
  /**
2
+ * Groups child nodes by slot name.
2
3
  * @param {HTMLElement} container
3
- * @return {Object<string, Array<HTMLElement>>}
4
- * */
5
- export function getSlots(container: HTMLElement): {
6
- [x: string]: Array<HTMLElement>;
7
- };
4
+ * @returns {Record<string, HTMLElement[]>}
5
+ */
6
+ export function getSlots(container: HTMLElement): Record<string, HTMLElement[]>;
8
7
  /**
8
+ * Groups child nodes by slot name.
9
9
  * @param {HTMLElement} container
10
- * @return {Object<string, Array<HTMLElement>>}
11
- * */
12
- export function slot(container: HTMLElement): {
13
- [x: string]: Array<HTMLElement>;
14
- };
10
+ * @returns {Record<string, HTMLElement[]>}
11
+ */
12
+ export function slot(container: HTMLElement): Record<string, HTMLElement[]>;
15
13
  //# sourceMappingURL=slots.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/slots.js"],"names":[],"mappings":"AAAA;;;KAGK;AACL,oCAHW,WAAW,GACV;QAAO,MAAM,GAAE,KAAK,CAAC,WAAW,CAAC;CAAC,CAa7C;AAfD;;;KAGK;AACL,gCAHW,WAAW,GACV;QAAO,MAAM,GAAE,KAAK,CAAC,WAAW,CAAC;CAAC,CAa7C"}
1
+ {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/slots.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oCAHW,WAAW,GACT,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAazC;AAhBD;;;;GAIG;AACH,gCAHW,WAAW,GACT,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAazC"}
@@ -1,3 +1,3 @@
1
- /** @returns {string} */
1
+ /** @returns {string} Generated RFC-4122-like identifier. */
2
2
  export function uuid(): string;
3
3
  //# sourceMappingURL=uuid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/uuid.js"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,wBADc,MAAM,CAQnB"}
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/uuid.js"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,wBADc,MAAM,CAQnB"}
@@ -1,18 +1,32 @@
1
+ /**
2
+ * Audio recorder component.
3
+ * Emits:
4
+ * - `error` with `Error` detail on capture/rendering issues.
5
+ */
1
6
  export class Audio extends Component {
2
- init(context?: {}): Component;
3
- status: string;
4
- dataURL: any;
5
- timerId: NodeJS.Timer;
6
- recorder: any;
7
- global: any;
8
- /** @param {Event} event */
7
+ /** @param {object} context
8
+ * @returns {Audio} */
9
+ init(context?: object): Audio;
10
+ /** @type {'idle'|'recording'|'done'} */
11
+ status: "idle" | "recording" | "done";
12
+ dataURL: string | ArrayBuffer;
13
+ timerId: NodeJS.Timeout;
14
+ recorder: MediaRecorder;
15
+ objectURL: string;
16
+ /** @param {Event} event
17
+ * @returns {Promise<void>} */
9
18
  start(event: Event): Promise<void>;
10
- /** @param {Event} event */
19
+ /** @param {Event} event
20
+ * @returns {void} */
11
21
  stop(event: Event): void;
22
+ /** @returns {void} */
12
23
  reset(): void;
13
- _time(): NodeJS.Timer;
24
+ /** @returns {ReturnType<typeof setInterval>} Interval handle. */
25
+ _time(): ReturnType<typeof setInterval>;
14
26
  /** @param {any} event */
15
27
  _onData(event: any): void;
28
+ /** @returns {void} */
29
+ _revokeObjectURL(): void;
16
30
  }
17
31
  import { Component } from '#base/index.js';
18
32
  //# sourceMappingURL=audio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../../lib/components/audio/components/audio.js"],"names":[],"mappings":"AAIA;IACE,8BAQC;IAPC,eAAoB;IACpB,aAAmB;IACnB,sBAAmB;IACnB,cAAoB;IACpB,YAAsC;IAoCxC,2BAA2B;IAC3B,aADY,KAAK,iBAahB;IAED,2BAA2B;IAC3B,YADY,KAAK,QAQhB;IAED,cAMC;IAED,sBAYC;IAED,yBAAyB;IACzB,eADY,GAAG,QAQd;CACF;0BAtGyB,gBAAgB"}
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../../lib/components/audio/components/audio.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE;2BACuB;IACvB,eAFY,MAAM,GACJ,KAAK,CAWlB;IATC,wCAAwC;IACxC,QADW,MAAM,GAAC,WAAW,GAAC,MAAM,CAChB;IACpB,8BAAmB;IACnB,wBAAmB;IACnB,wBAAoB;IACpB,kBAAqB;IAqCvB;mCAC+B;IAC/B,aAFY,KAAK,GACH,OAAO,CAAC,IAAI,CAAC,CAa1B;IAED;0BACsB;IACtB,YAFY,KAAK,GACH,IAAI,CAQjB;IAED,sBAAsB;IACtB,SADc,IAAI,CASjB;IAUD,iEAAiE;IACjE,SADc,UAAU,CAAC,OAAO,WAAW,CAAC,CAa3C;IAED,yBAAyB;IACzB,eADY,GAAG,QAUd;IAED,sBAAsB;IACtB,oBADc,IAAI,CAKjB;CACF;0BAtIyB,gBAAgB"}
@@ -1,3 +1,4 @@
1
- export default styles;
2
- import styles from './ark.css.js';
1
+ export default stylesText;
2
+ /** @type {string} */
3
+ declare const stylesText: string;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/audio/styles/index.js"],"names":[],"mappings":";mBAAmB,cAAc"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/audio/styles/index.js"],"names":[],"mappings":";AAEA,qBAAqB;AACrB,0BADW,MAAM,CACQ"}
@@ -1,14 +1,22 @@
1
+ /**
2
+ * Camera capture component.
3
+ */
1
4
  export class Camera extends Component {
2
- init(context?: {}): Component;
5
+ /** @param {object} context
6
+ * @returns {Camera} */
7
+ init(context?: object): Camera;
3
8
  width: any;
4
9
  height: any;
5
10
  facingMode: any;
6
- global: any;
7
11
  /** @returns {string} */
8
12
  dataURL(width?: any, height?: any): string;
13
+ /** @returns {Promise<void>} */
9
14
  start(): Promise<void>;
15
+ /** @returns {void} */
10
16
  stop(): void;
11
- setCameraOrientation(facingMode: any): Promise<void>;
17
+ /** @param {string} facingMode
18
+ * @returns {Promise<void>} */
19
+ setCameraOrientation(facingMode: string): Promise<void>;
12
20
  /** @returns {HTMLVideoElement} */
13
21
  get video(): HTMLVideoElement;
14
22
  /** @returns {HTMLCanvasElement} */
@@ -1 +1 @@
1
- {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../../lib/components/camera/components/camera.js"],"names":[],"mappings":"AAIA;IACE,8BAOC;IANC,WAA+C;IAC/C,YAAkD;IAClD,gBAAiE;IACjE,YAAsC;IAyBxC,wBAAwB;IACxB,oCADc,MAAM,CAanB;IAED,uBAWC;IAED,aAIC;IAED,qDAIC;IAED,kCAAkC;IAClC,8BAEC;IAED,mCAAmC;IACnC,gCAEC;CACF;0BAnFyB,gBAAgB"}
1
+ {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../../lib/components/camera/components/camera.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACE;4BACwB;IACxB,eAFY,MAAM,GACJ,MAAM,CAQnB;IANC,WAA+C;IAC/C,YAAkD;IAClD,gBAAiE;IA0BnE,wBAAwB;IACxB,oCADc,MAAM,CAanB;IAED,+BAA+B;IAC/B,SADc,OAAO,CAAC,IAAI,CAAC,CAY1B;IAED,sBAAsB;IACtB,QADc,IAAI,CAKjB;IAED;mCAC+B;IAC/B,iCAFY,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAK1B;IAQD,kCAAkC;IAClC,8BAEC;IAED,mCAAmC;IACnC,gCAEC;CACF;0BAlGyB,gBAAgB"}
@@ -1,3 +1,4 @@
1
- export default styles;
2
- import styles from './ark.css.js';
1
+ export default stylesText;
2
+ /** @type {string} */
3
+ declare const stylesText: string;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/camera/styles/index.js"],"names":[],"mappings":";mBAAmB,cAAc"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/camera/styles/index.js"],"names":[],"mappings":";AAEA,qBAAqB;AACrB,0BADW,MAAM,CACQ"}
@@ -1,10 +1,30 @@
1
+ /** Template-driven renderer component. */
1
2
  export class Capture extends Component {
2
3
  receive: string;
4
+ /** @param {object} context
5
+ * @returns {Capture} */
6
+ init(context?: object): Capture;
3
7
  source: any;
4
8
  template: any;
5
- handle(event: any): void;
6
- _format(template: any): (data: any) => any;
7
- _pop(selector: any): any;
9
+ /** @param {{detail:any}} event */
10
+ handle(event: {
11
+ detail: any;
12
+ }): void;
13
+ /**
14
+ * @param {string} template
15
+ * @returns {(data: any) => string}
16
+ */
17
+ _format(template: string): (data: any) => string;
18
+ /**
19
+ * @param {string} selector
20
+ * @returns {HTMLElement|null}
21
+ */
22
+ _pop(selector: string): HTMLElement | null;
23
+ /**
24
+ * @param {string|null} source
25
+ * @returns {object|null}
26
+ */
27
+ _parseJSON(source: string | null): object | null;
8
28
  }
9
29
  import { Component } from "#base/index.js";
10
30
  //# sourceMappingURL=capture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../../lib/components/capture/components/capture.js"],"names":[],"mappings":"AAGA;IAGI,gBAAqC;IAWrC,YAC8C;IAC9C,cACsC;IAkBxC,yBAGC;IAED,2CAEC;IAED,yBAIC;CACF;0BApDyB,gBAAgB"}
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../../lib/components/capture/components/capture.js"],"names":[],"mappings":"AAGA,0CAA0C;AAC1C;IAGI,gBAAqC;IAQvC;6BACyB;IACzB,eAFY,MAAM,GACJ,OAAO,CASpB;IANC,YAC8C;IAC9C,cACsC;IAkBxC,kCAAkC;IAClC,cADY;QAAC,MAAM,EAAC,GAAG,CAAA;KAAC,QAIvB;IAED;;;OAGG;IACH,kBAHW,MAAM,GACJ,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAqBjC;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,WAAW,GAAC,IAAI,CAM5B;IAED;;;OAGG;IACH,mBAHW,MAAM,GAAC,IAAI,GACT,MAAM,GAAC,IAAI,CAWvB;CACF;0BA/FyB,gBAAgB"}