@ktjs/shared 0.22.2 → 0.22.4
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/dist/index.d.ts +16 -1
- package/dist/index.iife.js +29 -2
- package/dist/index.legacy.js +29 -2
- package/dist/index.mjs +25 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mark the attribute as SVG to handle special cases during rendering.
|
|
3
|
+
*/
|
|
4
|
+
declare const SVG_ATTR_FLAG = "__kt_svg__";
|
|
5
|
+
/**
|
|
6
|
+
* Mark the attribute as MathML to handle special cases during rendering.
|
|
7
|
+
*/
|
|
8
|
+
declare const MATHML_ATTR_FLAG = "__kt_mathml__";
|
|
9
|
+
/**
|
|
10
|
+
* Can be if, else, else-if.
|
|
11
|
+
*/
|
|
12
|
+
declare const DIRV_TYPE: unique symbol;
|
|
13
|
+
|
|
1
14
|
declare const $isArray: (arg: any) => arg is any[];
|
|
2
15
|
declare const $ArrayFrom: {
|
|
3
16
|
<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -18,6 +31,7 @@ declare const $keys: <T>(o: T) => Array<keyof T>;
|
|
|
18
31
|
declare const $defines: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T;
|
|
19
32
|
declare const $define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T;
|
|
20
33
|
declare const $entries: <T>(o: T) => Array<[keyof T, T[keyof T]]>;
|
|
34
|
+
declare const $random: () => number;
|
|
21
35
|
declare const $isThenable: (o: any) => o is Promise<any>;
|
|
22
36
|
|
|
23
37
|
/**
|
|
@@ -93,6 +107,7 @@ type ChangeTriggerField = 'value' | 'checked' | 'selected' | 'valueAsDate' | 'va
|
|
|
93
107
|
|
|
94
108
|
type InputElementTag = 'input' | 'select' | 'textarea';
|
|
95
109
|
|
|
110
|
+
declare const $isNode: (x: any) => boolean;
|
|
96
111
|
/**
|
|
97
112
|
* & Remove `bind` because it is shockingly slower than wrapper
|
|
98
113
|
* & `window.document` is safe because it is not configurable and its setter is undefined
|
|
@@ -141,5 +156,5 @@ declare const emplaceParams: (path: string, params: Record<string, string>) => s
|
|
|
141
156
|
*/
|
|
142
157
|
declare const extractParams: (pattern: string, path: string) => Record<string, string> | null;
|
|
143
158
|
|
|
144
|
-
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $throw, $toString, $warn, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
|
|
159
|
+
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $random, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
|
|
145
160
|
export type { ChangeHandler, ChangeTriggerField, HTMLTag, InputElementTag, MathMLTag, NoTextNodeTag, NonSpecialTags, SVGTag, otherstring };
|
package/dist/index.iife.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
var __ktjs_shared__ = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
// Shared constants
|
|
5
|
+
// Empty for now - can be extended with framework-wide constants
|
|
6
|
+
/**
|
|
7
|
+
* Mark the attribute as SVG to handle special cases during rendering.
|
|
8
|
+
*/
|
|
9
|
+
const SVG_ATTR_FLAG = '__kt_svg__';
|
|
10
|
+
/**
|
|
11
|
+
* Mark the attribute as MathML to handle special cases during rendering.
|
|
12
|
+
*/
|
|
13
|
+
const MATHML_ATTR_FLAG = '__kt_mathml__';
|
|
14
|
+
/**
|
|
15
|
+
* Can be if, else, else-if.
|
|
16
|
+
*/
|
|
17
|
+
const DIRV_TYPE = Symbol('kt-directive-type');
|
|
18
|
+
|
|
4
19
|
// Cached native methods for performance optimization
|
|
5
20
|
const $isArray = Array.isArray;
|
|
6
21
|
const $ArrayFrom = Array.from;
|
|
@@ -12,6 +27,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
12
27
|
const $defines = Object.defineProperties;
|
|
13
28
|
const $define = Object.defineProperty;
|
|
14
29
|
const $entries = Object.entries;
|
|
30
|
+
const $random = Math.random;
|
|
15
31
|
const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
|
|
16
32
|
|
|
17
33
|
// Error handling utilities
|
|
@@ -34,6 +50,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
34
50
|
|
|
35
51
|
// DOM manipulation utilities
|
|
36
52
|
// # dom natives
|
|
53
|
+
const $isNode = (x) => x?.nodeType > 0;
|
|
37
54
|
/**
|
|
38
55
|
* & Remove `bind` because it is shockingly slower than wrapper
|
|
39
56
|
* & `window.document` is safe because it is not configurable and its setter is undefined
|
|
@@ -178,9 +195,14 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
178
195
|
return params;
|
|
179
196
|
};
|
|
180
197
|
|
|
198
|
+
if (typeof Symbol === 'undefined') {
|
|
199
|
+
window.Symbol = function Symbol(description) {
|
|
200
|
+
return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
181
204
|
// Shared utilities and cached native methods for kt.js framework
|
|
182
|
-
|
|
183
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.2' });
|
|
205
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.4' });
|
|
184
206
|
|
|
185
207
|
exports.$ArrayFrom = $ArrayFrom;
|
|
186
208
|
exports.$append = $append;
|
|
@@ -195,11 +217,16 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
195
217
|
exports.$hasOwn = $hasOwn;
|
|
196
218
|
exports.$is = $is;
|
|
197
219
|
exports.$isArray = $isArray;
|
|
220
|
+
exports.$isNode = $isNode;
|
|
198
221
|
exports.$isThenable = $isThenable;
|
|
199
222
|
exports.$keys = $keys;
|
|
223
|
+
exports.$random = $random;
|
|
200
224
|
exports.$throw = $throw;
|
|
201
225
|
exports.$toString = $toString;
|
|
202
226
|
exports.$warn = $warn;
|
|
227
|
+
exports.DIRV_TYPE = DIRV_TYPE;
|
|
228
|
+
exports.MATHML_ATTR_FLAG = MATHML_ATTR_FLAG;
|
|
229
|
+
exports.SVG_ATTR_FLAG = SVG_ATTR_FLAG;
|
|
203
230
|
exports.applyModel = applyModel;
|
|
204
231
|
exports.buildQuery = buildQuery;
|
|
205
232
|
exports.emplaceParams = emplaceParams;
|
package/dist/index.legacy.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
var __ktjs_shared__ = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
// Shared constants
|
|
5
|
+
// Empty for now - can be extended with framework-wide constants
|
|
6
|
+
/**
|
|
7
|
+
* Mark the attribute as SVG to handle special cases during rendering.
|
|
8
|
+
*/
|
|
9
|
+
var SVG_ATTR_FLAG = '__kt_svg__';
|
|
10
|
+
/**
|
|
11
|
+
* Mark the attribute as MathML to handle special cases during rendering.
|
|
12
|
+
*/
|
|
13
|
+
var MATHML_ATTR_FLAG = '__kt_mathml__';
|
|
14
|
+
/**
|
|
15
|
+
* Can be if, else, else-if.
|
|
16
|
+
*/
|
|
17
|
+
var DIRV_TYPE = Symbol('kt-directive-type');
|
|
18
|
+
|
|
4
19
|
// Cached native methods for performance optimization
|
|
5
20
|
var $isArray = Array.isArray;
|
|
6
21
|
var $ArrayFrom = Array.from;
|
|
@@ -12,6 +27,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
12
27
|
var $defines = Object.defineProperties;
|
|
13
28
|
var $define = Object.defineProperty;
|
|
14
29
|
var $entries = Object.entries;
|
|
30
|
+
var $random = Math.random;
|
|
15
31
|
var $isThenable = function (o) {
|
|
16
32
|
return typeof o === 'object' && o !== null && typeof o.then === 'function';
|
|
17
33
|
};
|
|
@@ -37,6 +53,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
37
53
|
// DOM manipulation utilities
|
|
38
54
|
var _a;
|
|
39
55
|
// # dom natives
|
|
56
|
+
var $isNode = function (x) { return (x === null || x === void 0 ? void 0 : x.nodeType) > 0; };
|
|
40
57
|
/**
|
|
41
58
|
* & Remove `bind` because it is shockingly slower than wrapper
|
|
42
59
|
* & `window.document` is safe because it is not configurable and its setter is undefined
|
|
@@ -191,9 +208,14 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
191
208
|
return params;
|
|
192
209
|
};
|
|
193
210
|
|
|
211
|
+
if (typeof Symbol === 'undefined') {
|
|
212
|
+
window.Symbol = function Symbol(description) {
|
|
213
|
+
return "@@SYMBOL_".concat(description || '', "_").concat($random().toString(36).slice(2));
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
194
217
|
// Shared utilities and cached native methods for kt.js framework
|
|
195
|
-
|
|
196
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.2' });
|
|
218
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.4' });
|
|
197
219
|
|
|
198
220
|
exports.$ArrayFrom = $ArrayFrom;
|
|
199
221
|
exports.$append = $append;
|
|
@@ -208,11 +230,16 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
208
230
|
exports.$hasOwn = $hasOwn;
|
|
209
231
|
exports.$is = $is;
|
|
210
232
|
exports.$isArray = $isArray;
|
|
233
|
+
exports.$isNode = $isNode;
|
|
211
234
|
exports.$isThenable = $isThenable;
|
|
212
235
|
exports.$keys = $keys;
|
|
236
|
+
exports.$random = $random;
|
|
213
237
|
exports.$throw = $throw;
|
|
214
238
|
exports.$toString = $toString;
|
|
215
239
|
exports.$warn = $warn;
|
|
240
|
+
exports.DIRV_TYPE = DIRV_TYPE;
|
|
241
|
+
exports.MATHML_ATTR_FLAG = MATHML_ATTR_FLAG;
|
|
242
|
+
exports.SVG_ATTR_FLAG = SVG_ATTR_FLAG;
|
|
216
243
|
exports.applyModel = applyModel;
|
|
217
244
|
exports.buildQuery = buildQuery;
|
|
218
245
|
exports.emplaceParams = emplaceParams;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// Shared constants
|
|
2
|
+
// Empty for now - can be extended with framework-wide constants
|
|
3
|
+
/**
|
|
4
|
+
* Mark the attribute as SVG to handle special cases during rendering.
|
|
5
|
+
*/
|
|
6
|
+
const SVG_ATTR_FLAG = '__kt_svg__';
|
|
7
|
+
/**
|
|
8
|
+
* Mark the attribute as MathML to handle special cases during rendering.
|
|
9
|
+
*/
|
|
10
|
+
const MATHML_ATTR_FLAG = '__kt_mathml__';
|
|
11
|
+
/**
|
|
12
|
+
* Can be if, else, else-if.
|
|
13
|
+
*/
|
|
14
|
+
const DIRV_TYPE = Symbol('kt-directive-type');
|
|
15
|
+
|
|
1
16
|
// Cached native methods for performance optimization
|
|
2
17
|
const $isArray = Array.isArray;
|
|
3
18
|
const $ArrayFrom = Array.from;
|
|
@@ -9,6 +24,7 @@ const $keys = Object.keys;
|
|
|
9
24
|
const $defines = Object.defineProperties;
|
|
10
25
|
const $define = Object.defineProperty;
|
|
11
26
|
const $entries = Object.entries;
|
|
27
|
+
const $random = Math.random;
|
|
12
28
|
const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
|
|
13
29
|
|
|
14
30
|
// Error handling utilities
|
|
@@ -31,6 +47,7 @@ const $emptyFn = (() => true);
|
|
|
31
47
|
|
|
32
48
|
// DOM manipulation utilities
|
|
33
49
|
// # dom natives
|
|
50
|
+
const $isNode = (x) => x?.nodeType > 0;
|
|
34
51
|
/**
|
|
35
52
|
* & Remove `bind` because it is shockingly slower than wrapper
|
|
36
53
|
* & `window.document` is safe because it is not configurable and its setter is undefined
|
|
@@ -175,8 +192,13 @@ const extractParams = (pattern, path) => {
|
|
|
175
192
|
return params;
|
|
176
193
|
};
|
|
177
194
|
|
|
195
|
+
if (typeof Symbol === 'undefined') {
|
|
196
|
+
window.Symbol = function Symbol(description) {
|
|
197
|
+
return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
178
201
|
// Shared utilities and cached native methods for kt.js framework
|
|
179
|
-
|
|
180
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.2' });
|
|
202
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.4' });
|
|
181
203
|
|
|
182
|
-
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $throw, $toString, $warn, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
|
|
204
|
+
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $random, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
|