@lark.js/mvc 0.0.13 → 0.0.15

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 (61) hide show
  1. package/README.md +4 -5
  2. package/dist/apply-style.d.ts +9 -0
  3. package/dist/cache.d.ts +69 -0
  4. package/dist/common.d.ts +64 -0
  5. package/dist/compiler/compile-template.d.ts +16 -0
  6. package/dist/compiler/compile-to-vdom-function.d.ts +13 -0
  7. package/dist/compiler/extract-global-vars.d.ts +17 -0
  8. package/dist/compiler/template-syntax.d.ts +61 -0
  9. package/dist/compiler.cjs +15843 -15805
  10. package/dist/compiler.d.cts +1 -30
  11. package/dist/compiler.d.ts +1 -30
  12. package/dist/compiler.js +15840 -15789
  13. package/dist/cross-site.d.ts +29 -0
  14. package/dist/devtool.cjs +4139 -3166
  15. package/dist/devtool.d.cts +2 -1
  16. package/dist/devtool.d.ts +2 -1
  17. package/dist/devtool.js +4149 -3092
  18. package/dist/dom.d.ts +45 -0
  19. package/dist/event-delegator.d.ts +28 -0
  20. package/dist/event-emitter.d.ts +38 -0
  21. package/dist/frame.d.ts +143 -0
  22. package/dist/framework.d.ts +9 -0
  23. package/dist/hmr.d.ts +53 -0
  24. package/dist/index.amd.js +6285 -0
  25. package/dist/index.cjs +5959 -4484
  26. package/dist/index.d.cts +10 -19
  27. package/dist/index.d.ts +10 -19
  28. package/dist/index.js +5919 -4419
  29. package/dist/index.umd.js +6272 -0
  30. package/dist/mark.d.ts +26 -0
  31. package/dist/module-loader.d.ts +20 -0
  32. package/dist/router.d.ts +14 -0
  33. package/dist/rspack.cjs +15927 -15877
  34. package/dist/rspack.d.cts +45 -23
  35. package/dist/rspack.d.ts +45 -23
  36. package/dist/rspack.js +15926 -15870
  37. package/dist/runtime.amd.js +94 -0
  38. package/dist/runtime.cjs +79 -82
  39. package/dist/runtime.js +85 -19
  40. package/dist/runtime.umd.js +98 -0
  41. package/dist/service.d.ts +173 -0
  42. package/dist/state.d.ts +8 -0
  43. package/dist/store.d.ts +60 -0
  44. package/dist/types.d.ts +1259 -0
  45. package/dist/updater.d.ts +90 -0
  46. package/dist/url-state.d.ts +32 -0
  47. package/dist/utils.d.ts +90 -0
  48. package/dist/vdom.d.ts +45 -0
  49. package/dist/view-registry.d.ts +20 -0
  50. package/dist/view.d.ts +214 -0
  51. package/dist/vite.cjs +15940 -15898
  52. package/dist/vite.d.cts +10 -8
  53. package/dist/vite.d.ts +10 -8
  54. package/dist/vite.js +15937 -15890
  55. package/dist/webpack.cjs +15977 -15877
  56. package/dist/webpack.d.cts +36 -14
  57. package/dist/webpack.d.ts +36 -14
  58. package/dist/webpack.js +15976 -15870
  59. package/package.json +6 -5
  60. package/dist/chunk-66OZBBSP.js +0 -108
  61. /package/{src → dist}/client.d.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -228,13 +228,13 @@ declare class View implements ViewInterface {
228
228
  * Set up a leave confirmation for route changes and page unload.
229
229
  */
230
230
  leaveTip(message: string, condition: () => boolean): void;
231
- /** Collected makes from mixins */
232
- static makes?: AnyFunc[];
231
+ /** Collected ctors from mixins */
232
+ static ctors?: AnyFunc[];
233
233
  /**
234
234
  * Prepare a View subclass by scanning its prototype for event method patterns.
235
235
  * Pattern: `$?name<eventType1,eventType2>(&modifiers)`
236
236
  *
237
- * Only runs once per View subclass (guarded by makes marker).
237
+ * Only runs once per View subclass (guarded by ctors marker).
238
238
  * Called from Frame.mountView before creating the view instance.
239
239
  */
240
240
  static prepare(oView: typeof View): AnyFunc[];
@@ -273,7 +273,7 @@ declare class View implements ViewInterface {
273
273
  * Extend View to create a new View subclass.
274
274
  *
275
275
  * Supports:
276
- * - props.make: constructor-like init (called with initParams + {node, deep})
276
+ * - props.ctor: constructor-like init (called with initParams + {node, deep})
277
277
  * - props.mixins: array of mixin objects
278
278
  * - Event method patterns: `'name<click>'` etc.
279
279
  */
@@ -1074,7 +1074,7 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
1074
1074
  onRender?: (e?: ChangeEvent) => void;
1075
1075
  /**
1076
1076
  * Inherit View to create new view subclass.
1077
- * Supports props.make constructor, props.mixins, and event methods (e.g., `'name<click>'`).
1077
+ * Supports props.ctor constructor, props.mixins, and event methods (e.g., `'name<click>'`).
1078
1078
  * @param props Prototype object containing init, render, and other methods
1079
1079
  * @param statics Object of static methods or properties
1080
1080
  */
@@ -1329,10 +1329,10 @@ interface StateInterface extends EventEmitterInterface<StateInterface> {
1329
1329
  * Keys registered via this method are automatically cleaned when view is destroyed,
1330
1330
  * and corresponding key reference counts are decremented; data is auto-deleted when count reaches zero.
1331
1331
  * @param keys Comma-separated key string
1332
- * @returns Object with make method, called by mixins mechanism
1332
+ * @returns Object with ctor method, called by mixins mechanism
1333
1333
  */
1334
1334
  clean(keys: string): {
1335
- make: AnyFunc;
1335
+ ctor: AnyFunc;
1336
1336
  };
1337
1337
  /**
1338
1338
  * Detect data changes and dispatch changed event.
@@ -1434,17 +1434,9 @@ interface FrameworkInterface {
1434
1434
  getConfig<T = unknown>(key: string): T | undefined;
1435
1435
  /**
1436
1436
  * Merge a patch into the framework configuration and return the merged
1437
- * config object. Replaces the dual-purpose overload of `config()`.
1437
+ * config object.
1438
1438
  */
1439
1439
  setConfig<T extends object = Partial<FrameworkConfig>>(patch: Partial<FrameworkConfig> & T): FrameworkConfig & T;
1440
- /**
1441
- * @deprecated Use `getConfig()` / `getConfig(key)` for reads and
1442
- * `setConfig(patch)` for writes. The overloaded `config()` blurred the
1443
- * two and confused TypeScript inference; the split is a drop-in upgrade.
1444
- */
1445
- config<T extends object = Partial<FrameworkConfig>>(cfg?: Partial<FrameworkConfig> & T): FrameworkConfig & T;
1446
- /** @deprecated See above. */
1447
- config(key: string): unknown;
1448
1440
  /**
1449
1441
  * App initialization entry point, starts framework and renders root view.
1450
1442
  * After invocation: merge config → bind route events → create root Frame → mount default view.
@@ -1758,8 +1750,6 @@ interface CompileOptions {
1758
1750
  file?: string;
1759
1751
  /** Generate VDOM output instead of HTML string (default: false) */
1760
1752
  virtualDom?: boolean;
1761
- /** Use SWC instead of Babel for parsing (default: false) */
1762
- useSwc?: boolean;
1763
1753
  }
1764
1754
 
1765
1755
  /**
@@ -2304,4 +2294,5 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
2304
2294
  */
2305
2295
  declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
2306
2296
 
2307
- 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, type HotContext, 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, reloadViews, resetProjectsMap, unmark, use, useUrlState, vdomCreate };
2297
+ export { CALL_BREAK_TIME, Cache, CrossSite, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, Frame, Framework, LARK_VIEW, Payload, RouterEvents as ROUTER_EVENTS, Router, SPLITTER, Service, State, TAG_NAME_REGEXP, Updater, VIEW_EVENT_METHOD_REGEXP, View, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, reloadViews, resetProjectsMap, unmark, use, useUrlState, vdomCreate };
2298
+ export type { AnyFunc, CacheEntry, CacheInterface, CacheOptions, ChangeEvent, CompileOptions, CrossSiteConfig, DomElement, DomOp, DomRef, EventEmitterInterface, EventListenerEntry, FrameBoundElement, FrameInterface, FrameInvokeEntry, FrameStaticEvent, FrameworkConfig, FrameworkInterface, HotContext, Location, LocationDiff, MixinEventHandler, ParamDiff, ParsedUri, PayloadInterface, PendingCacheEntry, RouteChangeEvent, RouteChangedEvent, RouteViewConfig, RouterInterface, ServiceCacheInfo, ServiceEvent, ServiceMetaEntry, ServiceOptions, StateInterface, StoreApi, UpdaterInterface, VDomCreateFn, VDomNode, VDomRef, VDomTemplate, ViewEvent, ViewEventSelectorEntry, ViewGlobalEventEntry, ViewInterface, ViewLocationObserved, ViewObserveLocation, ViewResourceEntry, ViewTemplate, VoidFunc };
package/dist/index.d.ts CHANGED
@@ -228,13 +228,13 @@ declare class View implements ViewInterface {
228
228
  * Set up a leave confirmation for route changes and page unload.
229
229
  */
230
230
  leaveTip(message: string, condition: () => boolean): void;
231
- /** Collected makes from mixins */
232
- static makes?: AnyFunc[];
231
+ /** Collected ctors from mixins */
232
+ static ctors?: AnyFunc[];
233
233
  /**
234
234
  * Prepare a View subclass by scanning its prototype for event method patterns.
235
235
  * Pattern: `$?name<eventType1,eventType2>(&modifiers)`
236
236
  *
237
- * Only runs once per View subclass (guarded by makes marker).
237
+ * Only runs once per View subclass (guarded by ctors marker).
238
238
  * Called from Frame.mountView before creating the view instance.
239
239
  */
240
240
  static prepare(oView: typeof View): AnyFunc[];
@@ -273,7 +273,7 @@ declare class View implements ViewInterface {
273
273
  * Extend View to create a new View subclass.
274
274
  *
275
275
  * Supports:
276
- * - props.make: constructor-like init (called with initParams + {node, deep})
276
+ * - props.ctor: constructor-like init (called with initParams + {node, deep})
277
277
  * - props.mixins: array of mixin objects
278
278
  * - Event method patterns: `'name<click>'` etc.
279
279
  */
@@ -1074,7 +1074,7 @@ interface ViewInterface extends EventEmitterInterface<ViewInterface> {
1074
1074
  onRender?: (e?: ChangeEvent) => void;
1075
1075
  /**
1076
1076
  * Inherit View to create new view subclass.
1077
- * Supports props.make constructor, props.mixins, and event methods (e.g., `'name<click>'`).
1077
+ * Supports props.ctor constructor, props.mixins, and event methods (e.g., `'name<click>'`).
1078
1078
  * @param props Prototype object containing init, render, and other methods
1079
1079
  * @param statics Object of static methods or properties
1080
1080
  */
@@ -1329,10 +1329,10 @@ interface StateInterface extends EventEmitterInterface<StateInterface> {
1329
1329
  * Keys registered via this method are automatically cleaned when view is destroyed,
1330
1330
  * and corresponding key reference counts are decremented; data is auto-deleted when count reaches zero.
1331
1331
  * @param keys Comma-separated key string
1332
- * @returns Object with make method, called by mixins mechanism
1332
+ * @returns Object with ctor method, called by mixins mechanism
1333
1333
  */
1334
1334
  clean(keys: string): {
1335
- make: AnyFunc;
1335
+ ctor: AnyFunc;
1336
1336
  };
1337
1337
  /**
1338
1338
  * Detect data changes and dispatch changed event.
@@ -1434,17 +1434,9 @@ interface FrameworkInterface {
1434
1434
  getConfig<T = unknown>(key: string): T | undefined;
1435
1435
  /**
1436
1436
  * Merge a patch into the framework configuration and return the merged
1437
- * config object. Replaces the dual-purpose overload of `config()`.
1437
+ * config object.
1438
1438
  */
1439
1439
  setConfig<T extends object = Partial<FrameworkConfig>>(patch: Partial<FrameworkConfig> & T): FrameworkConfig & T;
1440
- /**
1441
- * @deprecated Use `getConfig()` / `getConfig(key)` for reads and
1442
- * `setConfig(patch)` for writes. The overloaded `config()` blurred the
1443
- * two and confused TypeScript inference; the split is a drop-in upgrade.
1444
- */
1445
- config<T extends object = Partial<FrameworkConfig>>(cfg?: Partial<FrameworkConfig> & T): FrameworkConfig & T;
1446
- /** @deprecated See above. */
1447
- config(key: string): unknown;
1448
1440
  /**
1449
1441
  * App initialization entry point, starts framework and renders root view.
1450
1442
  * After invocation: merge config → bind route events → create root Frame → mount default view.
@@ -1758,8 +1750,6 @@ interface CompileOptions {
1758
1750
  file?: string;
1759
1751
  /** Generate VDOM output instead of HTML string (default: false) */
1760
1752
  virtualDom?: boolean;
1761
- /** Use SWC instead of Babel for parsing (default: false) */
1762
- useSwc?: boolean;
1763
1753
  }
1764
1754
 
1765
1755
  /**
@@ -2304,4 +2294,5 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
2304
2294
  */
2305
2295
  declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
2306
2296
 
2307
- 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, type HotContext, 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, reloadViews, resetProjectsMap, unmark, use, useUrlState, vdomCreate };
2297
+ export { CALL_BREAK_TIME, Cache, CrossSite, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, Frame, Framework, LARK_VIEW, Payload, RouterEvents as ROUTER_EVENTS, Router, SPLITTER, Service, State, TAG_NAME_REGEXP, Updater, VIEW_EVENT_METHOD_REGEXP, View, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, reloadViews, resetProjectsMap, unmark, use, useUrlState, vdomCreate };
2298
+ export type { AnyFunc, CacheEntry, CacheInterface, CacheOptions, ChangeEvent, CompileOptions, CrossSiteConfig, DomElement, DomOp, DomRef, EventEmitterInterface, EventListenerEntry, FrameBoundElement, FrameInterface, FrameInvokeEntry, FrameStaticEvent, FrameworkConfig, FrameworkInterface, HotContext, Location, LocationDiff, MixinEventHandler, ParamDiff, ParsedUri, PayloadInterface, PendingCacheEntry, RouteChangeEvent, RouteChangedEvent, RouteViewConfig, RouterInterface, ServiceCacheInfo, ServiceEvent, ServiceMetaEntry, ServiceOptions, StateInterface, StoreApi, UpdaterInterface, VDomCreateFn, VDomNode, VDomRef, VDomTemplate, ViewEvent, ViewEventSelectorEntry, ViewGlobalEventEntry, ViewInterface, ViewLocationObserved, ViewObserveLocation, ViewResourceEntry, ViewTemplate, VoidFunc };