@soomo/react-text-annotator 3.1.0-staging.14 → 3.1.0-staging.16

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 (82) hide show
  1. package/dist/TextAnnotationPopup/TextAnnotationPopup.d.ts +21 -0
  2. package/dist/TextAnnotationPopup/TextAnnotationPopup.d.ts.map +1 -0
  3. package/dist/TextAnnotationPopup/index.d.ts +2 -0
  4. package/dist/TextAnnotationPopup/index.d.ts.map +1 -0
  5. package/dist/TextAnnotationPopup/isMobile.d.ts.map +1 -0
  6. package/dist/hooks/index.d.ts +2 -1
  7. package/dist/hooks/index.d.ts.map +1 -1
  8. package/dist/hooks/useAnnotationTargetIdling.d.ts +4 -0
  9. package/dist/hooks/useAnnotationTargetIdling.d.ts.map +1 -0
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/react-text-annotator.es.js +6 -4
  13. package/dist/react-text-annotator.es.js.map +1 -1
  14. package/dist/react-text-annotator.es11.js +483 -78
  15. package/dist/react-text-annotator.es11.js.map +1 -1
  16. package/dist/react-text-annotator.es12.js +77 -40
  17. package/dist/react-text-annotator.es12.js.map +1 -1
  18. package/dist/react-text-annotator.es13.js +33 -1471
  19. package/dist/react-text-annotator.es13.js.map +1 -1
  20. package/dist/react-text-annotator.es14.js +1596 -8
  21. package/dist/react-text-annotator.es14.js.map +1 -1
  22. package/dist/react-text-annotator.es15.js +12 -0
  23. package/dist/react-text-annotator.es15.js.map +1 -0
  24. package/dist/react-text-annotator.es17.js +245 -548
  25. package/dist/react-text-annotator.es17.js.map +1 -1
  26. package/dist/react-text-annotator.es18.js +587 -2
  27. package/dist/react-text-annotator.es18.js.map +1 -1
  28. package/dist/react-text-annotator.es19.js +2 -31
  29. package/dist/react-text-annotator.es19.js.map +1 -1
  30. package/dist/react-text-annotator.es2.js +2 -2
  31. package/dist/react-text-annotator.es2.js.map +1 -1
  32. package/dist/react-text-annotator.es20.js +20 -887
  33. package/dist/react-text-annotator.es20.js.map +1 -1
  34. package/dist/react-text-annotator.es21.js +893 -109
  35. package/dist/react-text-annotator.es21.js.map +1 -1
  36. package/dist/react-text-annotator.es22.js +2 -309
  37. package/dist/react-text-annotator.es22.js.map +1 -1
  38. package/dist/react-text-annotator.es23.js +2 -58
  39. package/dist/react-text-annotator.es23.js.map +1 -1
  40. package/dist/react-text-annotator.es24.js +113 -19
  41. package/dist/react-text-annotator.es24.js.map +1 -1
  42. package/dist/react-text-annotator.es25.js +309 -2
  43. package/dist/react-text-annotator.es25.js.map +1 -1
  44. package/dist/react-text-annotator.es26.js +58 -2
  45. package/dist/react-text-annotator.es26.js.map +1 -1
  46. package/dist/react-text-annotator.es27.js +17 -124
  47. package/dist/react-text-annotator.es27.js.map +1 -1
  48. package/dist/react-text-annotator.es28.js +107 -144
  49. package/dist/react-text-annotator.es28.js.map +1 -1
  50. package/dist/react-text-annotator.es29.js +156 -303
  51. package/dist/react-text-annotator.es29.js.map +1 -1
  52. package/dist/react-text-annotator.es3.js +2 -2
  53. package/dist/react-text-annotator.es3.js.map +1 -1
  54. package/dist/react-text-annotator.es30.js +308 -146
  55. package/dist/react-text-annotator.es30.js.map +1 -1
  56. package/dist/react-text-annotator.es31.js +130 -544
  57. package/dist/react-text-annotator.es31.js.map +1 -1
  58. package/dist/react-text-annotator.es32.js +629 -0
  59. package/dist/react-text-annotator.es32.js.map +1 -0
  60. package/dist/react-text-annotator.es4.js +2 -2
  61. package/dist/react-text-annotator.es4.js.map +1 -1
  62. package/dist/react-text-annotator.es5.js +28 -24
  63. package/dist/react-text-annotator.es5.js.map +1 -1
  64. package/dist/react-text-annotator.es6.js +23 -123
  65. package/dist/react-text-annotator.es6.js.map +1 -1
  66. package/dist/react-text-annotator.es7.js +138 -539
  67. package/dist/react-text-annotator.es7.js.map +1 -1
  68. package/dist/react-text-annotator.es8.js +559 -10
  69. package/dist/react-text-annotator.es8.js.map +1 -1
  70. package/dist/react-text-annotator.es9.js +13 -0
  71. package/dist/react-text-annotator.es9.js.map +1 -0
  72. package/package.json +7 -7
  73. package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts +0 -25
  74. package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts.map +0 -1
  75. package/dist/TextAnnotatorPopup/index.d.ts +0 -2
  76. package/dist/TextAnnotatorPopup/index.d.ts.map +0 -1
  77. package/dist/TextAnnotatorPopup/isMobile.d.ts.map +0 -1
  78. package/dist/react-text-annotator.es10.js +0 -490
  79. package/dist/react-text-annotator.es10.js.map +0 -1
  80. package/dist/react-text-annotator.es16.js +0 -249
  81. package/dist/react-text-annotator.es16.js.map +0 -1
  82. /package/dist/{TextAnnotatorPopup → TextAnnotationPopup}/isMobile.d.ts +0 -0
