@fukict/basic 0.1.8 → 0.1.10
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/component-class/fukict.d.ts +11 -18
- package/dist/component-class/fukict.d.ts.map +1 -1
- package/dist/component-class/fukict.js +50 -65
- package/dist/component-class/fukict.js.map +1 -1
- package/dist/dev.d.ts +26 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +46 -0
- package/dist/dev.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.js +1 -1
- package/dist/metadata.js.map +1 -1
- package/dist/renderer/class-helpers.d.ts +1 -2
- package/dist/renderer/class-helpers.d.ts.map +1 -1
- package/dist/renderer/class-helpers.js +6 -7
- package/dist/renderer/class-helpers.js.map +1 -1
- package/dist/renderer/create.js +3 -3
- package/dist/renderer/create.js.map +1 -1
- package/dist/renderer/diff/class.js +2 -2
- package/dist/renderer/diff/class.js.map +1 -1
- package/dist/renderer/diff/element.js +1 -1
- package/dist/renderer/diff/element.js.map +1 -1
- package/dist/renderer/diff/fragment.d.ts +1 -1
- package/dist/renderer/diff/fragment.js +4 -4
- package/dist/renderer/diff/fragment.js.map +1 -1
- package/dist/renderer/diff/function.d.ts +1 -1
- package/dist/renderer/diff/function.js +7 -7
- package/dist/renderer/diff/function.js.map +1 -1
- package/dist/renderer/diff/helpers.js +12 -12
- package/dist/renderer/diff/helpers.js.map +1 -1
- package/dist/renderer/diff/primitive.js +2 -2
- package/dist/renderer/diff/primitive.js.map +1 -1
- package/dist/renderer/index.d.ts.map +1 -1
- package/dist/renderer/index.js +17 -0
- package/dist/renderer/index.js.map +1 -1
- package/dist/renderer/mount.js +9 -9
- package/dist/renderer/mount.js.map +1 -1
- package/dist/renderer/vnode-helpers.js +5 -5
- package/dist/renderer/vnode-helpers.js.map +1 -1
- package/dist/types/class.d.ts +2 -2
- package/dist/types/class.d.ts.map +1 -1
- package/dist/types/core.d.ts +15 -16
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/core.js.map +1 -1
- package/dist/types/dev.d.ts +21 -0
- package/dist/types/dev.d.ts.map +1 -0
- package/dist/types/dev.js +8 -0
- package/dist/types/dev.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/context.d.ts +2 -3
- package/dist/utils/context.d.ts.map +1 -1
- package/dist/utils/context.js +6 -22
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/dom-helpers.d.ts +3 -3
- package/dist/utils/dom-helpers.js +7 -7
- package/dist/utils/dom-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/types/dev.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export type { Slots, Ref, Refs, FukictLifecycle, FukictComponent, FukictProps, F
|
|
|
9
9
|
export type { EventHandlers } from './events';
|
|
10
10
|
export type { CSSProperties, ClassValue, RuntimeAttributes, HTMLAttributes, SVGAttributes, FukictSlotAttribute, FukictRefAttribute, FukictDetachAttribute, } from './dom-attributes';
|
|
11
11
|
export type { JSX } from './jsx';
|
|
12
|
+
export type { FukictDevInfo } from './dev';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGhD,YAAY,EACV,KAAK,EACL,GAAG,EACH,IAAI,EACJ,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,YAAY,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGhD,YAAY,EACV,KAAK,EACL,GAAG,EACH,IAAI,EACJ,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,YAAY,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
|
package/dist/utils/context.d.ts
CHANGED
|
@@ -20,10 +20,9 @@ export declare function createImmutableProxy<T>(value: T): T;
|
|
|
20
20
|
/**
|
|
21
21
|
* Get parent context from VNode
|
|
22
22
|
*
|
|
23
|
-
* Traverses up the
|
|
24
|
-
* The wrapper VNode is the ClassComponentVNode that wraps a component instance.
|
|
23
|
+
* Traverses up the parent instance chain to find nearest parent component with context.
|
|
25
24
|
*
|
|
26
|
-
* @param vnode - Current VNode (
|
|
25
|
+
* @param vnode - Current VNode (used to get instance, then traverse via _parent)
|
|
27
26
|
* @returns Parent context data or undefined
|
|
28
27
|
* @internal
|
|
29
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/utils/context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAuB,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/utils/context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAuB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AASnE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA4BnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAiBtE"}
|
package/dist/utils/context.js
CHANGED
|
@@ -41,10 +41,9 @@ export function createImmutableProxy(value) {
|
|
|
41
41
|
/**
|
|
42
42
|
* Get parent context from VNode
|
|
43
43
|
*
|
|
44
|
-
* Traverses up the
|
|
45
|
-
* The wrapper VNode is the ClassComponentVNode that wraps a component instance.
|
|
44
|
+
* Traverses up the parent instance chain to find nearest parent component with context.
|
|
46
45
|
*
|
|
47
|
-
* @param vnode - Current VNode (
|
|
46
|
+
* @param vnode - Current VNode (used to get instance, then traverse via _parent)
|
|
48
47
|
* @returns Parent context data or undefined
|
|
49
48
|
* @internal
|
|
50
49
|
*/
|
|
@@ -55,25 +54,10 @@ export function getParentContext(vnode) {
|
|
|
55
54
|
if (!instance) {
|
|
56
55
|
return undefined;
|
|
57
56
|
}
|
|
58
|
-
//
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
// Look for parent context by traversing up the VNode tree
|
|
64
|
-
// We need to find the parent component that rendered this wrapper VNode
|
|
65
|
-
// This requires walking through the children arrays to find parent relationship
|
|
66
|
-
// For now, implement a simpler approach:
|
|
67
|
-
// Look for context in parent by checking if wrapper has __parentInstance__
|
|
68
|
-
// This will be set during rendering
|
|
69
|
-
// Alternative: Search through all active component instances
|
|
70
|
-
// But this violates the "no global state" principle
|
|
71
|
-
// The correct approach: During render, when parent creates child VNode,
|
|
72
|
-
// we should store parent instance reference on the child's wrapper VNode
|
|
73
|
-
// Let's add __parentInstance__ field during createRealNode
|
|
74
|
-
const parentInstance = instance.__parentInstance__;
|
|
75
|
-
if (parentInstance && parentInstance.__vnode__) {
|
|
76
|
-
return parentInstance.__vnode__.__context__;
|
|
57
|
+
// Traverse via _parent (direct parent instance reference)
|
|
58
|
+
const parentInstance = instance._parent;
|
|
59
|
+
if (parentInstance && parentInstance._render) {
|
|
60
|
+
return parentInstance._render.__context__;
|
|
77
61
|
}
|
|
78
62
|
return undefined;
|
|
79
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/utils/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/utils/context.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAAI,KAAQ;IAC9C,oCAAoC;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,KAAe,EAAE;QAChC,GAAG;YACD,OAAO,CAAC,IAAI,CACV,8DAA8D,CAC/D,CAAC;YACF,OAAO,KAAK,CAAC,CAAC,kDAAkD;QAClE,CAAC;QACD,cAAc;YACZ,OAAO,CAAC,IAAI,CACV,8DAA8D,CAC/D,CAAC;YACF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAY,CAAC;YACpD,gCAAgC;YAChC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClD,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;YACtC,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAM,CAAC;AACV,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,wCAAwC;IACxC,MAAM,iBAAiB,GAAG,KAA4B,CAAC;IACvD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,YAEtB,CAAC;IACd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0DAA0D;IAC1D,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,cAAc,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;QAC7C,OAAO,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { VNode } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
|
-
* Check if
|
|
8
|
+
* Check if __node__ is an array (Fragment or multi-node)
|
|
9
9
|
*/
|
|
10
10
|
export declare function isDomArray(dom: unknown): dom is Node[];
|
|
11
11
|
/**
|
|
12
|
-
* Normalize
|
|
12
|
+
* Normalize __node__ to array (for unified processing)
|
|
13
13
|
*/
|
|
14
14
|
export declare function normalizeDom(dom: Node | Node[] | null | undefined): Node[];
|
|
15
15
|
/**
|
|
16
16
|
* Get first DOM node from VNode
|
|
17
|
-
* Returns null for class components (they don't have
|
|
17
|
+
* Returns null for class components (they don't have __node__)
|
|
18
18
|
*/
|
|
19
19
|
export declare function getFirstDomNode(vnode: VNode): Node | null;
|
|
20
20
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { VNodeType } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Check if
|
|
3
|
+
* Check if __node__ is an array (Fragment or multi-node)
|
|
4
4
|
*/
|
|
5
5
|
export function isDomArray(dom) {
|
|
6
6
|
return Array.isArray(dom);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Normalize
|
|
9
|
+
* Normalize __node__ to array (for unified processing)
|
|
10
10
|
*/
|
|
11
11
|
export function normalizeDom(dom) {
|
|
12
12
|
if (!dom)
|
|
@@ -17,14 +17,14 @@ export function normalizeDom(dom) {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Get first DOM node from VNode
|
|
20
|
-
* Returns null for class components (they don't have
|
|
20
|
+
* Returns null for class components (they don't have __node__)
|
|
21
21
|
*/
|
|
22
22
|
export function getFirstDomNode(vnode) {
|
|
23
|
-
// Class components don't have
|
|
23
|
+
// Class components don't have __node__
|
|
24
24
|
if (vnode.__type__ === VNodeType.ClassComponent) {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
|
-
const dom = '
|
|
27
|
+
const dom = '__node__' in vnode ? vnode.__node__ : null;
|
|
28
28
|
if (!dom)
|
|
29
29
|
return null;
|
|
30
30
|
if (Array.isArray(dom)) {
|
|
@@ -37,11 +37,11 @@ export function getFirstDomNode(vnode) {
|
|
|
37
37
|
* Returns empty array for class components
|
|
38
38
|
*/
|
|
39
39
|
export function getAllDomNodes(vnode) {
|
|
40
|
-
// Class components don't have
|
|
40
|
+
// Class components don't have __node__
|
|
41
41
|
if (vnode.__type__ === VNodeType.ClassComponent) {
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
44
|
-
const dom = '
|
|
44
|
+
const dom = '__node__' in vnode ? vnode.__node__ : null;
|
|
45
45
|
return normalizeDom(dom);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-helpers.js","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAqC;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,
|
|
1
|
+
{"version":3,"file":"dom-helpers.js","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAqC;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,uCAAuC;IACvC,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,cAAc,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAEtB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,uCAAuC;IACvC,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,cAAc,EAAE,CAAC;QAChD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,UAAU,IAAI,KAAK,CAAC;AAC5E,CAAC"}
|