@pie-element/shared-utils 0.1.7-next.20261027193325 → 0.1.7-next.20261110055344
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/dist/index.js +7 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "dompurify";
|
|
2
|
-
|
|
2
|
+
// src/utils.ts
|
|
3
3
|
function t(e) {
|
|
4
4
|
let t = typeof process < "u" && process.env?.DEBUG?.includes(e);
|
|
5
5
|
return (...n) => {
|
|
@@ -57,8 +57,7 @@ function d(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
//#region src/authored-colors.ts
|
|
60
|
+
// src/authored-colors.ts
|
|
62
61
|
var f = "data-pie-authored-ink", p = "data-pie-authored-fill", m = "data-pie-authored-border", ee = [
|
|
63
62
|
"border-top-color",
|
|
64
63
|
"border-right-color",
|
|
@@ -291,8 +290,7 @@ function P(e) {
|
|
|
291
290
|
function F(e, t, n) {
|
|
292
291
|
return Math.min(n, Math.max(t, e));
|
|
293
292
|
}
|
|
294
|
-
|
|
295
|
-
//#region src/prompt-audio.ts
|
|
293
|
+
// src/prompt-audio.ts
|
|
296
294
|
var I = (e) => !!e?.autoplayAudioEnabled && !e?.autoplayAudioHeld, L = ["autoplay"];
|
|
297
295
|
function R(e, t) {
|
|
298
296
|
let n = e.audioStartTime || t.audioStartTime, r = e.audioEndTime || t.audioEndTime, i = {
|
|
@@ -326,7 +324,7 @@ var se = class {
|
|
|
326
324
|
this.#i({ audioStartTime: e });
|
|
327
325
|
}
|
|
328
326
|
recordEnd(e = Date.now()) {
|
|
329
|
-
this.#i({ audioEndTime: e }),
|
|
327
|
+
this.#i({ audioEndTime: e }), this.#n || (this.#n = !0, this.#e.announce());
|
|
330
328
|
}
|
|
331
329
|
recordFailure() {
|
|
332
330
|
this.#r || (this.#r = !0, this.#e.announce());
|
|
@@ -411,8 +409,7 @@ function ce(e) {
|
|
|
411
409
|
let n = document.createElement("img");
|
|
412
410
|
return n.src = e, n.alt = "Click anywhere to enable audio autoplay", n.width = 500, n.height = 300, t.appendChild(n), t;
|
|
413
411
|
}
|
|
414
|
-
|
|
415
|
-
//#region src/sanitize-model-html.ts
|
|
412
|
+
// src/sanitize-model-html.ts
|
|
416
413
|
var K = [
|
|
417
414
|
"script",
|
|
418
415
|
"embed",
|
|
@@ -513,14 +510,12 @@ function _e(t) {
|
|
|
513
510
|
}
|
|
514
511
|
return Z.set(n, i), Q += a, i;
|
|
515
512
|
}
|
|
516
|
-
|
|
517
|
-
//#region src/ime.ts
|
|
513
|
+
// src/ime.ts
|
|
518
514
|
var ve = 229;
|
|
519
515
|
function ye(e) {
|
|
520
516
|
return e ? !!(e.isComposing || e.nativeEvent?.isComposing || e.keyCode === ve) : !1;
|
|
521
517
|
}
|
|
522
|
-
|
|
523
|
-
//#region src/inline-direction.ts
|
|
518
|
+
// src/inline-direction.ts
|
|
524
519
|
function $(e) {
|
|
525
520
|
let t = e?.ownerDocument?.defaultView;
|
|
526
521
|
return !!(e && t && t.getComputedStyle(e).direction === "rtl");
|
|
@@ -528,5 +523,4 @@ function $(e) {
|
|
|
528
523
|
function be(e, t) {
|
|
529
524
|
if (e === "ArrowLeft" || e === "ArrowRight") return e === "ArrowLeft" === $(t) ? "inline-end" : "inline-start";
|
|
530
525
|
}
|
|
531
|
-
//#endregion
|
|
532
526
|
export { m as AUTHORED_BORDER_ATTR, p as AUTHORED_FILL_ATTR, f as AUTHORED_INK_ATTR, L as AUTOPLAY_AUDIO_MARKUP_ATTRS, q as MODEL_HTML_FORBIDDEN_ATTRS, K as MODEL_HTML_FORBIDDEN_TAGS, J as PLAY_AUDIO_ATTR, se as PromptAudioTracker, G as PromptAudioWatcher, u as assignProps, I as autoplayAudioOn, B as bindPromptAudio, a as clamp, s as debounce, t as debug, be as inlineSideOfArrow, ye as isComposingKeyEvent, n as isEmpty, $ as isRightToLeft, g as markAuthoredColors, H as promptAudioPending, _e as sanitizeModelHtml, d as sessionsEqual, r as showFeedback, i as showRationale, c as shuffle, o as uuid, R as withPromptAudioTiming };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/shared-utils",
|
|
3
|
-
"version": "0.1.7-next.
|
|
3
|
+
"version": "0.1.7-next.20261110055344",
|
|
4
4
|
"description": "Shared utilities for PIE elements",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"clean": "rm -rf dist"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pie-element/shared-types": "0.2.4-next.
|
|
24
|
+
"@pie-element/shared-types": "0.2.4-next.20261109184540",
|
|
25
25
|
"dompurify": "^3.4.17"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|