@@ -1,34 +1,5 @@
1
- import { __exports as reactJsxRuntime_production_min } from "./react-text-annotator.es25.js";
2
- import React__default from "react";
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var hasRequiredReactJsxRuntime_production_min;
13
- function requireReactJsxRuntime_production_min() {
14
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
15
- hasRequiredReactJsxRuntime_production_min = 1;
16
- var f = React__default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
17
- function q(c, a, g) {
18
- var b, d = {}, e = null, h = null;
19
- void 0 !== g && (e = "" + g);
20
- void 0 !== a.key && (e = "" + a.key);
21
- void 0 !== a.ref && (h = a.ref);
22
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
23
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
24
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
25
- }
26
- reactJsxRuntime_production_min.Fragment = l;
27
- reactJsxRuntime_production_min.jsx = q;
28
- reactJsxRuntime_production_min.jsxs = q;
29
- return reactJsxRuntime_production_min;
30
- }
1
+ var jsxRuntime = { exports: {} };
31
2
  export {
32
- requireReactJsxRuntime_production_min as __require
3
+ jsxRuntime as __module
33
4
  };
34
5
  //# sourceMappingURL=react-text-annotator.es19.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es19.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.min.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;;AASa,MAAI,IAAEA,gBAAiB,IAAE,OAAO,IAAI,eAAe,GAAE,IAAE,OAAO,IAAI,gBAAgB,GAAE,IAAE,OAAO,UAAU,gBAAe,IAAE,EAAE,mDAAmD,mBAAkB,IAAE,EAAC,KAAI,MAAG,KAAI,MAAG,QAAO,MAAG,UAAS,KAAE;AAClP,WAAS,EAAE,GAAE,GAAE,GAAE;AAAC,QAAI,GAAE,IAAE,IAAG,IAAE,MAAK,IAAE;AAAK,eAAS,MAAI,IAAE,KAAG;AAAG,eAAS,EAAE,QAAM,IAAE,KAAG,EAAE;AAAK,eAAS,EAAE,QAAM,IAAE,EAAE;AAAK,SAAI,KAAK,EAAE,GAAE,KAAK,GAAE,CAAC,KAAG,CAAC,EAAE,eAAe,CAAC,MAAI,EAAE,CAAC,IAAE,EAAE,CAAC;AAAG,QAAG,KAAG,EAAE,aAAa,MAAI,KAAK,IAAE,EAAE,cAAa,EAAE,YAAS,EAAE,CAAC,MAAI,EAAE,CAAC,IAAE,EAAE,CAAC;AAAG,WAAM,EAAC,UAAS,GAAE,MAAK,GAAE,KAAI,GAAE,KAAI,GAAE,OAAM,GAAE,QAAO,EAAE,QAAO;AAAA,EAAC;AAAC,4CAAiB;AAAE,iCAAW,MAAC;AAAE,iCAAA,OAAa;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"react-text-annotator.es19.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,6 +1,6 @@
1
- import { j as jsxRuntimeExports } from "./react-text-annotator.es8.js";
1
+ import { j as jsxRuntimeExports } from "./react-text-annotator.es9.js";
2
2
  import { useRef, useEffect } from "react";
