@soomo/react-text-annotator 3.1.0-staging.6 → 3.1.0-staging.7

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 (32) hide show
  1. package/dist/react-text-annotator.es10.js +5 -5
  2. package/dist/react-text-annotator.es11.js +9 -82
  3. package/dist/react-text-annotator.es11.js.map +1 -1
  4. package/dist/react-text-annotator.es12.js +1436 -33
  5. package/dist/react-text-annotator.es12.js.map +1 -1
  6. package/dist/react-text-annotator.es14.js +196 -1398
  7. package/dist/react-text-annotator.es14.js.map +1 -1
  8. package/dist/react-text-annotator.es15.js +588 -0
  9. package/dist/react-text-annotator.es15.js.map +1 -0
  10. package/dist/react-text-annotator.es16.js +74 -238
  11. package/dist/react-text-annotator.es16.js.map +1 -1
  12. package/dist/react-text-annotator.es17.js +33 -573
  13. package/dist/react-text-annotator.es17.js.map +1 -1
  14. package/dist/react-text-annotator.es19.js +1 -1
  15. package/dist/react-text-annotator.es20.js +1 -1
  16. package/dist/react-text-annotator.es21.js +2 -114
  17. package/dist/react-text-annotator.es21.js.map +1 -1
  18. package/dist/react-text-annotator.es22.js +2 -309
  19. package/dist/react-text-annotator.es22.js.map +1 -1
  20. package/dist/react-text-annotator.es23.js +109 -53
  21. package/dist/react-text-annotator.es23.js.map +1 -1
  22. package/dist/react-text-annotator.es24.js +306 -17
  23. package/dist/react-text-annotator.es24.js.map +1 -1
  24. package/dist/react-text-annotator.es25.js +58 -2
  25. package/dist/react-text-annotator.es25.js.map +1 -1
  26. package/dist/react-text-annotator.es26.js +20 -2
  27. package/dist/react-text-annotator.es26.js.map +1 -1
  28. package/dist/react-text-annotator.es4.js +2 -2
  29. package/dist/react-text-annotator.es6.js +4 -4
  30. package/package.json +2 -2
  31. package/dist/react-text-annotator.es13.js +0 -12
  32. package/dist/react-text-annotator.es13.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es25.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"react-text-annotator.es25.js","sources":["../../../node_modules/CETEIcean/src/behaviors.js"],"sourcesContent":["\n/* \n Add a user-defined set of behaviors to CETEIcean's processing\n workflow. Added behaviors will override predefined behaviors with the\n same name.\n*/\nexport function addBehaviors(bhvs) {\n if (bhvs.namespaces) {\n for (let prefix of Object.keys(bhvs.namespaces)) {\n if (!this.namespaces.has(bhvs.namespaces[prefix]) && !Array.from(this.namespaces.values()).includes(prefix)) {\n this.namespaces.set(bhvs.namespaces[prefix], prefix);\n }\n }\n }\n for (let prefix of this.namespaces.values()) {\n if (bhvs[prefix]) {\n for (let b of Object.keys(bhvs[prefix])) {\n this.behaviors[`${prefix}:${b}`] = bhvs[prefix][b];\n }\n }\n }\n if (bhvs[\"functions\"]) {\n for (let fn of Object.keys(bhvs[\"functions\"])) {\n this.utilities[fn] = bhvs[\"functions\"][fn].bind(this.utilities);\n }\n }\n if (bhvs[\"handlers\"]) {\n console.log(\"Behavior handlers are no longer used.\")\n }\n if (bhvs[\"fallbacks\"]) {\n console.log(\"Fallback behaviors are no longer used.\")\n }\n}\n\n/* \n Adds or replaces an individual behavior. Takes a namespace prefix or namespace definition,\n the element name, and the behavior. E.g.\n addBehavior(\"tei\", \"add\", [\"`\",\"`\"]) for an already-declared namespace or\n addBehavior({\"doc\": \"http://docbook.org/ns/docbook\"}, \"note\", [\"[\",\"]\"]) for a new one\n*/\nexport function addBehavior(ns, element, b) {\n let p;\n if (ns === Object(ns)) {\n for (let prefix of Object.keys(ns)) {\n if (!this.namespaces.has(ns[prefix])) {\n this.namespaces.set(ns[prefix], prefix);\n p = prefix;\n }\n }\n } else {\n p = ns;\n }\n this.behaviors[`${p}:${element}`] = b;\n}\n\n/*\n Removes a previously-defined or default behavior. Takes a namespace prefix or namespace definition\n and the element name.\n*/\nexport function removeBehavior(ns, element) {\n let p;\n if (ns === Object(ns)) {\n for (let prefix of Object.keys(ns)) {\n if (!this.namespaces.has(ns[prefix])) {\n this.namesp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I;AAAA,MACL;AAAA,IACF;AAAA,EACL,OAAS;AACL,QAAI;AAAA,EACL;AACD,OAAK,UAAU,GAAG,CAAC,IAAI,OAAO,EAAE,IAAI;AACtC;AAMO,SAAS,eAAe,IAAI,SAAS;AAC1C,MAAI;AACJ,MAAI,OAAO,OAAO,EAAE,GAAG;AACrB,aAAS,UAAU,OAAO,KAAK,EAAE,GAAG;AAClC,UAAI,CAAC,KAAK,WAAW,IAAI,GAAG,MAAM,CAAC,GAAG;AACpC,aAAK,WAAW,IAAI,GAAG,MAAM,GAAG,MAAM;AACtC,YAAI;AAAA,MACL;AAAA,IACF;AAAA,EACL,OAAS;AACL,QAAI;AAAA,EACL;AACD,SAAO,KAAK,UAAU,GAAG,CAAC,IAAI,OAAO,EAAE;AACzC;","x_google_ignoreList":[0]}
