@pie-element/shared-utils 0.1.7-next.20261027193325 → 0.1.7-next.20261110065815

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 (3) hide show
  1. package/LICENSE +45 -0
  2. package/dist/index.js +7 -13
  3. package/package.json +3 -3
package/LICENSE ADDED
@@ -0,0 +1,45 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PIE Framework contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Portions of this software are ported from pie-elements
26
+ (https://github.com/pie-framework/pie-elements), pie-lib
27
+ (https://github.com/pie-framework/pie-lib) and math-validation
28
+ (https://github.com/pie-framework/math-validation), distributed under this
29
+ license:
30
+
31
+ ISC License
32
+
33
+ Copyright 2019 CoreSpring Inc
34
+
35
+ Permission to use, copy, modify, and/or distribute this software for any
36
+ purpose with or without fee is hereby granted, provided that the above
37
+ copyright notice and this permission notice appear in all copies.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
40
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
41
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
42
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
43
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
+ PERFORMANCE OF THIS SOFTWARE.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import e from "dompurify";
2
- //#region src/utils.ts
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
- //#endregion
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
- //#endregion
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 }), !this.#n && (this.#n = !0, this.#e.announce());
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
- //#endregion
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
- //#endregion
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
- //#endregion
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.20261027193325",
3
+ "version": "0.1.7-next.20261110065815",
4
4
  "description": "Shared utilities for PIE elements",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,11 +17,11 @@
17
17
  "scripts": {
18
18
  "build": "rm -rf dist tsconfig.tsbuildinfo && vite build && tsc --emitDeclarationOnly",
19
19
  "dev": "vite build --watch",
20
- "test": "vitest",
20
+ "test": "bun x vitest run --root ../../.. ./",
21
21
  "clean": "rm -rf dist"
22
22
  },
23
23
  "dependencies": {
24
- "@pie-element/shared-types": "0.2.4-next.20261026212738",
24
+ "@pie-element/shared-types": "0.2.4-next.20261110065815",
25
25
  "dompurify": "^3.4.17"
26
26
  },
27
27
  "publishConfig": {