@lark.js/mvc 0.0.15 → 0.0.17

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 (62) hide show
  1. package/README.md +324 -215
  2. package/dist/chunk-OGPBFCIK.js +105 -0
  3. package/dist/client.d.cts +63 -0
  4. package/dist/client.d.ts +10 -34
  5. package/dist/compiler.cjs +15534 -15854
  6. package/dist/compiler.d.cts +1 -1
  7. package/dist/compiler.d.ts +1 -1
  8. package/dist/compiler.js +15519 -15851
  9. package/dist/devtool.cjs +2617 -4152
  10. package/dist/devtool.d.cts +1 -2
  11. package/dist/devtool.d.ts +1 -2
  12. package/dist/devtool.js +2543 -4159
  13. package/dist/index.cjs +4128 -6008
  14. package/dist/index.d.cts +571 -1291
  15. package/dist/index.d.ts +571 -1291
  16. package/dist/index.js +4058 -5976
  17. package/dist/rspack.cjs +15648 -15935
  18. package/dist/rspack.d.cts +8 -45
  19. package/dist/rspack.d.ts +8 -45
  20. package/dist/rspack.js +15641 -15934
  21. package/dist/runtime.cjs +79 -79
  22. package/dist/runtime.js +19 -85
  23. package/dist/vite.cjs +15841 -15957
  24. package/dist/vite.d.cts +6 -7
  25. package/dist/vite.d.ts +6 -7
  26. package/dist/vite.js +15834 -15955
  27. package/dist/webpack.cjs +15648 -15985
  28. package/dist/webpack.d.cts +5 -33
  29. package/dist/webpack.d.ts +5 -33
  30. package/dist/webpack.js +15641 -15984
  31. package/package.json +3 -4
  32. package/dist/apply-style.d.ts +0 -9
  33. package/dist/cache.d.ts +0 -69
  34. package/dist/common.d.ts +0 -64
  35. package/dist/compiler/compile-template.d.ts +0 -16
  36. package/dist/compiler/compile-to-vdom-function.d.ts +0 -13
  37. package/dist/compiler/extract-global-vars.d.ts +0 -17
  38. package/dist/compiler/template-syntax.d.ts +0 -61
  39. package/dist/cross-site.d.ts +0 -29
  40. package/dist/dom.d.ts +0 -45
  41. package/dist/event-delegator.d.ts +0 -28
  42. package/dist/event-emitter.d.ts +0 -38
  43. package/dist/frame.d.ts +0 -143
  44. package/dist/framework.d.ts +0 -9
  45. package/dist/hmr.d.ts +0 -53
  46. package/dist/index.amd.js +0 -6285
  47. package/dist/index.umd.js +0 -6272
  48. package/dist/mark.d.ts +0 -26
  49. package/dist/module-loader.d.ts +0 -20
  50. package/dist/router.d.ts +0 -14
  51. package/dist/runtime.amd.js +0 -94
  52. package/dist/runtime.umd.js +0 -98
  53. package/dist/service.d.ts +0 -173
  54. package/dist/state.d.ts +0 -8
  55. package/dist/store.d.ts +0 -60
  56. package/dist/types.d.ts +0 -1259
  57. package/dist/updater.d.ts +0 -90
  58. package/dist/url-state.d.ts +0 -32
  59. package/dist/utils.d.ts +0 -90
  60. package/dist/vdom.d.ts +0 -45
  61. package/dist/view-registry.d.ts +0 -20
  62. package/dist/view.d.ts +0 -214