@@ -1,5 +1,23 @@
1
- var reactJsxRuntime_development = {};
1
+ function learnElementNames(XML_dom, namespaces) {
2
+ const root = XML_dom.documentElement;
3
+ let i = 1;
4
+ let qname = function(e) {
5
+ if (!namespaces.has(e.namespaceURI ? e.namespaceURI : "")) {
6
+ namespaces.set(e.namespaceURI, "ns" + i++);
7
+ }
8
+ return namespaces.get(e.namespaceURI ? e.namespaceURI : "") + ":" + e.localName;
9
+ };
10
+ const els = new Set(
11
+ Array.from(root.querySelectorAll("*"), qname)
12
+ );
13
+ els.add(qname(root));
14
+ return els;
15
+ }
16
+ function learnCustomElementNames(HTML_dom) {
17
+ return new Set(Array.from(HTML_dom.querySelectorAll("*[data-origname]"), (e) => e.localName.replace(/(\w+)-.+/, "$1:") + e.getAttribute("data-origname")));
18
+ }
2
19
  export {
3
- reactJsxRuntime_development as __exports
20
+ learnCustomElementNames,
21
+ learnElementNames
4
22
  };
5
23
  //# sourceMappingURL=react-text-annotator.es26.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es26.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"react-text-annotator.es26.js","sources":["../../../node_modules/CETEIcean/src/dom.js"],"sourcesContent":["export function learnElementNames(XML_dom, namespaces) {\n const root = XML_dom.documentElement;\n let i = 1;\n let qname = function(e) { \n if (!namespaces.has(e.namespaceURI ? e.namespaceURI : \"\")) {\n namespaces.set(e.namespaceURI, \"ns\" + i++);\n } \n return namespaces.get(e.namespaceURI ? e.namespaceURI : \"\") + \":\" + e.localName;\n };\n const els = new Set(\n Array.from(root.querySelectorAll(\"*\"), qname));\n \n // Add the root element to the array\n els.add(qname(root));\n return els\n}\n\nexport function learnCustomElementNames(HTML_dom) {\n return new Set(Array.from(HTML_dom.querySelectorAll(\"*[data-origname]\"), e => e.localName.replace(/(\\w+)-.+/,\"$1:\") + e.getAttribute(\"data-origname\")));\n}"],"names":[],"mappings":"AAAO,SAAS,kBAAkB,SAAS,YAAY;AACrD,QAAM,OAAO,QAAQ;AACrB,MAAI,IAAI;AACR,MAAI,QAAQ,SAAS,GAAG;AACtB,QAAI,CAAC,WAAW,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG;AACzD,iBAAW,IAAI,EAAE,cAAc,OAAO,GAAG;AAAA,IAC1C;AACD,WAAO,WAAW,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,MAAM,EAAE;AAAA,EAC1E;AACE,QAAM,MAAM,IAAI;AAAA,IACd,MAAM,KAAK,KAAK,iBAAiB,GAAG,GAAG,KAAK;AAAA,EAAC;AAG/C,MAAI,IAAI,MAAM,IAAI,CAAC;AACnB,SAAO;AACT;AAEO,SAAS,wBAAwB,UAAU;AAChD,SAAO,IAAI,IAAI,MAAM,KAAK,SAAS,iBAAiB,kBAAkB,GAAG,OAAK,EAAE,UAAU,QAAQ,YAAW,KAAK,IAAI,EAAE,aAAa,eAAe,CAAC,CAAC;AACxJ;","x_google_ignoreList":[0]}
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useLayoutEffect, useMemo, useRef, useEffect } from "react";
2
2
  import { useAnnotationStore, useSelection, Origin } from "@annotorious/react";
