haori 0.64.0 → 0.65.0
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.ja.md +9 -4
- package/README.md +9 -4
- package/dist/haori.cjs.js +5 -5
- package/dist/haori.es.js +12 -10
- package/dist/haori.iife.js +5 -5
- package/dist/index.d.ts +7 -5
- package/package.json +2 -2
package/dist/haori.es.js
CHANGED
|
@@ -46,7 +46,8 @@ const ee = class ee {
|
|
|
46
46
|
* CSP モードが有効かどうかを取得します。
|
|
47
47
|
*
|
|
48
48
|
* 有効な場合、式は `new Function` を使わずに評価します(仕様「CSP モードの
|
|
49
|
-
*
|
|
49
|
+
* 式評価」)。既定は有効です。無効にすると従来の方式(`new Function`)で
|
|
50
|
+
* 評価します(仕様「CSP モード」)。
|
|
50
51
|
*
|
|
51
52
|
* @returns CSP モードなら true。
|
|
52
53
|
*/
|
|
@@ -56,7 +57,7 @@ const ee = class ee {
|
|
|
56
57
|
/**
|
|
57
58
|
* CSP モードを設定します。
|
|
58
59
|
*
|
|
59
|
-
* @param enabled 有効にする場合は true。
|
|
60
|
+
* @param enabled 有効にする場合は true。従来の方式にする場合は false。
|
|
60
61
|
* @return 戻り値はありません。
|
|
61
62
|
*/
|
|
62
63
|
static setCsp(e) {
|
|
@@ -146,7 +147,7 @@ const ee = class ee {
|
|
|
146
147
|
return ee._prefix;
|
|
147
148
|
}
|
|
148
149
|
};
|
|
149
|
-
ee._prefix = "data-", ee._runtime = tt, ee._strictBind = !1, ee._csp = !
|
|
150
|
+
ee._prefix = "data-", ee._runtime = tt, ee._strictBind = !1, ee._csp = !0;
|
|
150
151
|
let c = ee;
|
|
151
152
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", c.detect) : c.detect());
|
|
152
153
|
class m {
|
|
@@ -1081,7 +1082,7 @@ function _e(f) {
|
|
|
1081
1082
|
` || f === "\r" || f === "\u2028" || f === "\u2029";
|
|
1082
1083
|
}
|
|
1083
1084
|
function dr(f) {
|
|
1084
|
-
return
|
|
1085
|
+
return /[A-Za-z_$]/.test(f);
|
|
1085
1086
|
}
|
|
1086
1087
|
function ft(f) {
|
|
1087
1088
|
return f !== void 0 && /[A-Za-z0-9_$]/.test(f);
|
|
@@ -3660,7 +3661,7 @@ ${u}return (${y});` + d;
|
|
|
3660
3661
|
static reportEvalBlocked() {
|
|
3661
3662
|
this.evalBlockedReported || (this.evalBlockedReported = !0, m.error(
|
|
3662
3663
|
"[Haori]",
|
|
3663
|
-
`Expressions cannot be compiled because the Content Security Policy does not allow 'unsafe-eval'.
|
|
3664
|
+
`Expressions cannot be compiled because the Content Security Policy does not allow 'unsafe-eval'. Use the CSP mode (the default) by removing data-csp="false" from the <script> or not calling Haori.setCsp(false).`
|
|
3664
3665
|
));
|
|
3665
3666
|
}
|
|
3666
3667
|
/**
|
|
@@ -7752,9 +7753,10 @@ const Re = class Re {
|
|
|
7752
7753
|
* CSP モードを設定します。最初の式の評価より前に呼んでください。
|
|
7753
7754
|
*
|
|
7754
7755
|
* CSP モードでは、式と `*-run` 系の宣言を `new Function` を使わずに評価します
|
|
7755
|
-
* (仕様「CSP
|
|
7756
|
+
* (仕様「CSP モード」)。既定は CSP モードです。false を渡すと従来の方式に
|
|
7757
|
+
* なり、`<script>` に `data-csp="false"` を書いた場合と同じです。
|
|
7756
7758
|
*
|
|
7757
|
-
* @param enabled
|
|
7759
|
+
* @param enabled CSP モードにする場合は true。従来の方式にする場合は false。
|
|
7758
7760
|
* @return 戻り値はありません。
|
|
7759
7761
|
*/
|
|
7760
7762
|
static setCsp(e) {
|
|
@@ -11108,8 +11110,8 @@ const De = "[Haori]", xe = {
|
|
|
11108
11110
|
bodyIgnored: (f) => `${f} is ignored because ${f}-handler is also declared.`,
|
|
11109
11111
|
notRegistered: (f, e) => `Handler "${f}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11110
11112
|
argsNotArray: (f) => `${f}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
11111
|
-
templateInBody: (f) => `${f} with {{...}} is not run in the CSP mode. Write the expression without {{...}}, or use ${f}-handler and ${f}-args
|
|
11112
|
-
notExpression: (f) => `${f} is not run in the CSP mode because it is not a single expression. Use ${f}-handler and ${f}-args
|
|
11113
|
+
templateInBody: (f) => `${f} with {{...}} is not run in the CSP mode (the default). Write the expression without {{...}}, or use ${f}-handler and ${f}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11114
|
+
notExpression: (f) => `${f} is not run in the CSP mode (the default) because it is not a single expression. Use ${f}-handler and ${f}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11113
11115
|
shadowed: (f, e) => `Handler(s) ${f.join(", ")} are shadowed by binding keys of the same name in ${e}; the binding values are used.`
|
|
11114
11116
|
};
|
|
11115
11117
|
class ne {
|
|
@@ -18429,7 +18431,7 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
18429
18431
|
"state"
|
|
18430
18432
|
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18431
18433
|
let Fe = S;
|
|
18432
|
-
const $r = "0.
|
|
18434
|
+
const $r = "0.65.0";
|
|
18433
18435
|
function Pr(f) {
|
|
18434
18436
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
|
|
18435
18437
|
}
|