@lark.js/mvc 0.0.15 → 0.0.16
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 +324 -215
- package/dist/chunk-OGPBFCIK.js +105 -0
- package/dist/client.d.cts +63 -0
- package/dist/client.d.ts +10 -34
- package/dist/compiler.cjs +15534 -15854
- package/dist/compiler.js +15519 -15851
- package/dist/devtool.cjs +2617 -4152
- package/dist/devtool.d.cts +1 -2
- package/dist/devtool.d.ts +1 -2
- package/dist/devtool.js +2543 -4159
- package/dist/index.cjs +4128 -6008
- package/dist/index.d.cts +568 -1288
- package/dist/index.d.ts +568 -1288
- package/dist/index.js +4058 -5976
- package/dist/rspack.cjs +15648 -15935
- package/dist/rspack.d.cts +5 -42
- package/dist/rspack.d.ts +5 -42
- package/dist/rspack.js +15641 -15934
- package/dist/runtime.cjs +79 -79
- package/dist/runtime.js +19 -85
- package/dist/vite.cjs +15841 -15957
- package/dist/vite.d.cts +1 -2
- package/dist/vite.d.ts +1 -2
- package/dist/vite.js +15834 -15955
- package/dist/webpack.cjs +15648 -15985
- package/dist/webpack.d.cts +4 -32
- package/dist/webpack.d.ts +4 -32
- package/dist/webpack.js +15641 -15984
- package/package.json +3 -4
- package/dist/apply-style.d.ts +0 -9
- package/dist/cache.d.ts +0 -69
- package/dist/common.d.ts +0 -64
- package/dist/compiler/compile-template.d.ts +0 -16
- package/dist/compiler/compile-to-vdom-function.d.ts +0 -13
- package/dist/compiler/extract-global-vars.d.ts +0 -17
- package/dist/compiler/template-syntax.d.ts +0 -61
- package/dist/cross-site.d.ts +0 -29
- package/dist/dom.d.ts +0 -45
- package/dist/event-delegator.d.ts +0 -28
- package/dist/event-emitter.d.ts +0 -38
- package/dist/frame.d.ts +0 -143
- package/dist/framework.d.ts +0 -9
- package/dist/hmr.d.ts +0 -53
- package/dist/index.amd.js +0 -6285
- package/dist/index.umd.js +0 -6272
- package/dist/mark.d.ts +0 -26
- package/dist/module-loader.d.ts +0 -20
- package/dist/router.d.ts +0 -14
- package/dist/runtime.amd.js +0 -94
- package/dist/runtime.umd.js +0 -98
- package/dist/service.d.ts +0 -173
- package/dist/state.d.ts +0 -8
- package/dist/store.d.ts +0 -60
- package/dist/types.d.ts +0 -1259
- package/dist/updater.d.ts +0 -90
- package/dist/url-state.d.ts +0 -32
- package/dist/utils.d.ts +0 -90
- package/dist/vdom.d.ts +0 -45
- package/dist/view-registry.d.ts +0 -20
- package/dist/view.d.ts +0 -214
package/dist/runtime.cjs
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
49
|
+
return String(v == null ? "" : v).replace(
|
|
50
|
+
HTML_ENT_REGEXP,
|
|
51
|
+
(m) => "&" + HTML_ENT_MAP[m] + ";"
|
|
52
|
+
);
|
|
29
53
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
54
|
+
var URI_ENT_MAP = {
|
|
55
|
+
"!": "%21",
|
|
56
|
+
"'": "%27",
|
|
57
|
+
"(": "%28",
|
|
58
|
+
")": "%29",
|
|
59
|
+
"*": "%2A"
|
|
36
60
|
};
|
|
37
|
-
|
|
38
|
-
/** URI-encode with extra character encoding */
|
|
61
|
+
var URI_ENT_REGEXP = /[!')(*]/g;
|
|
39
62
|
function encodeURIExtra(v) {
|
|
40
|
-
|
|
63
|
+
return encodeURIComponent(strSafe(v)).replace(URI_ENT_REGEXP, (m) => URI_ENT_MAP[m]);
|
|
41
64
|
}
|
|
42
|
-
|
|
43
|
-
/** Quote-encode for attribute values */
|
|
65
|
+
var QUOTE_ENT_REGEXP = /['"\\]/g;
|
|
44
66
|
function encodeQuote(v) {
|
|
45
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
};
|