3
- import { announce as $319e236875307eab$export$a9b970dcc4ae71a9, destroyAnnouncer as $319e236875307eab$export$d8686216b8b81b2f } from "./react-text-annotator.es11.js";
4
- import { exhaustiveUniqueRandom } from "./react-text-annotator.es12.js";
3
+ import { announce as $319e236875307eab$export$a9b970dcc4ae71a9, destroyAnnouncer as $319e236875307eab$export$d8686216b8b81b2f } from "./react-text-annotator.es16.js";
4
+ import { exhaustiveUniqueRandom } from "./react-text-annotator.es17.js";
5
5
  const useAnnouncePopupNavigation = (args) => {
6
6
  const {
7
7
  message = "Press Tab to move to Notes Dialog",
@@ -1,13 +1,13 @@
1
1
  import { j as jsxRuntimeExports } from "./react-text-annotator.es8.js";
2
2
  import { useState, useEffect, useMemo, useCallback } from "react";
3
- import { isMobile } from "./react-text-annotator.es13.js";
4
- import { useFloating, useRole, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager } from "./react-text-annotator.es14.js";
3
+ import { isMobile } from "./react-text-annotator.es11.js";
4
+ import { useFloating, useRole, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager } from "./react-text-annotator.es12.js";
5
5
  import { useAnnotator, useSelection } from "@annotorious/react";
6
6
  import { isRevived, denormalizeRectWithOffset, toDomRectList } from "@soomo/text-annotator";
7
7
  import { useAnnouncePopupNavigation } from "./react-text-annotator.es4.js";
8
8
  /* empty css */
9
- import { offset, inline, flip, shift } from "./react-text-annotator.es16.js";
10
- import { autoUpdate } from "./react-text-annotator.es17.js";
9
+ import { offset, inline, flip, shift } from "./react-text-annotator.es14.js";
10
+ import { autoUpdate } from "./react-text-annotator.es15.js";
11
11
  const TextAnnotatorPopup = (props) => {
12
12
  var _a;
13
13
  const { popup, ariaNavigationMessage } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soomo/react-text-annotator",
3
- "version": "3.1.0-staging.6",
3
+ "version": "3.1.0-staging.7",
4
4
  "description": "Recogito Text Annotator React bindings",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -48,7 +48,7 @@
48
48
  "@annotorious/react": "^3.0.9",
49
49
  "@floating-ui/react": "^0.26.24",
50
50
  "@react-aria/live-announcer": "^3.3.4",
51
- "@soomo/text-annotator": "3.1.0-staging.6",
51
+ "@soomo/text-annotator": "3.1.0-staging.7",
52
52
  "@recogito/text-annotator-tei": "3.0.0-rc.49",
53
53
  "CETEIcean": "^1.9.3",
54
54
  "unique-random": "^4.0.0"
@@ -1,12 +0,0 @@
1
- const isMobile = () => {
2
- var userAgent = navigator.userAgent || navigator.vendor || window.opera;
3
- if (/android/i.test(userAgent))
4
- return true;
5
- if (/iPad|iPhone/.test(userAgent) && !window.MSStream)
6
- return true;
7
- return false;
8
- };
9
- export {
10
- isMobile
11
- };
12
- //# sourceMappingURL=react-text-annotator.es13.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-text-annotator.es13.js","sources":["../src/TextAnnotatorPopup/isMobile.ts"],"sourcesContent":["// https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system\nexport const isMobile = () => {\n // @ts-ignore\n var userAgent: string = navigator.userAgent || navigator.vendor || window.opera;\n\n if (/android/i.test(userAgent)) \n return true;\n\n // @ts-ignore\n // Note: as of recently, this NO LONGER DETECTS FIREFOX ON iOS!\n // This means FF/iOS will behave like on the desktop, and loose\n // selection handlebars after the popup opens.\n if (/iPad|iPhone/.test(userAgent) && !window.MSStream)\n return true;\n\n return false;\n}"],"names":[],"mappings":"AACO,MAAM,WAAW,MAAM;AAE5B,MAAI,YAAoB,UAAU,aAAa,UAAU,UAAU,OAAO;AAEtE,MAAA,WAAW,KAAK,SAAS;AACpB,WAAA;AAMT,MAAI,cAAc,KAAK,SAAS,KAAK,CAAC,OAAO;AACpC,WAAA;AAEF,SAAA;AACT;"}