@soomo/react-text-annotator 3.0.0-staging.3 → 3.0.0-staging.30

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 (58) hide show
  1. package/dist/TextAnnotator.d.ts +3 -3
  2. package/dist/TextAnnotator.d.ts.map +1 -1
  3. package/dist/TextAnnotatorPlugin.d.ts +1 -2
  4. package/dist/TextAnnotatorPlugin.d.ts.map +1 -1
  5. package/dist/TextAnnotatorPopup.d.ts +6 -5
  6. package/dist/TextAnnotatorPopup.d.ts.map +1 -1
  7. package/dist/index.d.ts +6 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/react-text-annotator.css +1 -1
  10. package/dist/react-text-annotator.es.js +8 -2
  11. package/dist/react-text-annotator.es.js.map +1 -1
  12. package/dist/react-text-annotator.es10.js +234 -33
  13. package/dist/react-text-annotator.es10.js.map +1 -1
  14. package/dist/react-text-annotator.es11.js +566 -888
  15. package/dist/react-text-annotator.es11.js.map +1 -1
  16. package/dist/react-text-annotator.es12.js +487 -2
  17. package/dist/react-text-annotator.es12.js.map +1 -1
  18. package/dist/react-text-annotator.es13.js +2 -2
  19. package/dist/react-text-annotator.es14.js +30 -113
  20. package/dist/react-text-annotator.es14.js.map +1 -1
  21. package/dist/react-text-annotator.es15.js +886 -297
  22. package/dist/react-text-annotator.es15.js.map +1 -1
  23. package/dist/react-text-annotator.es16.js +42 -49
  24. package/dist/react-text-annotator.es16.js.map +1 -1
  25. package/dist/react-text-annotator.es17.js +142 -15
  26. package/dist/react-text-annotator.es17.js.map +1 -1
  27. package/dist/react-text-annotator.es18.js +5 -0
  28. package/dist/react-text-annotator.es18.js.map +1 -0
  29. package/dist/react-text-annotator.es19.js +5 -0
  30. package/dist/react-text-annotator.es19.js.map +1 -0
  31. package/dist/react-text-annotator.es2.js +2 -2
  32. package/dist/react-text-annotator.es20.js +117 -0
  33. package/dist/react-text-annotator.es20.js.map +1 -0
  34. package/dist/react-text-annotator.es21.js +312 -0
  35. package/dist/react-text-annotator.es21.js.map +1 -0
  36. package/dist/react-text-annotator.es22.js +61 -0
  37. package/dist/react-text-annotator.es22.js.map +1 -0
  38. package/dist/react-text-annotator.es23.js +23 -0
  39. package/dist/react-text-annotator.es23.js.map +1 -0
  40. package/dist/react-text-annotator.es24.js +86 -0
  41. package/dist/react-text-annotator.es24.js.map +1 -0
  42. package/dist/react-text-annotator.es25.js +458 -0
  43. package/dist/react-text-annotator.es25.js.map +1 -0
  44. package/dist/react-text-annotator.es3.js +2 -2
  45. package/dist/react-text-annotator.es4.js +7 -14
  46. package/dist/react-text-annotator.es4.js.map +1 -1
  47. package/dist/react-text-annotator.es5.js +54 -38
  48. package/dist/react-text-annotator.es5.js.map +1 -1
  49. package/dist/react-text-annotator.es6.js +178 -9
  50. package/dist/react-text-annotator.es6.js.map +1 -1
  51. package/dist/react-text-annotator.es7.js +12 -1
  52. package/dist/react-text-annotator.es7.js.map +1 -1
  53. package/dist/react-text-annotator.es9.js +669 -2
  54. package/dist/react-text-annotator.es9.js.map +1 -1
  55. package/dist/tei/TEIAnnotator.d.ts +2 -2
  56. package/package.json +21 -15
  57. package/dist/react-text-annotator.es8.js +0 -491
  58. package/dist/react-text-annotator.es8.js.map +0 -1
