@lark.js/mvc 0.0.10 → 0.0.11
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/README.md +10 -10
- package/dist/chunk-RIV4NK3K.js +108 -0
- package/dist/compiler.cjs +654 -114
- package/dist/compiler.d.cts +35 -35
- package/dist/compiler.d.ts +35 -35
- package/dist/compiler.js +651 -114
- package/dist/devtool.cjs +3421 -0
- package/dist/devtool.d.cts +83 -0
- package/dist/devtool.d.ts +83 -0
- package/dist/devtool.js +3333 -0
- package/dist/index.cjs +754 -147
- package/dist/index.d.cts +88 -85
- package/dist/index.d.ts +88 -85
- package/dist/index.js +751 -143
- package/dist/rspack.cjs +15978 -0
- package/dist/rspack.d.cts +122 -0
- package/dist/rspack.d.ts +122 -0
- package/dist/{chunk-SIQF4YLC.js → rspack.js} +765 -149
- package/dist/runtime.cjs +7 -7
- package/dist/runtime.d.cts +4 -4
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +10 -54
- package/dist/vite.cjs +709 -151
- package/dist/vite.d.cts +3 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +15917 -10
- package/dist/webpack.cjs +756 -159
- package/dist/webpack.d.cts +60 -4
- package/dist/webpack.d.ts +60 -4
- package/dist/webpack.js +15962 -14
- package/package.json +25 -2
package/dist/index.d.cts
CHANGED
|
@@ -665,6 +665,68 @@ interface DomRef {
|
|
|
665
665
|
* Comment), so the child slots are typed as ChildNode.
|
|
666
666
|
*/
|
|
667
667
|
type DomOp = [1, Element, ChildNode] | [2, Element, ChildNode] | [4, Element, ChildNode, ChildNode] | [8, Element, ChildNode, ChildNode];
|
|
668
|
+
/**
|
|
669
|
+
* Virtual DOM node. Produced by `vdomCreate`, consumed by the VDOM diff engine.
|
|
670
|
+
*
|
|
671
|
+
* Property semantics:
|
|
672
|
+
* - Text nodes: tag = 0 (V_TEXT_NODE), html = text content
|
|
673
|
+
* - Element nodes: tag = string, attrs = serialized opening tag, children = child VDomNodes
|
|
674
|
+
* - Raw HTML nodes: tag = SPLITTER (\x1e), html = raw HTML string
|
|
675
|
+
* - Self-closing: selfClose = true (children param was 1)
|
|
676
|
+
*/
|
|
677
|
+
interface VDomNode {
|
|
678
|
+
/** Tag name for elements, 0 (V_TEXT_NODE) for text, SPLITTER for raw HTML */
|
|
679
|
+
tag: string | number;
|
|
680
|
+
/** Inner HTML (serialized children for elements, text content for text nodes) */
|
|
681
|
+
html: string;
|
|
682
|
+
/** Serialized opening tag with attributes, e.g. '<div class="row"' */
|
|
683
|
+
attrs?: string;
|
|
684
|
+
/** Attribute key-value map */
|
|
685
|
+
attrsMap?: Record<string, unknown>;
|
|
686
|
+
/** Attribute names that are set as DOM properties (not attributes) */
|
|
687
|
+
attrsSpecials?: Record<string, string>;
|
|
688
|
+
/** Original specials argument before defaulting (for change detection) */
|
|
689
|
+
hasSpecials?: Record<string, string> | undefined;
|
|
690
|
+
/** Child VDomNode array (undefined for text/raw/self-closing) */
|
|
691
|
+
children?: VDomNode[] | undefined;
|
|
692
|
+
/** Diff key: from id, _, #, or v-lark path */
|
|
693
|
+
compareKey?: string | undefined;
|
|
694
|
+
/** Keyed children count map (compareKey -> count) */
|
|
695
|
+
reused?: Record<string, number> | undefined;
|
|
696
|
+
/** Total count of keyed children */
|
|
697
|
+
reusedTotal?: number;
|
|
698
|
+
/** Sub-view references: [viewPath, owner, uri, params] tuples */
|
|
699
|
+
views?: [string, string, string, Record<string, string>][] | undefined;
|
|
700
|
+
/** Whether self-closing (children param was literal 1) */
|
|
701
|
+
selfClose?: boolean;
|
|
702
|
+
/** Sub-view path if this node hosts a v-lark view, otherwise falsy */
|
|
703
|
+
isLarkView?: string | undefined;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* VDOM diff operation tracker. Parallel to DomRef but for the VDOM pipeline.
|
|
707
|
+
*/
|
|
708
|
+
interface VDomRef {
|
|
709
|
+
/** View ID (for placeholder replacement) */
|
|
710
|
+
viewId: string;
|
|
711
|
+
/** Sub-views that need re-rendering after diff */
|
|
712
|
+
viewRenders: ViewInterface[];
|
|
713
|
+
/** Deferred DOM property assignments: [element, propName, value][] */
|
|
714
|
+
nodeProps: [Element, string, unknown][];
|
|
715
|
+
/** Pending async operation count */
|
|
716
|
+
asyncCount: number;
|
|
717
|
+
/** Whether the DOM actually changed */
|
|
718
|
+
changed: number;
|
|
719
|
+
/** DOM mutation operations (same format as DomOp) */
|
|
720
|
+
domOps: DomOp[];
|
|
721
|
+
}
|
|
722
|
+
/** VDOM node creation function signature (vdomCreate) */
|
|
723
|
+
type VDomCreateFn = (tag: string | number, props?: Record<string, unknown> | number | null, children?: VDomNode[] | number | null, specials?: Record<string, string>) => VDomNode;
|
|
724
|
+
/**
|
|
725
|
+
* VDOM template function signature.
|
|
726
|
+
* The compiled template imports vdomCreate via ES module import and
|
|
727
|
+
* takes only (data, viewId, refData). Extra arguments are ignored.
|
|
728
|
+
*/
|
|
729
|
+
type VDomTemplate = (data: unknown, viewId: string, refData: unknown) => VDomNode;
|
|
668
730
|
interface FrameInvokeEntry {
|
|
669
731
|
/** Method name */
|
|
670
732
|
name: string;
|
|
@@ -858,7 +920,7 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
|
|
|
858
920
|
* View template function. Receives data + viewId + refData and a set of
|
|
859
921
|
* encoder helpers wired in by the Updater, and returns the rendered HTML.
|
|
860
922
|
*/
|
|
861
|
-
template?: ViewTemplate;
|
|
923
|
+
template?: ViewTemplate | VDomTemplate;
|
|
862
924
|
/**
|
|
863
925
|
* Mixin object array for extending view functionality.
|
|
864
926
|
* Framework merges properties and methods from mixins into view prototype.
|
|
@@ -879,6 +941,8 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
|
|
|
879
941
|
globalEventList: ViewGlobalEventEntry[];
|
|
880
942
|
/** Whether endUpdate has been called (1 = pending) */
|
|
881
943
|
endUpdatePending?: number;
|
|
944
|
+
/** Last rendered VDOM tree (only used when virtualDom is enabled) */
|
|
945
|
+
vdom?: VDomNode;
|
|
882
946
|
/** Render method (wrapped) */
|
|
883
947
|
render(): void;
|
|
884
948
|
/**
|
|
@@ -1602,7 +1666,7 @@ interface FrameworkConfig {
|
|
|
1602
1666
|
*/
|
|
1603
1667
|
crossConfigs?: CrossSiteConfig[];
|
|
1604
1668
|
/** Default false. */
|
|
1605
|
-
|
|
1669
|
+
virtualDom?: boolean;
|
|
1606
1670
|
/** Dynamic config access, custom config items */
|
|
1607
1671
|
[key: string]: unknown;
|
|
1608
1672
|
}
|
|
@@ -1659,6 +1723,10 @@ interface CompileOptions {
|
|
|
1659
1723
|
globalVars?: string[];
|
|
1660
1724
|
/** File path for debug error messages (default: undefined) */
|
|
1661
1725
|
file?: string;
|
|
1726
|
+
/** Generate VDOM output instead of HTML string (default: false) */
|
|
1727
|
+
virtualDom?: boolean;
|
|
1728
|
+
/** Use SWC instead of Babel for parsing (default: false) */
|
|
1729
|
+
useSwc?: boolean;
|
|
1662
1730
|
}
|
|
1663
1731
|
|
|
1664
1732
|
/**
|
|
@@ -1828,6 +1896,8 @@ declare class Updater implements UpdaterInterface {
|
|
|
1828
1896
|
private version;
|
|
1829
1897
|
/** Snapshot of `version` taken by `snapshot()`, used by `altered()`. */
|
|
1830
1898
|
private snapshotVersion;
|
|
1899
|
+
/** Last rendered VDOM tree (only used when virtualDom is enabled) */
|
|
1900
|
+
private vdom?;
|
|
1831
1901
|
constructor(viewId: string);
|
|
1832
1902
|
/**
|
|
1833
1903
|
* Get data by key.
|
|
@@ -1890,6 +1960,21 @@ declare class Updater implements UpdaterInterface {
|
|
|
1890
1960
|
getChangedKeys(): ReadonlySet<string>;
|
|
1891
1961
|
}
|
|
1892
1962
|
|
|
1963
|
+
/**
|
|
1964
|
+
* Create a virtual DOM node.
|
|
1965
|
+
*
|
|
1966
|
+
* Text node: `vdomCreate(0, 'text content')`
|
|
1967
|
+
* Element: `vdomCreate('div', { class: 'row' }, [child1, child2])`
|
|
1968
|
+
* Self-closing: `vdomCreate('br', null, 1)`
|
|
1969
|
+
* Raw HTML: `vdomCreate(0, '<b>bold</b>', 1)` (children truthy → raw HTML node)
|
|
1970
|
+
* Root: `vdomCreate(viewId, 0, [children])`
|
|
1971
|
+
*/
|
|
1972
|
+
declare function vdomCreate(tag: string | number, props?: Record<string, unknown> | string | number | null, children?: VDomNode[] | string | number | null, specials?: Record<string, string>): VDomNode;
|
|
1973
|
+
/**
|
|
1974
|
+
* Create an empty VDomRef for tracking diff operations.
|
|
1975
|
+
*/
|
|
1976
|
+
declare function createVDomRef(viewId: string): VDomRef;
|
|
1977
|
+
|
|
1893
1978
|
/**
|
|
1894
1979
|
* Payload wraps API response data with convenient access methods.
|
|
1895
1980
|
*/
|
|
@@ -2186,86 +2271,4 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
|
|
|
2186
2271
|
*/
|
|
2187
2272
|
declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
|
|
2188
2273
|
|
|
2189
|
-
|
|
2190
|
-
interface SerializedViewInfo {
|
|
2191
|
-
/** View ID (same as frame ID) */
|
|
2192
|
-
id: string;
|
|
2193
|
-
/** Whether the view has rendered at least once */
|
|
2194
|
-
rendered: boolean;
|
|
2195
|
-
/** View signature (> 0 = active) */
|
|
2196
|
-
signature: number;
|
|
2197
|
-
/** Observed state keys */
|
|
2198
|
-
observedStateKeys: string[] | null;
|
|
2199
|
-
/** Location observation config */
|
|
2200
|
-
locationObserved: {
|
|
2201
|
-
flag: number;
|
|
2202
|
-
keys: string[];
|
|
2203
|
-
observePath: boolean;
|
|
2204
|
-
};
|
|
2205
|
-
/** Whether view has a template function */
|
|
2206
|
-
hasTemplate: boolean;
|
|
2207
|
-
/** Delegated event types (keys from $evtObjMap) */
|
|
2208
|
-
eventMethodKeys: string[];
|
|
2209
|
-
/** Captured resource keys */
|
|
2210
|
-
resourceKeys: string[];
|
|
2211
|
-
/** Whether view exposes an assign method (supports CrossSite reuse) */
|
|
2212
|
-
hasAssign: boolean;
|
|
2213
|
-
/** Updater refData snapshot (shallow copy of current data) */
|
|
2214
|
-
updaterData: Record<string, unknown> | null;
|
|
2215
|
-
}
|
|
2216
|
-
/** A single node in the serialized frame tree */
|
|
2217
|
-
interface SerializedFrameNode {
|
|
2218
|
-
/** Frame ID (same as owner DOM element ID) */
|
|
2219
|
-
id: string;
|
|
2220
|
-
/** Parent frame ID (null for root) */
|
|
2221
|
-
parentId: string | null;
|
|
2222
|
-
/** View path (v-lark attribute value) */
|
|
2223
|
-
viewPath: string | null;
|
|
2224
|
-
/** Number of child frames */
|
|
2225
|
-
childrenCount: number;
|
|
2226
|
-
/** Number of children that have fired 'created' */
|
|
2227
|
-
readyCount: number;
|
|
2228
|
-
/** Whether children have been created */
|
|
2229
|
-
childrenCreated: number;
|
|
2230
|
-
/** Whether children are in alter state */
|
|
2231
|
-
childrenAlter: number;
|
|
2232
|
-
/** Whether this frame is destroyed */
|
|
2233
|
-
destroyed: number;
|
|
2234
|
-
/** Serialized view info (null if no view mounted) */
|
|
2235
|
-
view: SerializedViewInfo | null;
|
|
2236
|
-
/** Child frame nodes */
|
|
2237
|
-
children: SerializedFrameNode[];
|
|
2238
|
-
}
|
|
2239
|
-
/** Top-level serialized frame tree */
|
|
2240
|
-
interface SerializedFrameTree {
|
|
2241
|
-
/** Root frame node */
|
|
2242
|
-
root: SerializedFrameNode | null;
|
|
2243
|
-
/** Total frame count */
|
|
2244
|
-
totalFrames: number;
|
|
2245
|
-
/** Timestamp of serialization */
|
|
2246
|
-
timestamp: number;
|
|
2247
|
-
/** Root element ID */
|
|
2248
|
-
rootId: string;
|
|
2249
|
-
}
|
|
2250
|
-
declare const FrameVisualBridge: {
|
|
2251
|
-
MSG_PING: string;
|
|
2252
|
-
MSG_PONG: string;
|
|
2253
|
-
MSG_REQUEST_TREE: string;
|
|
2254
|
-
MSG_TREE: string;
|
|
2255
|
-
MSG_TREE_DELTA: string;
|
|
2256
|
-
};
|
|
2257
|
-
/**
|
|
2258
|
-
* Serialize the entire Frame tree starting from root.
|
|
2259
|
-
* Returns an empty snapshot if the app hasn't booted yet.
|
|
2260
|
-
*/
|
|
2261
|
-
declare function serializeFrameTree(): SerializedFrameTree;
|
|
2262
|
-
/**
|
|
2263
|
-
* Install the Frame Visualizer Bridge.
|
|
2264
|
-
* Listens for postMessage events from the visualizer and responds
|
|
2265
|
-
* with serialized frame tree data.
|
|
2266
|
-
*
|
|
2267
|
-
* This should be called once during Framework.boot().
|
|
2268
|
-
*/
|
|
2269
|
-
declare function installFrameVisualizerBridge(): void;
|
|
2270
|
-
|
|
2271
|
-
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, FrameVisualBridge, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, type SerializedFrameNode, type SerializedFrameTree, type SerializedViewInfo, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, defineView, config as frameworkConfig, getRouteMode, installFrameVisualizerBridge, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, serializeFrameTree, unmark, use, useUrlState };
|
|
2274
|
+
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|
package/dist/index.d.ts
CHANGED
|
@@ -665,6 +665,68 @@ interface DomRef {
|
|
|
665
665
|
* Comment), so the child slots are typed as ChildNode.
|
|
666
666
|
*/
|
|
667
667
|
type DomOp = [1, Element, ChildNode] | [2, Element, ChildNode] | [4, Element, ChildNode, ChildNode] | [8, Element, ChildNode, ChildNode];
|
|
668
|
+
/**
|
|
669
|
+
* Virtual DOM node. Produced by `vdomCreate`, consumed by the VDOM diff engine.
|
|
670
|
+
*
|
|
671
|
+
* Property semantics:
|
|
672
|
+
* - Text nodes: tag = 0 (V_TEXT_NODE), html = text content
|
|
673
|
+
* - Element nodes: tag = string, attrs = serialized opening tag, children = child VDomNodes
|
|
674
|
+
* - Raw HTML nodes: tag = SPLITTER (\x1e), html = raw HTML string
|
|
675
|
+
* - Self-closing: selfClose = true (children param was 1)
|
|
676
|
+
*/
|
|
677
|
+
interface VDomNode {
|
|
678
|
+
/** Tag name for elements, 0 (V_TEXT_NODE) for text, SPLITTER for raw HTML */
|
|
679
|
+
tag: string | number;
|
|
680
|
+
/** Inner HTML (serialized children for elements, text content for text nodes) */
|
|
681
|
+
html: string;
|
|
682
|
+
/** Serialized opening tag with attributes, e.g. '<div class="row"' */
|
|
683
|
+
attrs?: string;
|
|
684
|
+
/** Attribute key-value map */
|
|
685
|
+
attrsMap?: Record<string, unknown>;
|
|
686
|
+
/** Attribute names that are set as DOM properties (not attributes) */
|
|
687
|
+
attrsSpecials?: Record<string, string>;
|
|
688
|
+
/** Original specials argument before defaulting (for change detection) */
|
|
689
|
+
hasSpecials?: Record<string, string> | undefined;
|
|
690
|
+
/** Child VDomNode array (undefined for text/raw/self-closing) */
|
|
691
|
+
children?: VDomNode[] | undefined;
|
|
692
|
+
/** Diff key: from id, _, #, or v-lark path */
|
|
693
|
+
compareKey?: string | undefined;
|
|
694
|
+
/** Keyed children count map (compareKey -> count) */
|
|
695
|
+
reused?: Record<string, number> | undefined;
|
|
696
|
+
/** Total count of keyed children */
|
|
697
|
+
reusedTotal?: number;
|
|
698
|
+
/** Sub-view references: [viewPath, owner, uri, params] tuples */
|
|
699
|
+
views?: [string, string, string, Record<string, string>][] | undefined;
|
|
700
|
+
/** Whether self-closing (children param was literal 1) */
|
|
701
|
+
selfClose?: boolean;
|
|
702
|
+
/** Sub-view path if this node hosts a v-lark view, otherwise falsy */
|
|
703
|
+
isLarkView?: string | undefined;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* VDOM diff operation tracker. Parallel to DomRef but for the VDOM pipeline.
|
|
707
|
+
*/
|
|
708
|
+
interface VDomRef {
|
|
709
|
+
/** View ID (for placeholder replacement) */
|
|
710
|
+
viewId: string;
|
|
711
|
+
/** Sub-views that need re-rendering after diff */
|
|
712
|
+
viewRenders: ViewInterface[];
|
|
713
|
+
/** Deferred DOM property assignments: [element, propName, value][] */
|
|
714
|
+
nodeProps: [Element, string, unknown][];
|
|
715
|
+
/** Pending async operation count */
|
|
716
|
+
asyncCount: number;
|
|
717
|
+
/** Whether the DOM actually changed */
|
|
718
|
+
changed: number;
|
|
719
|
+
/** DOM mutation operations (same format as DomOp) */
|
|
720
|
+
domOps: DomOp[];
|
|
721
|
+
}
|
|
722
|
+
/** VDOM node creation function signature (vdomCreate) */
|
|
723
|
+
type VDomCreateFn = (tag: string | number, props?: Record<string, unknown> | number | null, children?: VDomNode[] | number | null, specials?: Record<string, string>) => VDomNode;
|
|
724
|
+
/**
|
|
725
|
+
* VDOM template function signature.
|
|
726
|
+
* The compiled template imports vdomCreate via ES module import and
|
|
727
|
+
* takes only (data, viewId, refData). Extra arguments are ignored.
|
|
728
|
+
*/
|
|
729
|
+
type VDomTemplate = (data: unknown, viewId: string, refData: unknown) => VDomNode;
|
|
668
730
|
interface FrameInvokeEntry {
|
|
669
731
|
/** Method name */
|
|
670
732
|
name: string;
|
|
@@ -858,7 +920,7 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
|
|
|
858
920
|
* View template function. Receives data + viewId + refData and a set of
|
|
859
921
|
* encoder helpers wired in by the Updater, and returns the rendered HTML.
|
|
860
922
|
*/
|
|
861
|
-
template?: ViewTemplate;
|
|
923
|
+
template?: ViewTemplate | VDomTemplate;
|
|
862
924
|
/**
|
|
863
925
|
* Mixin object array for extending view functionality.
|
|
864
926
|
* Framework merges properties and methods from mixins into view prototype.
|
|
@@ -879,6 +941,8 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
|
|
|
879
941
|
globalEventList: ViewGlobalEventEntry[];
|
|
880
942
|
/** Whether endUpdate has been called (1 = pending) */
|
|
881
943
|
endUpdatePending?: number;
|
|
944
|
+
/** Last rendered VDOM tree (only used when virtualDom is enabled) */
|
|
945
|
+
vdom?: VDomNode;
|
|
882
946
|
/** Render method (wrapped) */
|
|
883
947
|
render(): void;
|
|
884
948
|
/**
|
|
@@ -1602,7 +1666,7 @@ interface FrameworkConfig {
|
|
|
1602
1666
|
*/
|
|
1603
1667
|
crossConfigs?: CrossSiteConfig[];
|
|
1604
1668
|
/** Default false. */
|
|
1605
|
-
|
|
1669
|
+
virtualDom?: boolean;
|
|
1606
1670
|
/** Dynamic config access, custom config items */
|
|
1607
1671
|
[key: string]: unknown;
|
|
1608
1672
|
}
|
|
@@ -1659,6 +1723,10 @@ interface CompileOptions {
|
|
|
1659
1723
|
globalVars?: string[];
|
|
1660
1724
|
/** File path for debug error messages (default: undefined) */
|
|
1661
1725
|
file?: string;
|
|
1726
|
+
/** Generate VDOM output instead of HTML string (default: false) */
|
|
1727
|
+
virtualDom?: boolean;
|
|
1728
|
+
/** Use SWC instead of Babel for parsing (default: false) */
|
|
1729
|
+
useSwc?: boolean;
|
|
1662
1730
|
}
|
|
1663
1731
|
|
|
1664
1732
|
/**
|
|
@@ -1828,6 +1896,8 @@ declare class Updater implements UpdaterInterface {
|
|
|
1828
1896
|
private version;
|
|
1829
1897
|
/** Snapshot of `version` taken by `snapshot()`, used by `altered()`. */
|
|
1830
1898
|
private snapshotVersion;
|
|
1899
|
+
/** Last rendered VDOM tree (only used when virtualDom is enabled) */
|
|
1900
|
+
private vdom?;
|
|
1831
1901
|
constructor(viewId: string);
|
|
1832
1902
|
/**
|
|
1833
1903
|
* Get data by key.
|
|
@@ -1890,6 +1960,21 @@ declare class Updater implements UpdaterInterface {
|
|
|
1890
1960
|
getChangedKeys(): ReadonlySet<string>;
|
|
1891
1961
|
}
|
|
1892
1962
|
|
|
1963
|
+
/**
|
|
1964
|
+
* Create a virtual DOM node.
|
|
1965
|
+
*
|
|
1966
|
+
* Text node: `vdomCreate(0, 'text content')`
|
|
1967
|
+
* Element: `vdomCreate('div', { class: 'row' }, [child1, child2])`
|
|
1968
|
+
* Self-closing: `vdomCreate('br', null, 1)`
|
|
1969
|
+
* Raw HTML: `vdomCreate(0, '<b>bold</b>', 1)` (children truthy → raw HTML node)
|
|
1970
|
+
* Root: `vdomCreate(viewId, 0, [children])`
|
|
1971
|
+
*/
|
|
1972
|
+
declare function vdomCreate(tag: string | number, props?: Record<string, unknown> | string | number | null, children?: VDomNode[] | string | number | null, specials?: Record<string, string>): VDomNode;
|
|
1973
|
+
/**
|
|
1974
|
+
* Create an empty VDomRef for tracking diff operations.
|
|
1975
|
+
*/
|
|
1976
|
+
declare function createVDomRef(viewId: string): VDomRef;
|
|
1977
|
+
|
|
1893
1978
|
/**
|
|
1894
1979
|
* Payload wraps API response data with convenient access methods.
|
|
1895
1980
|
*/
|
|
@@ -2186,86 +2271,4 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
|
|
|
2186
2271
|
*/
|
|
2187
2272
|
declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
|
|
2188
2273
|
|
|
2189
|
-
|
|
2190
|
-
interface SerializedViewInfo {
|
|
2191
|
-
/** View ID (same as frame ID) */
|
|
2192
|
-
id: string;
|
|
2193
|
-
/** Whether the view has rendered at least once */
|
|
2194
|
-
rendered: boolean;
|
|
2195
|
-
/** View signature (> 0 = active) */
|
|
2196
|
-
signature: number;
|
|
2197
|
-
/** Observed state keys */
|
|
2198
|
-
observedStateKeys: string[] | null;
|
|
2199
|
-
/** Location observation config */
|
|
2200
|
-
locationObserved: {
|
|
2201
|
-
flag: number;
|
|
2202
|
-
keys: string[];
|
|
2203
|
-
observePath: boolean;
|
|
2204
|
-
};
|
|
2205
|
-
/** Whether view has a template function */
|
|
2206
|
-
hasTemplate: boolean;
|
|
2207
|
-
/** Delegated event types (keys from $evtObjMap) */
|
|
2208
|
-
eventMethodKeys: string[];
|
|
2209
|
-
/** Captured resource keys */
|
|
2210
|
-
resourceKeys: string[];
|
|
2211
|
-
/** Whether view exposes an assign method (supports CrossSite reuse) */
|
|
2212
|
-
hasAssign: boolean;
|
|
2213
|
-
/** Updater refData snapshot (shallow copy of current data) */
|
|
2214
|
-
updaterData: Record<string, unknown> | null;
|
|
2215
|
-
}
|
|
2216
|
-
/** A single node in the serialized frame tree */
|
|
2217
|
-
interface SerializedFrameNode {
|
|
2218
|
-
/** Frame ID (same as owner DOM element ID) */
|
|
2219
|
-
id: string;
|
|
2220
|
-
/** Parent frame ID (null for root) */
|
|
2221
|
-
parentId: string | null;
|
|
2222
|
-
/** View path (v-lark attribute value) */
|
|
2223
|
-
viewPath: string | null;
|
|
2224
|
-
/** Number of child frames */
|
|
2225
|
-
childrenCount: number;
|
|
2226
|
-
/** Number of children that have fired 'created' */
|
|
2227
|
-
readyCount: number;
|
|
2228
|
-
/** Whether children have been created */
|
|
2229
|
-
childrenCreated: number;
|
|
2230
|
-
/** Whether children are in alter state */
|
|
2231
|
-
childrenAlter: number;
|
|
2232
|
-
/** Whether this frame is destroyed */
|
|
2233
|
-
destroyed: number;
|
|
2234
|
-
/** Serialized view info (null if no view mounted) */
|
|
2235
|
-
view: SerializedViewInfo | null;
|
|
2236
|
-
/** Child frame nodes */
|
|
2237
|
-
children: SerializedFrameNode[];
|
|
2238
|
-
}
|
|
2239
|
-
/** Top-level serialized frame tree */
|
|
2240
|
-
interface SerializedFrameTree {
|
|
2241
|
-
/** Root frame node */
|
|
2242
|
-
root: SerializedFrameNode | null;
|
|
2243
|
-
/** Total frame count */
|
|
2244
|
-
totalFrames: number;
|
|
2245
|
-
/** Timestamp of serialization */
|
|
2246
|
-
timestamp: number;
|
|
2247
|
-
/** Root element ID */
|
|
2248
|
-
rootId: string;
|
|
2249
|
-
}
|
|
2250
|
-
declare const FrameVisualBridge: {
|
|
2251
|
-
MSG_PING: string;
|
|
2252
|
-
MSG_PONG: string;
|
|
2253
|
-
MSG_REQUEST_TREE: string;
|
|
2254
|
-
MSG_TREE: string;
|
|
2255
|
-
MSG_TREE_DELTA: string;
|
|
2256
|
-
};
|
|
2257
|
-
/**
|
|
2258
|
-
* Serialize the entire Frame tree starting from root.
|
|
2259
|
-
* Returns an empty snapshot if the app hasn't booted yet.
|
|
2260
|
-
*/
|
|
2261
|
-
declare function serializeFrameTree(): SerializedFrameTree;
|
|
2262
|
-
/**
|
|
2263
|
-
* Install the Frame Visualizer Bridge.
|
|
2264
|
-
* Listens for postMessage events from the visualizer and responds
|
|
2265
|
-
* with serialized frame tree data.
|
|
2266
|
-
*
|
|
2267
|
-
* This should be called once during Framework.boot().
|
|
2268
|
-
*/
|
|
2269
|
-
declare function installFrameVisualizerBridge(): void;
|
|
2270
|
-
|
|
2271
|
-
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, FrameVisualBridge, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, type SerializedFrameNode, type SerializedFrameTree, type SerializedViewInfo, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, defineView, config as frameworkConfig, getRouteMode, installFrameVisualizerBridge, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, serializeFrameTree, unmark, use, useUrlState };
|
|
2274
|
+
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|