package/dist/runtime.cjs CHANGED
@@ -1,92 +1,92 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- /**
4
- * Lark framework constants.
5
- */
6
- /** Global counter for generating unique IDs */
7
- /** Internal splitter character (U+001E Record Separator, invisible, used as namespace separator).
8
- * Uses String.fromCharCode to survive bundlers that strip control-char literals. */
9
- const SPLITTER = String.fromCharCode(0x1e);
10
- // ============================================================
11
- // Encoding helpers (shared by dom.ts, runtime.ts, updater.ts)
12
- // ============================================================
13
- const HTML_ENT_MAP = {
14
- "&": "amp",
15
- "<": "lt",
16
- ">": "gt",
17
- '"': "#34",
18
- "'": "#39",
19
- "`": "#96",
20
+ // src/runtime.ts
21
+ var runtime_exports = {};
22
+ __export(runtime_exports, {
23
+ encHtml: () => encHtml,
24
+ encQuote: () => encQuote,
25
+ encUri: () => encUri,
26
+ refFn: () => refFn,
27
+ strSafe: () => strSafe2
28
+ });
29
+ module.exports = __toCommonJS(runtime_exports);
30
+
31
+ // src/common.ts
32
+ var SPLITTER = String.fromCharCode(30);
33
+ var EVENT_METHOD_REGEXP = new RegExp(
34
+ `(?:([\\w-]+)${SPLITTER})?([^(]+)\\(([\\s\\S]*?)?\\)`
35
+ );
36
+ var HTML_ENT_MAP = {
37
+ "&": "amp",
38
+ "<": "lt",
39
+ ">": "gt",
40
+ '"': "#34",
41
+ "'": "#39",
42
+ "`": "#96"
20
43
  };
21
- const HTML_ENT_REGEXP = /[&<>"'`]/g;
22
- /** Null-safe String conversion */
23
- function strSafe$1(v) {
24
- return String(v == null ? "" : v);
44
+ var HTML_ENT_REGEXP = /[&<>"'`]/g;
45
+ function strSafe(v) {
46
+ return String(v == null ? "" : v);
25
47
  }
26
- /** HTML entity encoding for safe output */
27
48
  function encodeHTML(v) {
28
- return String(v == null ? "" : v).replace(HTML_ENT_REGEXP, (m) => "&" + HTML_ENT_MAP[m] + ";");
49
+ return String(v == null ? "" : v).replace(
50
+ HTML_ENT_REGEXP,
51
+ (m) => "&" + HTML_ENT_MAP[m] + ";"
52
+ );
29
53
  }
30
- const URI_ENT_MAP = {
31
- "!": "%21",
32
- "'": "%27",
33
- "(": "%28",
34
- ")": "%29",
35
- "*": "%2A",
54
+ var URI_ENT_MAP = {
55
+ "!": "%21",
56
+ "'": "%27",
57
+ "(": "%28",
58
+ ")": "%29",
59
+ "*": "%2A"
36
60
  };
37
- const URI_ENT_REGEXP = /[!')(*]/g;
38
- /** URI-encode with extra character encoding */
61
+ var URI_ENT_REGEXP = /[!')(*]/g;
39
62
  function encodeURIExtra(v) {
40
- return encodeURIComponent(strSafe$1(v)).replace(URI_ENT_REGEXP, (m) => URI_ENT_MAP[m]);
63
+ return encodeURIComponent(strSafe(v)).replace(URI_ENT_REGEXP, (m) => URI_ENT_MAP[m]);
41
64
  }
42
- const QUOTE_ENT_REGEXP = /['"\\]/g;
43
- /** Quote-encode for attribute values */
65
+ var QUOTE_ENT_REGEXP = /['"\\]/g;
44
66
  function encodeQuote(v) {
45
- return strSafe$1(v).replace(QUOTE_ENT_REGEXP, "\\$&");
67
+ return strSafe(v).replace(QUOTE_ENT_REGEXP, "\\$&");
46
68
  }
47
- /**
48
- * Template reference function for creating stable keys for objects.
49
- * Stores objects in refData with SPLITTER-prefixed keys.
50
- */
51
69
  function refFn(ref, value, key) {
52
- const counter = ref[SPLITTER];
53
- for (let i = counter; --i;) {
54
- key = SPLITTER + i;
55
- if (ref[key] === value)
56
- return key;
57
- }
58
- key = SPLITTER + ref[SPLITTER]++;
59
- ref[key] = value;
60
- return key;
70
+ const counter = ref[SPLITTER];
71
+ for (let i = counter; --i; ) {
72
+ key = SPLITTER + i;
73
+ if (ref[key] === value) return key;
74
+ }
75
+ key = SPLITTER + ref[SPLITTER]++;
76
+ ref[key] = value;
77
+ return key;
61
78
  }
62
- // export function isCjs(): boolean {
63
- // return typeof module !== "undefined" && typeof module.exports !== "undefined";
64
- // }
65
-
66
- /**
67
- * Template runtime helpers.
68
- *
69
- * Compiled templates import these helpers from `@lark.js/mvc/runtime` instead
70
- * of inlining the implementations. That keeps each compiled `.html` module
71
- * small — no more ~400 bytes of duplicated helper code per template.
72
- *
73
- * The helpers below are aliased to `$strSafe / $encHtml / $encUri / $encQuote /
74
- * $refFn` inside the IIFE that the compiler produces — see `compiler.ts`.
75
- *
76
- * Canonical implementations live in `./common` so that dom.ts, runtime.ts,
77
- * and updater.ts all share a single copy.
78
- */
79
- /** Null-safe `String(value)` — `null`/`undefined` become `""`. */
80
- const strSafe = strSafe$1;
81
- /** HTML-escape a value for safe embedding in markup. */
82
- const encHtml = encodeHTML;
83
- /** Percent-encode a value, with extra characters escaped for stricter URIs. */
84
- const encUri = encodeURIExtra;
85
- /** Backslash-escape quotes and backslashes for attribute string contents. */
86
- const encQuote = encodeQuote;
87
79
 
88
- exports.encHtml = encHtml;
89
- exports.encQuote = encQuote;
90
- exports.encUri = encUri;
91
- exports.refFn = refFn;
92
- exports.strSafe = strSafe;
80
+ // src/runtime.ts
81
+ var strSafe2 = strSafe;
82
+ var encHtml = encodeHTML;
83
+ var encUri = encodeURIExtra;
84
+ var encQuote = encodeQuote;
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ encHtml,
88
+ encQuote,
89
+ encUri,
90
+ refFn,
91
+ strSafe
92
+ });
package/dist/runtime.js CHANGED
@@ -1,86 +1,20 @@
1
- /**
2
- * Lark framework constants.
3
- */
4
- /** Global counter for generating unique IDs */
5
- /** Internal splitter character (U+001E Record Separator, invisible, used as namespace separator).
6
- * Uses String.fromCharCode to survive bundlers that strip control-char literals. */
7
- const SPLITTER = String.fromCharCode(0x1e);
8
- // ============================================================
9
- // Encoding helpers (shared by dom.ts, runtime.ts, updater.ts)
10
- // ============================================================
11
- const HTML_ENT_MAP = {
12
- "&": "amp",
13
- "<": "lt",
14
- ">": "gt",
15
- '"': "#34",
16
- "'": "#39",
17
- "`": "#96",
18
- };
19
- const HTML_ENT_REGEXP = /[&<>"'`]/g;
20
- /** Null-safe String conversion */
21
- function strSafe$1(v) {
22
- return String(v == null ? "" : v);
23
- }
24
- /** HTML entity encoding for safe output */
25
- function encodeHTML(v) {
26
- return String(v == null ? "" : v).replace(HTML_ENT_REGEXP, (m) => "&" + HTML_ENT_MAP[m] + ";");
27
- }
28
- const URI_ENT_MAP = {
29
- "!": "%21",
30
- "'": "%27",
31
- "(": "%28",
32
- ")": "%29",
33
- "*": "%2A",
34
- };
35
- const URI_ENT_REGEXP = /[!')(*]/g;
36
- /** URI-encode with extra character encoding */
37
- function encodeURIExtra(v) {
38
- return encodeURIComponent(strSafe$1(v)).replace(URI_ENT_REGEXP, (m) => URI_ENT_MAP[m]);
39
- }
40
- const QUOTE_ENT_REGEXP = /['"\\]/g;
41
- /** Quote-encode for attribute values */
42
- function encodeQuote(v) {
43
- return strSafe$1(v).replace(QUOTE_ENT_REGEXP, "\\$&");
44
- }
45
- /**
46
- * Template reference function for creating stable keys for objects.
47
- * Stores objects in refData with SPLITTER-prefixed keys.
48
- */
49
- function refFn(ref, value, key) {
50
- const counter = ref[SPLITTER];
51
- for (let i = counter; --i;) {
52
- key = SPLITTER + i;
53
- if (ref[key] === value)
54
- return key;
55
- }
56
- key = SPLITTER + ref[SPLITTER]++;
57
- ref[key] = value;
58
- return key;
59
- }
60
- // export function isCjs(): boolean {
61
- // return typeof module !== "undefined" && typeof module.exports !== "undefined";
62
- // }
1
+ import {
2
+ encodeHTML,
3
+ encodeQuote,
4
+ encodeURIExtra,
5
+ refFn,
6
+ strSafe
7
+ } from "./chunk-OGPBFCIK.js";
63
8
 
64
- /**
65
- * Template runtime helpers.
66
- *
67
- * Compiled templates import these helpers from `@lark.js/mvc/runtime` instead
68
- * of inlining the implementations. That keeps each compiled `.html` module
69
- * small — no more ~400 bytes of duplicated helper code per template.
70
- *
71
- * The helpers below are aliased to `$strSafe / $encHtml / $encUri / $encQuote /
72
- * $refFn` inside the IIFE that the compiler produces — see `compiler.ts`.
73
- *
74
- * Canonical implementations live in `./common` so that dom.ts, runtime.ts,
75
- * and updater.ts all share a single copy.
76
- */
77
- /** Null-safe `String(value)` — `null`/`undefined` become `""`. */
78
- const strSafe = strSafe$1;
79
- /** HTML-escape a value for safe embedding in markup. */
80
- const encHtml = encodeHTML;
81
- /** Percent-encode a value, with extra characters escaped for stricter URIs. */
82
- const encUri = encodeURIExtra;
83
- /** Backslash-escape quotes and backslashes for attribute string contents. */
84
- const encQuote = encodeQuote;
85
-
86
- export { encHtml, encQuote, encUri, refFn, strSafe };
9
+ // src/runtime.ts
10
+ var strSafe2 = strSafe;
11
+ var encHtml = encodeHTML;
12
+ var encUri = encodeURIExtra;
13
+ var encQuote = encodeQuote;
14
+ export {
15
+ encHtml,
16
+ encQuote,
17
+ encUri,
18
+ refFn,
19
+ strSafe2 as strSafe
20
+ };