@@ -1,117 +1,34 @@
1
- const defaultBehaviors = {
2
- "namespaces": {
3
- "tei": "http://www.tei-c.org/ns/1.0",
4
- "teieg": "http://www.tei-c.org/ns/Examples",
5
- "rng": "http://relaxng.org/ns/structure/1.0"
6
- },
7
- "tei": {
8
- "eg": ["<pre>", "</pre>"],
9
- // inserts a link inside <ptr> using the @target; the link in the
10
- // @href is piped through the rw (rewrite) function before insertion
11
- "ptr": ['<a href="$rw@target">$@target</a>'],
12
- // wraps the content of the <ref> in an HTML link with the @target in
13
- // the @href. If there are multiple @targets, only the first is used.
14
- "ref": [
15
- ["[target]", ['<a href="$rw@target">', "</a>"]]
16
- ],
17
- // creates an img tag with the @url as the src attribute
18
- "graphic": function(elt) {
19
- let content = new Image();
20
- content.src = this.rw(elt.getAttribute("url"));
21
- if (elt.hasAttribute("width")) {
22
- content.setAttribute("width", elt.getAttribute("width"));
23
- }
24
- if (elt.hasAttribute("height")) {
25
- content.setAttribute("height", elt.getAttribute("height"));
26
- }
27
- return content;
28
- },
29
- "list": [
30
- // will only run on a list where @type="gloss"
31
- [
32
- "[type=gloss]",
33
- function(elt) {
34
- const doc = elt.ownerDocument;
35
- let dl = doc.createElement("dl");
36
- for (let child of Array.from(elt.children)) {
37
- if (child.nodeType == 1) {
38
- if (child.localName == "tei-label") {
39
- let dt = doc.createElement("dt");
40
- dt.innerHTML = child.innerHTML;
41
- dl.appendChild(dt);
42
- }
43
- if (child.localName == "tei-item") {
44
- let dd = doc.createElement("dd");
45
- dd.innerHTML = child.innerHTML;
46
- dl.appendChild(dd);
47
- }
48
- }
49
- }
50
- return dl;
51
- }
52
- ]
53
- ],
54
- "note": [
55
- // Make endnotes
56
- ["[place=end]", function(elt) {
57
- const doc = elt.ownerDocument;
58
- if (!this.noteIndex) {
59
- this["noteIndex"] = 1;
60
- } else {
61
- this.noteIndex++;
62
- }
63
- let id = "_note_" + this.noteIndex;
64
- let link = doc.createElement("a");
65
- link.setAttribute("id", "src" + id);
66
- link.setAttribute("href", "#" + id);
67
- link.innerHTML = this.noteIndex;
68
- let content = doc.createElement("sup");
69
- content.appendChild(link);
70
- let notes = doc.querySelector("ol.notes");
71
- if (!notes) {
72
- notes = doc.createElement("ol");
73
- notes.setAttribute("class", "notes");
74
- this.dom.appendChild(notes);
75
- }
76
- let note = doc.createElement("li");
77
- note.id = id;
78
- note.innerHTML = elt.innerHTML;
79
- notes.appendChild(note);
80
- return content;
81
- }],
82
- ["_", ["(", ")"]]
83
- ],
84
- // Hide the teiHeader by default
85
- "teiHeader": function(e) {
86
- this.hideContent(e, false);
87
- },
88
- // Make the title element the HTML title
89
- "title": [
90
- ["tei-titlestmt>tei-title", function(elt) {
91
- const doc = elt.ownerDocument;
92
- let title = doc.createElement("title");
93
- title.innerHTML = elt.innerText;
94
- doc.querySelector("head").appendChild(title);
95
- }]
96
- ]
97
- },
98
- "teieg": {
99
- "egXML": function(elt) {
100
- const doc = elt.ownerDocument;
101
- let pre = doc.createElement("pre");
102
- let code = doc.createElement("code");
103
- pre.appendChild(code);
104
- let content = this.serialize(elt, true).replace(/</g, "&lt;");
105
- let ws = content.match(/^[\t ]+/);
106
- if (ws) {
107
- content = content.replace(new RegExp("^" + ws[0], "mg"), "");
108
- }
109
- code.innerHTML = content;
110
- return pre;
111
- }
1
+ import { __exports as reactJsxRuntime_production_min } from "./react-text-annotator.es18.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 };
112
25
  }
113
- };
26
+ reactJsxRuntime_production_min.Fragment = l;
27
+ reactJsxRuntime_production_min.jsx = q;
28
+ reactJsxRuntime_production_min.jsxs = q;
29
+ return reactJsxRuntime_production_min;
30
+ }
114
31
  export {
115
- defaultBehaviors as default
32
+ requireReactJsxRuntime_production_min as __require
116
33
  };
