@soomo/react-text-annotator 3.1.0-staging.24 → 3.1.0-staging.25

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 (64) hide show
  1. package/dist/react-text-annotator.css +31 -1
  2. package/dist/react-text-annotator.es.js +21 -245
  3. package/dist/react-text-annotator.es.js.map +1 -1
  4. package/dist/react-text-annotator.es10.js +490 -0
  5. package/dist/react-text-annotator.es10.js.map +1 -0
  6. package/dist/react-text-annotator.es11.js +85 -0
  7. package/dist/react-text-annotator.es11.js.map +1 -0
  8. package/dist/react-text-annotator.es12.js +48 -0
  9. package/dist/react-text-annotator.es12.js.map +1 -0
  10. package/dist/react-text-annotator.es13.js +28 -0
  11. package/dist/react-text-annotator.es13.js.map +1 -0
  12. package/dist/react-text-annotator.es14.js +1638 -0
  13. package/dist/react-text-annotator.es14.js.map +1 -0
  14. package/dist/react-text-annotator.es15.js +12 -0
  15. package/dist/react-text-annotator.es15.js.map +1 -0
  16. package/dist/react-text-annotator.es17.js +285 -0
  17. package/dist/react-text-annotator.es17.js.map +1 -0
  18. package/dist/react-text-annotator.es18.js +600 -0
  19. package/dist/react-text-annotator.es18.js.map +1 -0
  20. package/dist/react-text-annotator.es19.js +18 -0
  21. package/dist/react-text-annotator.es19.js.map +1 -0
  22. package/dist/react-text-annotator.es2.js +67 -0
  23. package/dist/react-text-annotator.es2.js.map +1 -0
  24. package/dist/react-text-annotator.es20.js +5 -0
  25. package/dist/react-text-annotator.es20.js.map +1 -0
  26. package/dist/react-text-annotator.es21.js +34 -0
  27. package/dist/react-text-annotator.es21.js.map +1 -0
  28. package/dist/react-text-annotator.es22.js +901 -0
  29. package/dist/react-text-annotator.es22.js.map +1 -0
  30. package/dist/react-text-annotator.es23.js +5 -0
  31. package/dist/react-text-annotator.es23.js.map +1 -0
  32. package/dist/react-text-annotator.es24.js +5 -0
  33. package/dist/react-text-annotator.es24.js.map +1 -0
  34. package/dist/react-text-annotator.es25.js +117 -0
  35. package/dist/react-text-annotator.es25.js.map +1 -0
  36. package/dist/react-text-annotator.es26.js +312 -0
  37. package/dist/react-text-annotator.es26.js.map +1 -0
  38. package/dist/react-text-annotator.es27.js +61 -0
  39. package/dist/react-text-annotator.es27.js.map +1 -0
  40. package/dist/react-text-annotator.es28.js +23 -0
  41. package/dist/react-text-annotator.es28.js.map +1 -0
  42. package/dist/react-text-annotator.es29.js +130 -0
  43. package/dist/react-text-annotator.es29.js.map +1 -0
  44. package/dist/react-text-annotator.es3.js +29 -0
  45. package/dist/react-text-annotator.es3.js.map +1 -0
  46. package/dist/react-text-annotator.es30.js +167 -0
  47. package/dist/react-text-annotator.es30.js.map +1 -0
  48. package/dist/react-text-annotator.es31.js +314 -0
  49. package/dist/react-text-annotator.es31.js.map +1 -0
  50. package/dist/react-text-annotator.es32.js +152 -0
  51. package/dist/react-text-annotator.es32.js.map +1 -0
  52. package/dist/react-text-annotator.es33.js +629 -0
  53. package/dist/react-text-annotator.es33.js.map +1 -0
  54. package/dist/react-text-annotator.es4.js +43 -0
  55. package/dist/react-text-annotator.es4.js.map +1 -0
  56. package/dist/react-text-annotator.es5.js +48 -0
  57. package/dist/react-text-annotator.es5.js.map +1 -0
  58. package/dist/react-text-annotator.es6.js +29 -0
  59. package/dist/react-text-annotator.es6.js.map +1 -0
  60. package/dist/react-text-annotator.es7.js +154 -0
  61. package/dist/react-text-annotator.es7.js.map +1 -0
  62. package/dist/react-text-annotator.es8.js +6 -0
  63. package/dist/react-text-annotator.es8.js.map +1 -0
  64. package/package.json +6 -7
