@pie-lib/text-select 4.0.8-next.20261109125924 → 4.0.8-next.20261110063142

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/i18n/ar.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/ar.ts
1
+ // src/i18n/ar.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "صحيح",
4
4
  incorrectSelection: "تحديد غير صحيح",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "نص قابل للتحديد، حدِّد ما يصل إلى {max}",
9
9
  tokenPosition: "{index} من {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/cy.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/cy.ts
1
+ // src/i18n/cy.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Cywir",
4
4
  incorrectSelection: "Dewis anghywir",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Testun y gellir ei ddewis, dewiswch hyd at {max}",
9
9
  tokenPosition: "{index} o {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/i18n/en-AU.ts
1
+ // src/i18n/en-AU.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Correct",
4
4
  incorrectSelection: "Incorrect Selection",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Selectable text, select up to {max}",
9
9
  tokenPosition: "{index} of {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/i18n/en-GB.ts
1
+ // src/i18n/en-GB.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Correct",
4
4
  incorrectSelection: "Incorrect Selection",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Selectable text, select up to {max}",
9
9
  tokenPosition: "{index} of {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/i18n/en-US.ts
1
+ // src/i18n/en-US.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Correct",
4
4
  incorrectSelection: "Incorrect Selection",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Selectable text, select up to {max}",
9
9
  tokenPosition: "{index} of {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/es.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/es.ts
1
+ // src/i18n/es.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Respuesta Correcta",
4
4
  incorrectSelection: "Selección Incorrecta",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Texto seleccionable, selecciona hasta {max}",
9
9
  tokenPosition: "{index} de {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/fr.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/fr.ts
1
+ // src/i18n/fr.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Correct",
4
4
  incorrectSelection: "Sélection incorrecte",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Texte sélectionnable, sélection jusqu'à {max}",
9
9
  tokenPosition: "{index} sur {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  import e from "./en-US.js";
2
2
  import { defineCatalogs as t } from "@pie-element/shared-i18n";
3
- //#region src/i18n/index.ts
3
+ // src/i18n/index.ts
4
4
  var n = t({
5
5
  packageName: "@pie-lib/text-select",
6
6
  source: e,
@@ -63,5 +63,4 @@ var n = t({
63
63
  )
64
64
  }
65
65
  });
66
- //#endregion
67
66
  export { n as catalogs };
package/dist/i18n/ja.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/ja.ts
1
+ // src/i18n/ja.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "正解",
4
4
  incorrectSelection: "誤った選択",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "選択できるテキスト(最大{max}個まで選択)",
9
9
  tokenPosition: "{total}個中{index}番目"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/ko.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/ko.ts
1
+ // src/i18n/ko.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "정답",
4
4
  incorrectSelection: "잘못된 선택",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "선택 가능한 텍스트, 최대 {max}개 선택",
9
9
  tokenPosition: "{total}개 중 {index}번째"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/i18n/nl-NL.ts
1
+ // src/i18n/nl-NL.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Juist",
4
4
  incorrectSelection: "Onjuiste selectie",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Selecteerbare tekst, selecteer maximaal {max}",
9
9
  tokenPosition: "{index} van {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/pt.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/pt.ts
1
+ // src/i18n/pt.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Correto",
4
4
  incorrectSelection: "Seleção incorreta",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Texto selecionável, selecione até {max}",
9
9
  tokenPosition: "{index} de {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/ro.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/ro.ts
1
+ // src/i18n/ro.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Corect",
4
4
  incorrectSelection: "Selecție greșită",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Text selectabil, selectează cel mult {max}",
9
9
  tokenPosition: "{index} din {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/sv.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/sv.ts
1
+ // src/i18n/sv.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "Rätt",
4
4
  incorrectSelection: "Felaktig markering",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "Markerbar text, markera upp till {max}",
9
9
  tokenPosition: "{index} av {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/i18n/th-TH.ts
1
+ // src/i18n/th-TH.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "ถูกต้อง",
4
4
  incorrectSelection: "การเลือกที่ไม่ถูกต้อง",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "ข้อความที่เลือกได้ เลือกได้สูงสุด {max} รายการ",
9
9
  tokenPosition: "{index} จาก {total}"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/i18n/zh.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/i18n/zh.ts