3
- import CETEI from "./react-text-annotator.es10.js";
3
+ import CETEI from "./react-text-annotator.es11.js";
4
4
  const PRESET_BEHAVIORS = {
5
5
  tei: {
6
6
  ref: (elem) => {
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es2.js","sources":["../src/tei/CETEIcean.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport CETEI from 'CETEIcean';\n\ninterface CETEIceanProps {\n\n tei?: string;\n\n onLoad?(element: Element): void;\n\n behaviors?: any;\n\n}\n\n// Override default list, note, table, and ref behaviors \n// so they don't introduce text into the DOM that interferes\n// with annotation. Apply a patch to graphics for robustness.\nconst PRESET_BEHAVIORS = {\n tei: {\n ref: (elem: Element) => {\n const a = document.createElement('a');\n\n while(elem.firstChild) {\n a.appendChild(elem.removeChild(elem.firstChild));\n }\n\n a.setAttribute('href', elem.getAttribute('target'));\n\n elem.appendChild(a);\n },\n // Cf. https://github.com/TEIC/CETEIcean/issues/67\n graphic: (elem: Element) => {\n const content = new Image();\n content.src = elem.getAttribute('url')?.trim();\n\n if (elem.hasAttribute('width'))\n content.setAttribute('width', elem.getAttribute('width'));\n\n if (elem.hasAttribute('height'))\n content.setAttribute('height', elem.getAttribute('height'));\n\n elem.appendChild(content);\n },\n list: null,\n note: null,\n table: null,\n teiHeader: (elem: HTMLElement) => {\n elem.hidden = true;\n }\n }\n}\n\nexport const CETEIcean = (props: CETEIceanProps) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (props.tei) {\n const ceteicean = new CETEI();\n\n ceteicean.addBehaviors({\n ...PRESET_BEHAVIORS,\n ...(props.behaviors || {}),\n tei: {\n ...PRESET_BEHAVIORS.tei,\n ...(props.behaviors?.tei || {})\n }\n });\n\n ceteicean.makeHTML5(props.tei, (data: Element) => {\n el.current.appendChild(data);\n props.onLoad(el.current);\n });\n }\n }, [props.tei]);\n\n return (\n <div \n ref={el}\n className=\"tei-container\" />\n )\n\n}"],"names":["jsx"],"mappings":";;;AAgBA,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,IACH,KAAK,CAAC,SAAkB;AAChB,YAAA,IAAI,SAAS,cAAc,GAAG;AAEpC,aAAM,KAAK,YAAY;AACrB,UAAE,YAAY,KAAK,YAAY,KAAK,UAAU,CAAC;AAAA,MACjD;AAEA,QAAE,aAAa,QAAQ,KAAK,aAAa,QAAQ,CAAC;AAElD,WAAK,YAAY,CAAC;AAAA,IACpB;AAAA;AAAA,IAEA,SAAS,CAAC,SAAkB;;AACpB,YAAA,UAAU,IAAI;AACpB,cAAQ,OAAM,UAAK,aAAa,KAAK,MAAvB,mBAA0B;AAEpC,UAAA,KAAK,aAAa,OAAO;AAC3B,gBAAQ,aAAa,SAAS,KAAK,aAAa,OAAO,CAAC;AAEtD,UAAA,KAAK,aAAa,QAAQ;AAC5B,gBAAQ,aAAa,UAAU,KAAK,aAAa,QAAQ,CAAC;AAE5D,WAAK,YAAY,OAAO;AAAA,IAC1B;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW,CAAC,SAAsB;AAChC,WAAK,SAAS;AAAA,IAChB;AAAA,EACF;AACF;AAEa,MAAA,YAAY,CAAC,UAA0B;AAE5C,QAAA,KAAK,OAAuB,IAAI;AAEtC,YAAU,MAAM;;AACd,QAAI,MAAM,KAAK;AACP,YAAA,YAAY,IAAI;AAEtB,gBAAU,aAAa;AAAA,QACrB,GAAG;AAAA,QACH,GAAI,MAAM,aAAa,CAAC;AAAA,QACxB,KAAK;AAAA,UACH,GAAG,iBAAiB;AAAA,UACpB,KAAI,WAAM,cAAN,mBAAiB,QAAO,CAAC;AAAA,QAC/B;AAAA,MAAA,CACD;AAED,gBAAU,UAAU,MAAM,KAAK,CAAC,SAAkB;AAC7C,WAAA,QAAQ,YAAY,IAAI;AACrB,cAAA,OAAO,GAAG,OAAO;AAAA,MAAA,CACxB;AAAA,IACH;AAAA,EAAA,GACC,CAAC,MAAM,GAAG,CAAC;AAGZ,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,WAAU;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
1
+ {"version":3,"file":"react-text-annotator.es2.js","sources":["../src/tei/CETEIcean.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport CETEI from 'CETEIcean';\n\ninterface CETEIceanProps {\n\n tei?: string;\n\n onLoad?(element: Element): void;\n\n behaviors?: any;\n\n}\n\n// Override default list, note, table, and ref behaviors \n// so they don't introduce text into the DOM that interferes\n// with annotation. Apply a patch to graphics for robustness.\nconst PRESET_BEHAVIORS = {\n tei: {\n ref: (elem: Element) => {\n const a = document.createElement('a');\n\n while(elem.firstChild) {\n a.appendChild(elem.removeChild(elem.firstChild));\n }\n\n a.setAttribute('href', elem.getAttribute('target'));\n\n elem.appendChild(a);\n },\n // Cf. https://github.com/TEIC/CETEIcean/issues/67\n graphic: (elem: Element) => {\n const content = new Image();\n content.src = elem.getAttribute('url')?.trim();\n\n if (elem.hasAttribute('width'))\n content.setAttribute('width', elem.getAttribute('width'));\n\n if (elem.hasAttribute('height'))\n content.setAttribute('height', elem.getAttribute('height'));\n\n elem.appendChild(content);\n },\n list: null,\n note: null,\n table: null,\n teiHeader: (elem: HTMLElement) => {\n elem.hidden = true;\n }\n }\n}\n\nexport const CETEIcean = (props: CETEIceanProps) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (props.tei) {\n const ceteicean = new CETEI();\n\n ceteicean.addBehaviors({\n ...PRESET_BEHAVIORS,\n ...(props.behaviors || {}),\n tei: {\n ...PRESET_BEHAVIORS.tei,\n ...(props.behaviors?.tei || {})\n }\n });\n\n ceteicean.makeHTML5(props.tei, (data: Element) => {\n el.current.appendChild(data);\n props.onLoad(el.current);\n });\n }\n }, [props.tei]);\n\n return (\n <div \n ref={el}\n className=\"tei-container\" />\n )\n\n}"],"names":["jsx"],"mappings":";;;AAgBA,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,IACH,KAAK,CAAC,SAAkB;AAChB,YAAA,IAAI,SAAS,cAAc,GAAG;AAEpC,aAAM,KAAK,YAAY;AACrB,UAAE,YAAY,KAAK,YAAY,KAAK,UAAU,CAAC;AAAA,MAAA;AAGjD,QAAE,aAAa,QAAQ,KAAK,aAAa,QAAQ,CAAC;AAElD,WAAK,YAAY,CAAC;AAAA,IACpB;AAAA;AAAA,IAEA,SAAS,CAAC,SAAkB;;AACpB,YAAA,UAAU,IAAI,MAAM;AAC1B,cAAQ,OAAM,UAAK,aAAa,KAAK,MAAvB,mBAA0B;AAEpC,UAAA,KAAK,aAAa,OAAO;AAC3B,gBAAQ,aAAa,SAAS,KAAK,aAAa,OAAO,CAAC;AAEtD,UAAA,KAAK,aAAa,QAAQ;AAC5B,gBAAQ,aAAa,UAAU,KAAK,aAAa,QAAQ,CAAC;AAE5D,WAAK,YAAY,OAAO;AAAA,IAC1B;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW,CAAC,SAAsB;AAChC,WAAK,SAAS;AAAA,IAAA;AAAA,EAChB;AAEJ;AAEa,MAAA,YAAY,CAAC,UAA0B;AAE5C,QAAA,KAAK,OAAuB,IAAI;AAEtC,YAAU,MAAM;;AACd,QAAI,MAAM,KAAK;AACP,YAAA,YAAY,IAAI,MAAM;AAE5B,gBAAU,aAAa;AAAA,QACrB,GAAG;AAAA,QACH,GAAI,MAAM,aAAa,CAAC;AAAA,QACxB,KAAK;AAAA,UACH,GAAG,iBAAiB;AAAA,UACpB,KAAI,WAAM,cAAN,mBAAiB,QAAO,CAAA;AAAA,QAAC;AAAA,MAC/B,CACD;AAED,gBAAU,UAAU,MAAM,KAAK,CAAC,SAAkB;AAC7C,WAAA,QAAQ,YAAY,IAAI;AACrB,cAAA,OAAO,GAAG,OAAO;AAAA,MAAA,CACxB;AAAA,IAAA;AAAA,EACH,GACC,CAAC,MAAM,GAAG,CAAC;AAGZ,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,WAAU;AAAA,IAAA;AAAA,EAAgB;AAGhC;"}