117
34
  //# sourceMappingURL=react-text-annotator.es14.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es14.js","sources":["../../../node_modules/CETEIcean/src/defaultBehaviors.js"],"sourcesContent":["export default {\n \"namespaces\": {\n \"tei\": \"http://www.tei-c.org/ns/1.0\",\n \"teieg\": \"http://www.tei-c.org/ns/Examples\",\n \"rng\": \"http://relaxng.org/ns/structure/1.0\" \n },\n \"tei\": {\n \"eg\": [\"<pre>\",\"</pre>\"],\n // inserts a link inside <ptr> using the @target; the link in the\n // @href is piped through the rw (rewrite) function before insertion\n \"ptr\": [\"<a href=\\\"$rw@target\\\">$@target</a>\"],\n // wraps the content of the <ref> in an HTML link with the @target in \n // the @href. If there are multiple @targets, only the first is used.\n \"ref\": [\n [\"[target]\", [\"<a href=\\\"$rw@target\\\">\",\"</a>\"]]\n ],\n // creates an img tag with the @url as the src attribute\n \"graphic\": function(elt) {\n let content = new Image();\n content.src = this.rw(elt.getAttribute(\"url\"));\n if (elt.hasAttribute(\"width\")) {\n content.setAttribute(\"width\",elt.getAttribute(\"width\"));\n }\n if (elt.hasAttribute(\"height\")) {\n content.setAttribute(\"height\",elt.getAttribute(\"height\"));\n }\n return content;\n },\n \"list\": [\n // will only run on a list where @type=\"gloss\"\n [\"[type=gloss]\", function(elt) {\n const doc = elt.ownerDocument;\n let dl = doc.createElement(\"dl\");\n for (let child of Array.from(elt.children)) {\n // nodeType 1 is Node.ELEMENT_NODE\n if (child.nodeType == 1) {\n if (child.localName == \"tei-label\") {\n let dt = doc.createElement(\"dt\");\n dt.innerHTML = child.innerHTML;\n dl.appendChild(dt);\n }\n if (child.localName == \"tei-item\") {\n let dd = doc.createElement(\"dd\");\n dd.innerHTML = child.innerHTML;\n dl.appendChild(dd);\n }\n }\n }\n return dl;\n }\n ]],\n \"note\": [\n // Make endnotes\n [\"[place=end]\", function(elt){\n const doc = elt.ownerDocument;\n if (!this.noteIndex){\n this[\"noteIndex\"] = 1;\n } else {\n this.noteIndex++;\n }\n let id = \"_note_\" + this.noteIndex;\n let link = doc.createElement(\"a\");\n link.setAttribute(\"id\", \"src\" + id);\n link.setAttribute(\"href\", \"#\" + id);\n link.innerHTML = this.noteIndex;\n let content = doc.createElement(\"sup\");\n content.appendChild(link);\n let notes = doc.querySelector(\"ol.notes\");\n if (!notes) {\n notes = doc.createElement(\"ol\");\n notes.setAttribute(\"class\", \"notes\");\n this.dom.appendChild(notes);\n }\n let note = doc.createElement(\"li\");\n note.id = id;\n note.innerHTML = elt.innerHTML;\n notes.appendChild(note);\n return content;\n }],\n [\"_\", [\"(\",\")\"]]\n ],\n // Hide the teiHeader by default\n \"teiHeader\": function(e) {\n this.hideContent(e, false);\n },\n // Make the title element the HTML title\n \"title\": [\n [\"tei-titlestmt>tei-title\", function(elt) {\n const doc = elt.ownerDocument;\n let title = doc.createElement(\"title\");\n title.innerHTML = elt.innerText;\n doc.querySelector(\"head\").appendChild(title);\n }]\n ],\n },\n \"teieg\": {\n \"egXML\": function(elt) {\n const doc = elt.ownerDocument;\n let pre = doc.createElement(\"pre\");\n let code = doc.createElement(\"code\");\n pre.appendChild(code);\n let content = this.serialize(elt, true).replace(/</g, \"&lt;\");\n let ws = content.match(/^[\\t ]+/);\n if (ws) {\n content = content.replace(new RegExp(\"^\" + ws[0], \"mg\"), \"\");\n }\n code.innerHTML = content;\n return pre;\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAe,mBAAA;AAAA,EACb,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,EACR;AAAA,EACD,OAAO;AAAA,IACL,MAAM,CAAC,SAAQ,QAAQ;AAAA;AAAA;AAAA,IAGvB,OAAO,CAAC,mCAAqC;AAAA;AAAA;AAAA,IAG7C,OAAO;AAA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oreList":[0]}
1
+ {"version":3,"file":"react-text-annotator.es14.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]}