@@ -0,0 +1,18 @@
1
+ import { __module as jsxRuntime } from "./react-text-annotator.es20.js";
2
+ import { __require as requireReactJsxRuntime_production_min } from "./react-text-annotator.es21.js";
3
+ import { __require as requireReactJsxRuntime_development } from "./react-text-annotator.es22.js";
4
+ var hasRequiredJsxRuntime;
5
+ function requireJsxRuntime() {
6
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
7
+ hasRequiredJsxRuntime = 1;
8
+ if (process.env.NODE_ENV === "production") {
9
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
10
+ } else {
11
+ jsxRuntime.exports = requireReactJsxRuntime_development();
12
+ }
13
+ return jsxRuntime.exports;
14
+ }
15
+ export {
16
+ requireJsxRuntime as __require
17
+ };
18
+ //# sourceMappingURL=react-text-annotator.es19.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-text-annotator.es19.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;;;;;AAEA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzCA,eAAA,UAAiBC,sCAAoD;AAAA,EACvE,OAAO;AACLD,eAAA,UAAiBE,mCAAiD;AAAA,EACpE;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,67 @@
1
+ import { j as jsxRuntimeExports } from "./react-text-annotator.es8.js";
2
+ import { useRef, useEffect } from "react";
3
+ import CETEI from "./react-text-annotator.es10.js";
4
+ const PRESET_BEHAVIORS = {
5
+ tei: {
6
+ ref: (elem) => {
7
+ const a = document.createElement("a");
8
+ while (elem.firstChild) {
9
+ a.appendChild(elem.removeChild(elem.firstChild));
10
+ }
11
+ a.setAttribute("href", elem.getAttribute("target"));
12
+ elem.appendChild(a);
13
+ },
14
+ // Cf. https://github.com/TEIC/CETEIcean/issues/67
15
+ graphic: (elem) => {
16
+ var _a;
17
+ const content = new Image();
18
+ content.src = (_a = elem.getAttribute("url")) == null ? void 0 : _a.trim();
19
+ if (elem.hasAttribute("width"))
20
+ content.setAttribute("width", elem.getAttribute("width"));
21
+ if (elem.hasAttribute("height"))
22
+ content.setAttribute("height", elem.getAttribute("height"));
23
+ elem.appendChild(content);
24
+ },
25
+ list: null,
26
+ note: null,
27
+ table: null,
28
+ teiHeader: (elem) => {
29
+ elem.hidden = true;
30
+ }
31
+ }
32
+ };
33
+ const CETEIcean = (props) => {
34
+ const el = useRef(null);
35
+ useEffect(() => {
36
+ var _a;
37
+ if (props.tei) {
38
+ const ceteicean = new CETEI(props.initArgs);
39
+ ceteicean.addBehaviors({
40
+ ...PRESET_BEHAVIORS,
41
+ ...props.behaviors || {},
42
+ tei: {
43
+ ...PRESET_BEHAVIORS.tei,
44
+ ...((_a = props.behaviors) == null ? void 0 : _a.tei) || {}
45
+ }
46
+ });
47
+ ceteicean.makeHTML5(props.tei, (data) => {
48
+ el.current.appendChild(data);
49
+ props.onLoad(el.current);
50
+ });
51
+ }
52
+ return () => {
53
+ el.current.innerHTML = "";
54
+ };
55
+ }, [props.tei, JSON.stringify(props.initArgs), props.onLoad]);
56
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
57
+ "div",
58
+ {
59
+ ref: el,
60
+ className: "tei-container"
61
+ }
62
+ );
63
+ };
64
+ export {
65
+ CETEIcean
66
+ };
67
+ //# sourceMappingURL=react-text-annotator.es2.js.map
@@ -0,0 +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 initArgs?: any;\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(props.initArgs);\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\n return () => {\n el.current.innerHTML = '';\n }\n }, [props.tei, JSON.stringify(props.initArgs), props.onLoad]);\n\n return (\n <div \n ref={el}\n className=\"tei-container\" />\n )\n\n}"],"names":["jsx"],"mappings":";;;AAkBA,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;AACb,YAAM,YAAY,IAAI,MAAM,MAAM,QAAQ;AAE1C,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;AAGH,WAAO,MAAM;AACX,SAAG,QAAQ,YAAY;AAAA,IACzB;AAAA,EAAA,GACC,CAAC,MAAM,KAAK,KAAK,UAAU,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC;AAG1D,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,WAAU;AAAA,IAAA;AAAA,EAAgB;AAGhC;"}
@@ -0,0 +1,5 @@
1
+ var jsxRuntime = { exports: {} };
2
+ export {
3
+ jsxRuntime as __module
4
+ };
5
+ //# sourceMappingURL=react-text-annotator.es20.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-text-annotator.es20.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,34 @@
1
+ import { __exports as reactJsxRuntime_production_min } from "./react-text-annotator.es23.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
+ }
31
+ export {
32
+ requireReactJsxRuntime_production_min as __require
33
+ };
34
+ //# sourceMappingURL=react-text-annotator.es21.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-text-annotator.es21.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]}