1
+ // src/i18n/zh.ts
2
2
  var e = {
3
3
  correctAnswerSelected: "正确",
4
4
  incorrectSelection: "错误选择",
@@ -8,5 +8,4 @@ var e = {
8
8
  textGroupWithLimit: "可选文本,最多选择 {max} 项",
9
9
  tokenPosition: "第 {index} 项,共 {total} 项"
10
10
  };
11
- //#endregion
12
11
  export { e as default };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Tokenizer as e } from "./tokenizer/index.js";
2
- import { Token as t, TokenTypes as n } from "./token-select/token.js";
3
- import { TokenSelect as r } from "./token-select/index.js";
4
- import i from "./text-select.js";
5
- import { Legend as a } from "./legend.js";
2
+ import { TokenSelect as t } from "./token-select/index.js";
3
+ import n from "./text-select.js";
4
+ import { Legend as r } from "./legend.js";
5
+ import { Token as i, TokenTypes as a } from "./token-select/token.js";
6
6
  import { prepareText as o } from "./utils.js";
7
- export { a as Legend, i as TextSelect, t as Token, r as TokenSelect, n as TokenTypes, e as Tokenizer, o as prepareText };
7
+ export { r as Legend, n as TextSelect, i as Token, t as TokenSelect, a as TokenTypes, e as Tokenizer, o as prepareText };
package/dist/legend.js CHANGED
@@ -5,7 +5,7 @@ import { color as r } from "@pie-lib/render-ui";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  import o from "@mui/icons-material/Check";
7
7
  import s from "@mui/icons-material/Close";
