@ktjs/shared 0.23.6 → 0.23.7

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 CHANGED
@@ -1,3 +1,13 @@
1
+ declare global {
2
+ /**
3
+ * Extend Comment interface to include properties for fragment handling.
4
+ */
5
+ interface Comment {
6
+ kisFragmentAnchor: boolean;
7
+ kFragmentList: Node[];
8
+ }
9
+ }
10
+
1
11
  /**
2
12
  * Mark the attribute as SVG to handle special cases during rendering.
3
13
  */
@@ -1,6 +1,31 @@
1
1
  var __ktjs_shared__ = (function (exports) {
2
2
  'use strict';
3
3
 
4
+ // Cached native methods for performance optimization
5
+ const $isArray = Array.isArray;
6
+ const $ArrayFrom = Array.from;
7
+ const $is = Object.is;
8
+ const $assign = Object.assign;
9
+ const $hasOwn = Object.prototype.hasOwnProperty;
10
+ const $toString = Object.prototype.toString;
11
+ const $keys = Object.keys;
12
+ const $defines = Object.defineProperties;
13
+ const $define = Object.defineProperty;
14
+ const $entries = Object.entries;
15
+ const $random = Math.random;
16
+ const $isThenable = (o) => typeof o?.then === 'function';
17
+
18
+ if (typeof Symbol === 'undefined') {
19
+ window.Symbol = function Symbol(description) {
20
+ return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
21
+ };
22
+ }
23
+
24
+ // each instance shares the same empty array, but it will be replaced when used
25
+ const emptyArray = [];
26
+ Comment.prototype.kisFragmentAnchor = false;
27
+ Comment.prototype.kFragmentList = emptyArray;
28
+
4
29
  // Shared constants
5
30
  // Empty for now - can be extended with framework-wide constants
6
31
  /**
@@ -16,20 +41,6 @@ var __ktjs_shared__ = (function (exports) {
16
41
  */
17
42
  const DIRV_TYPE = Symbol('kt-directive-type');
18
43
 
19
- // Cached native methods for performance optimization
20
- const $isArray = Array.isArray;
21
- const $ArrayFrom = Array.from;
22
- const $is = Object.is;
23
- const $assign = Object.assign;
24
- const $hasOwn = Object.prototype.hasOwnProperty;
25
- const $toString = Object.prototype.toString;
26
- const $keys = Object.keys;
27
- const $defines = Object.defineProperties;
28
- const $define = Object.defineProperty;
29
- const $entries = Object.entries;
30
- const $random = Math.random;
31
- const $isThenable = (o) => typeof o?.then === 'function';
32
-
33
44
  // DOM manipulation utilities
34
45
  // # dom natives
35
46
  const $isNode = (x) => x?.nodeType > 0;
@@ -212,14 +223,8 @@ var __ktjs_shared__ = (function (exports) {
212
223
  return params;
213
224
  };
214
225
 
215
- if (typeof Symbol === 'undefined') {
216
- window.Symbol = function Symbol(description) {
217
- return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
218
- };
219
- }
220
-
221
- // Shared utilities and cached native methods for kt.js framework
222
- Object.defineProperty(window, '__ktjs__', { value: '0.23.6' });
226
+ // incase that symbol is not supported
227
+ Object.defineProperty(window, '__ktjs__', { value: '0.23.7' });
223
228
 
224
229
  exports.$ArrayFrom = $ArrayFrom;
225
230
  exports.$append = $append;
@@ -1,6 +1,31 @@
1
1
  var __ktjs_shared__ = (function (exports) {
2
2
  'use strict';
3
3
 
4
+ // Cached native methods for performance optimization
5
+ var $isArray = Array.isArray;
6
+ var $ArrayFrom = Array.from;
7
+ var $is = Object.is;
8
+ var $assign = Object.assign;
9
+ var $hasOwn = Object.prototype.hasOwnProperty;
10
+ var $toString = Object.prototype.toString;
11
+ var $keys = Object.keys;
12
+ var $defines = Object.defineProperties;
13
+ var $define = Object.defineProperty;
14
+ var $entries = Object.entries;
15
+ var $random = Math.random;
16
+ var $isThenable = function (o) { return typeof (o === null || o === void 0 ? void 0 : o.then) === 'function'; };
17
+
18
+ if (typeof Symbol === 'undefined') {
19
+ window.Symbol = function Symbol(description) {
20
+ return "@@SYMBOL_".concat(description || '', "_").concat($random().toString(36).slice(2));
21
+ };
22
+ }
23
+
24
+ // each instance shares the same empty array, but it will be replaced when used
25
+ var emptyArray = [];
26
+ Comment.prototype.kisFragmentAnchor = false;
27
+ Comment.prototype.kFragmentList = emptyArray;
28
+
4
29
  // Shared constants
5
30
  // Empty for now - can be extended with framework-wide constants
6
31
  /**
@@ -16,20 +41,6 @@ var __ktjs_shared__ = (function (exports) {
16
41
  */
17
42
  var DIRV_TYPE = Symbol('kt-directive-type');
18
43
 
19
- // Cached native methods for performance optimization
20
- var $isArray = Array.isArray;
21
- var $ArrayFrom = Array.from;
22
- var $is = Object.is;
23
- var $assign = Object.assign;
24
- var $hasOwn = Object.prototype.hasOwnProperty;
25
- var $toString = Object.prototype.toString;
26
- var $keys = Object.keys;
27
- var $defines = Object.defineProperties;
28
- var $define = Object.defineProperty;
29
- var $entries = Object.entries;
30
- var $random = Math.random;
31
- var $isThenable = function (o) { return typeof (o === null || o === void 0 ? void 0 : o.then) === 'function'; };
32
-
33
44
  // DOM manipulation utilities
34
45
  var _a;
35
46
  // # dom natives
@@ -297,14 +308,8 @@ var __ktjs_shared__ = (function (exports) {
297
308
  return params;
298
309
  };
299
310
 
300
- if (typeof Symbol === 'undefined') {
301
- window.Symbol = function Symbol(description) {
302
- return "@@SYMBOL_".concat(description || '', "_").concat($random().toString(36).slice(2));
303
- };
304
- }
305
-
306
- // Shared utilities and cached native methods for kt.js framework
307
- Object.defineProperty(window, '__ktjs__', { value: '0.23.6' });
311
+ // incase that symbol is not supported
312
+ Object.defineProperty(window, '__ktjs__', { value: '0.23.7' });
308
313
 
309
314
  exports.$ArrayFrom = $ArrayFrom;
310
315
  exports.$append = $append;
package/dist/index.mjs CHANGED
@@ -1,3 +1,28 @@
1
+ // Cached native methods for performance optimization
2
+ const $isArray = Array.isArray;
3
+ const $ArrayFrom = Array.from;
4
+ const $is = Object.is;
5
+ const $assign = Object.assign;
6
+ const $hasOwn = Object.prototype.hasOwnProperty;
7
+ const $toString = Object.prototype.toString;
8
+ const $keys = Object.keys;
9
+ const $defines = Object.defineProperties;
10
+ const $define = Object.defineProperty;
11
+ const $entries = Object.entries;
12
+ const $random = Math.random;
13
+ const $isThenable = (o) => typeof o?.then === 'function';
14
+
15
+ if (typeof Symbol === 'undefined') {
16
+ window.Symbol = function Symbol(description) {
17
+ return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
18
+ };
19
+ }
20
+
21
+ // each instance shares the same empty array, but it will be replaced when used
22
+ const emptyArray = [];
23
+ Comment.prototype.kisFragmentAnchor = false;
24
+ Comment.prototype.kFragmentList = emptyArray;
25
+
1
26
  // Shared constants
2
27
  // Empty for now - can be extended with framework-wide constants
3
28
  /**
@@ -13,20 +38,6 @@ const MATHML_ATTR_FLAG = '__kt_mathml__';
13
38
  */
14
39
  const DIRV_TYPE = Symbol('kt-directive-type');
15
40
 
16
- // Cached native methods for performance optimization
17
- const $isArray = Array.isArray;
18
- const $ArrayFrom = Array.from;
19
- const $is = Object.is;
20
- const $assign = Object.assign;
21
- const $hasOwn = Object.prototype.hasOwnProperty;
22
- const $toString = Object.prototype.toString;
23
- const $keys = Object.keys;
24
- const $defines = Object.defineProperties;
25
- const $define = Object.defineProperty;
26
- const $entries = Object.entries;
27
- const $random = Math.random;
28
- const $isThenable = (o) => typeof o?.then === 'function';
29
-
30
41
  // DOM manipulation utilities
31
42
  // # dom natives
32
43
  const $isNode = (x) => x?.nodeType > 0;
@@ -209,13 +220,7 @@ const extractParams = (pattern, path) => {
209
220
  return params;
210
221
  };
211
222
 
212
- if (typeof Symbol === 'undefined') {
213
- window.Symbol = function Symbol(description) {
214
- return `@@SYMBOL_${description || ''}_${$random().toString(36).slice(2)}`;
215
- };
216
- }
217
-
218
- // Shared utilities and cached native methods for kt.js framework
219
- Object.defineProperty(window, '__ktjs__', { value: '0.23.6' });
223
+ // incase that symbol is not supported
224
+ Object.defineProperty(window, '__ktjs__', { value: '0.23.7' });
220
225
 
221
226
  export { $ArrayFrom, $append, $appendChild, $applyModel, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $forEach, $forEachAsync, $hasOwn, $is, $isArray, $isNode, $isSame, $isThenable, $keys, $parseStyle, $random, $replaceNode, $toString, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, buildQuery, emplaceParams, extractParams, normalizePath, parseQuery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/shared",
3
- "version": "0.23.6",
3
+ "version": "0.23.7",
4
4
  "description": "Shared utilities and cached native methods for kt.js framework",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",