8
- //#region src/legend.tsx
8
+ // src/legend.tsx
9
9
  var c = `1px solid ${r.v("pie")("border-light", "lightgrey")}`, l = n("div")(({ theme: e }) => ({
10
10
  display: "flex",
11
11
  flexDirection: "row",
@@ -60,5 +60,4 @@ var c = `1px solid ${r.v("pie")("border-light", "lightgrey")}`, l = n("div")(({
60
60
  ];
61
61
  return r && c.splice(1, 2), /* @__PURE__ */ a(l, { children: [/* @__PURE__ */ i(u, { children: s.t("key") }), c.map(({ Icon: e, label: t, Container: n }, r) => /* @__PURE__ */ a(n, { children: [/* @__PURE__ */ i(e, {}), /* @__PURE__ */ i("span", { children: t })] }, r))] });
62
62
  };
63
- //#endregion
64
63
  export { v as Legend };
@@ -1,4 +1,4 @@
1
- //#region ../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
1
+ // ../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
2
2
  function e(t) {
3
3
  var n, r, i = "";
4
4
  if (typeof t == "string" || typeof t == "number") i += t;
@@ -14,5 +14,4 @@ function t() {
14
14
  for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
15
15
  return i;
16
16
  }
17
- //#endregion
18
17
  export { t as clsx, t as default };
@@ -1,17 +1,17 @@
1
- import { normalize as e } from "./tokenizer/builder.js";
2
- import { TokenTypes as t } from "./token-select/token.js";
3
- import { TokenSelect as n } from "./token-select/index.js";
1
+ import { TokenSelect as e } from "./token-select/index.js";
2
+ import { normalize as t } from "./tokenizer/builder.js";
3
+ import { TokenTypes as n } from "./token-select/token.js";
4
4
  import r from "react";
5
5
  import i from "prop-types";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  import o from "debug";
8
- //#region src/text-select.tsx
8
+ // src/text-select.tsx
9
9
  var s = o("@pie-lib:text-select"), c = class extends r.Component {
10
10
  static propTypes = {
11
11
  onChange: i.func,
12
12
  disabled: i.bool,
13
- tokens: i.arrayOf(i.shape(t)).isRequired,
14
- selectedTokens: i.arrayOf(i.shape(t)).isRequired,
13
+ tokens: i.arrayOf(i.shape(n)).isRequired,
14
+ selectedTokens: i.arrayOf(i.shape(n)).isRequired,
15
15
  text: i.string.isRequired,
16
16
  className: i.string,
17
17
  highlightChoices: i.bool,
@@ -32,7 +32,7 @@ var s = o("@pie-lib:text-select"), c = class extends r.Component {
32
32
  })));
33
33
  };
34
34
  render() {
35
- let { text: t, disabled: r, tokens: i, selectedTokens: o, className: c, highlightChoices: l, maxNoOfSelections: u, animationsDisabled: d, language: f, eliminatedTokens: p } = this.props, m = e(t, i);
35
+ let { text: n, disabled: r, tokens: i, selectedTokens: o, className: c, highlightChoices: l, maxNoOfSelections: u, animationsDisabled: d, language: f, eliminatedTokens: p } = this.props, m = t(n, i);
36
36
  s("normalized: ", m);
37
37
  let h = m.map((e) => {
38
38
  let t = o.findIndex((t) => t.start === e.start && t.end === e.end) !== -1, n = t ? e.correct : void 0, i = e.isMissing, a = !!e.predefined && (p || []).some((t) => t.start === e.start && t.end === e.end);
@@ -45,7 +45,7 @@ var s = o("@pie-lib:text-select"), c = class extends r.Component {
45
45
  eliminated: a
46
46
  };
47
47
  });
48
- return /* @__PURE__ */ a(n, {
48
+ return /* @__PURE__ */ a(e, {
49
49
  highlightChoices: !r && l,
50
50
  className: c,
51
51
  tokens: h,
@@ -57,5 +57,4 @@ var s = o("@pie-lib:text-select"), c = class extends r.Component {
57
57
  });
58
58
  }
59
59
  };
60
- //#endregion
61
60
  export { c as default };
@@ -11,7 +11,7 @@ import p from "debug";
11
11
  import { renderToString as m } from "react-dom/server";
12
12
  import { sanitizeModelHtml as h } from "@pie-element/shared-utils";
13
13
  import { dynamicMessageKey as g } from "@pie-element/shared-i18n";
14
- //#region src/token-select/index.tsx
14
+ // src/token-select/index.tsx
15
15
  var _ = p("@pie-lib:text-select:token-select"), v = a("div")(() => ({
16
16
  backgroundColor: "none",
17
17
  whiteSpace: "pre",
@@ -275,5 +275,4 @@ var _ = p("@pie-lib:text-select:token-select"), v = a("div")(() => ({
275
275
  ] });
276
276
  }
277
277
  };
278
- //#endregion
279
278
  export { D as TokenSelect, D as default, t as TokenTypes };
@@ -6,7 +6,7 @@ import { color as i } from "@pie-lib/render-ui";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  import s from "@mui/icons-material/Check";
8
8
  import c from "@mui/icons-material/Close";
9
- //#region src/token-select/token.tsx
9
+ // src/token-select/token.tsx
10
10
  var l = 3.2, u = 3.4, d = 2, f = () => i.v("pie")("focus-outline", "button-focus-outline", "focus-checked-border", i.defaults.FOCUS_CHECKED_BORDER), p = r("span")(({ theme: e }) => ({
11
11
  cursor: "pointer",
12
12
  textIndent: 0,
@@ -145,5 +145,4 @@ var S = {
145
145
  });
146
146
  }
147
147
  };
148
- //#endregion
149
148
  export { C as Token, C as default, S as TokenTypes };
@@ -1,6 +1,6 @@
1
1
  import { clone as e, compact as t } from "@pie-element/shared-lodash";
2
2
  import n from "@pie-framework/parse-english";
3
- //#region src/tokenizer/builder.ts
3
+ // src/tokenizer/builder.ts
4
4
  var r = (e, t) => t.children ? t.children.reduce(r, e) : t.value ? e + t.value : e, i = (e) => r("", e), a = (e) => r("", e), o = (e) => r("", e), s = (e) => new n().parse(e).children.reduce((e, t) => {
5
5
  if (t.type === "ParagraphNode") {
6
6
  let n = {
@@ -123,5 +123,4 @@ var r = (e, t) => t.children ? t.children.reduce(r, e) : t.value ? e + t.value :
123
123
  lastIndex: 0
124
124
  }).result;
125
125
  };
126
- //#endregion
127
126
  export { c as handleSentence, f as intersection, m as normalize, s as paragraphs, l as sentences, p as sort, u as words };
@@ -6,7 +6,7 @@ import i from "@mui/material/Switch";
6
6
  import a from "@mui/material/FormControlLabel";
7
7
  import { color as o } from "@pie-lib/render-ui";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
- //#region src/tokenizer/controls.tsx
9
+ // src/tokenizer/controls.tsx
10
10
  var l = r("div")(() => ({
11
11
  display: "flex",
12
12
  alignItems: "center",
@@ -64,5 +64,4 @@ var l = r("div")(() => ({
64
64
  })] });
65
65
  }
66
66
  };
67
- //#endregion
68
67
  export { f as Controls, f as default };
@@ -7,7 +7,7 @@ import { styled as s } from "@mui/material/styles";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  import { clone as u, differenceWith as d, isEqual as f } from "@pie-element/shared-lodash";
9
9
  import { noSelect as p } from "@pie-lib/style-utils";
10
- //#region src/tokenizer/index.tsx
10
+ // src/tokenizer/index.tsx
11
11
  var m = s("div")(({ disabled: e }) => ({
12
12
  whiteSpace: "pre-wrap",
13
13
  ...e && { ...p() }
@@ -87,5 +87,4 @@ var m = s("div")(({ disabled: e }) => ({
87
87
  })] });
88
88
  }
89
89
  };
90
- //#endregion
91
90
  export { h as Tokenizer, h as default };
@@ -1,4 +1,4 @@
1
- //#region src/tokenizer/selection-utils.ts
1
+ // src/tokenizer/selection-utils.ts
2
2
  var e = () => {
3
3
  document.getSelection ? (document.getSelection().removeAllRanges(), document.getSelection().addRange(document.createRange())) : window.getSelection ? window.getSelection().removeAllRanges ? (window.getSelection().removeAllRanges(), window.getSelection().addRange(document.createRange())) : window.getSelection().empty && window.getSelection().empty() : document.selection && document.selection.empty();
4
4
  }, t = (e) => {
@@ -14,5 +14,4 @@ var e = () => {
14
14
  }
15
15
  return t;
16
16
  };
17
- //#endregion
18
17
  export { e as clearSelection, t as getCaretCharacterOffsetWithin };
@@ -7,7 +7,7 @@ import { styled as s } from "@mui/material/styles";
7
7
  import { jsx as c } from "react/jsx-runtime";
8
8
  import l from "debug";
9
9
  import { green as u, yellow as d } from "@mui/material/colors";
10
- //#region src/tokenizer/token-text.tsx
10
+ // src/tokenizer/token-text.tsx
11
11
  var f = l("@pie-lib:text-select:token-text"), p = s("span")(() => ({
12
12
  "&.predefined": {
13
13
  cursor: "pointer",
@@ -85,5 +85,4 @@ var f = l("@pie-lib:text-select:token-text"), p = s("span")(() => ({
85
85
  });
86
86
  }
87
87
  };
88
- //#endregion
89
88
  export { m as Text, g as default };
package/dist/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { sanitizeModelHtml as e } from "@pie-element/shared-utils";
2
- //#region src/utils.tsx
2
+ // src/utils.tsx
3
3
  var t = (t = "") => {
4
4
  let n = document.createElement("div");
5
5
  return n.innerHTML = e(t).trim(), n;
@@ -18,5 +18,4 @@ var t = (t = "") => {
18
18
  }
19
19
  return a.length === 0 ? e : (n(r), i(r));
20
20
  };
21
- //#endregion
22
21
  export { n as parseBrs, r as parseParagraph, i as parseParagraphs, a as prepareText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/text-select",
3
- "version": "4.0.8-next.20261109125924",
3
+ "version": "4.0.8-next.20261110063142",
4
4
  "description": "Some react components for text selection",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,14 +13,14 @@
13
13
  "@emotion/styled": "^11.14.1",
14
14
  "@mui/icons-material": "^7.3.4",
15
15
  "@mui/material": "^7.3.4",
16
- "@pie-element/shared-i18n": "0.1.3-next.20261109125924",
17
- "@pie-element/shared-utils": "0.1.7-next.20261027193325",
16
+ "@pie-element/shared-i18n": "0.1.3-next.20261110055344",
17
+ "@pie-element/shared-utils": "0.1.7-next.20261110055344",
18
18
  "@pie-framework/parse-english": "^1.0.0",
19
- "@pie-lib/render-ui": "8.0.8-next.20261109125924",
20
- "@pie-lib/style-utils": "3.0.3-next.20261107131445",
19
+ "@pie-lib/render-ui": "8.0.8-next.20261110063142",
20
+ "@pie-lib/style-utils": "3.0.3-next.20261110055344",
21
21
  "debug": "^4.1.1",
22
22
  "prop-types": "^15.6.2",
23
- "@pie-element/shared-lodash": "0.1.4-next.20261026212738",
23
+ "@pie-element/shared-lodash": "0.1.4-next.20261110055344",
24
24
  "clsx": "^2.1.1"
25
25
  },
26
26
  "type": "module",