@soomo/react-text-annotator 3.0.0-staging.37 → 3.0.0-staging.39

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 (74) hide show
  1. package/dist/{TextAnnotatorPopup.d.ts → TextAnnotatorPopup/TextAnnotatorPopup.d.ts} +3 -2
  2. package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts.map +1 -0
  3. package/dist/TextAnnotatorPopup/index.d.ts +2 -0
  4. package/dist/TextAnnotatorPopup/index.d.ts.map +1 -0
  5. package/dist/hooks/index.d.ts +3 -0
  6. package/dist/hooks/index.d.ts.map +1 -0
  7. package/dist/hooks/useAnnouncePopupNavigation.d.ts +8 -0
  8. package/dist/hooks/useAnnouncePopupNavigation.d.ts.map +1 -0
  9. package/dist/hooks/useRestoreSelectionCaret.d.ts +13 -0
  10. package/dist/hooks/useRestoreSelectionCaret.d.ts.map +1 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/react-text-annotator.css +31 -1
  14. package/dist/react-text-annotator.es.js +8 -4
  15. package/dist/react-text-annotator.es.js.map +1 -1
  16. package/dist/react-text-annotator.es11.js +445 -527
  17. package/dist/react-text-annotator.es11.js.map +1 -1
  18. package/dist/react-text-annotator.es12.js +60 -483
  19. package/dist/react-text-annotator.es12.js.map +1 -1
  20. package/dist/react-text-annotator.es13.js +45 -2
  21. package/dist/react-text-annotator.es13.js.map +1 -1
  22. package/dist/react-text-annotator.es14.js +1450 -30
  23. package/dist/react-text-annotator.es14.js.map +1 -1
  24. package/dist/react-text-annotator.es16.js +227 -37
  25. package/dist/react-text-annotator.es16.js.map +1 -1
  26. package/dist/react-text-annotator.es17.js +537 -115
  27. package/dist/react-text-annotator.es17.js.map +1 -1
  28. package/dist/react-text-annotator.es18.js +2 -2
  29. package/dist/react-text-annotator.es19.js +31 -2
  30. package/dist/react-text-annotator.es19.js.map +1 -1
  31. package/dist/react-text-annotator.es2.js +2 -2
  32. package/dist/react-text-annotator.es20.js +893 -109
  33. package/dist/react-text-annotator.es20.js.map +1 -1
  34. package/dist/react-text-annotator.es21.js +2 -309
  35. package/dist/react-text-annotator.es21.js.map +1 -1
  36. package/dist/react-text-annotator.es22.js +2 -58
  37. package/dist/react-text-annotator.es22.js.map +1 -1
  38. package/dist/react-text-annotator.es23.js +113 -19
  39. package/dist/react-text-annotator.es23.js.map +1 -1
  40. package/dist/react-text-annotator.es24.js +290 -130
  41. package/dist/react-text-annotator.es24.js.map +1 -1
  42. package/dist/react-text-annotator.es25.js +43 -545
  43. package/dist/react-text-annotator.es25.js.map +1 -1
  44. package/dist/react-text-annotator.es26.js +23 -0
  45. package/dist/react-text-annotator.es26.js.map +1 -0
  46. package/dist/react-text-annotator.es27.js +130 -0
  47. package/dist/react-text-annotator.es27.js.map +1 -0
  48. package/dist/react-text-annotator.es28.js +155 -0
  49. package/dist/react-text-annotator.es28.js.map +1 -0
  50. package/dist/react-text-annotator.es29.js +314 -0
  51. package/dist/react-text-annotator.es29.js.map +1 -0
  52. package/dist/react-text-annotator.es3.js +2 -2
  53. package/dist/react-text-annotator.es30.js +152 -0
  54. package/dist/react-text-annotator.es30.js.map +1 -0
  55. package/dist/react-text-annotator.es31.js +563 -0
  56. package/dist/react-text-annotator.es31.js.map +1 -0
  57. package/dist/react-text-annotator.es4.js +30 -23
  58. package/dist/react-text-annotator.es4.js.map +1 -1
  59. package/dist/react-text-annotator.es5.js +36 -78
  60. package/dist/react-text-annotator.es5.js.map +1 -1
  61. package/dist/react-text-annotator.es6.js +24 -178
  62. package/dist/react-text-annotator.es6.js.map +1 -1
  63. package/dist/react-text-annotator.es7.js +126 -10
  64. package/dist/react-text-annotator.es7.js.map +1 -1
  65. package/dist/react-text-annotator.es8.js +182 -0
  66. package/dist/react-text-annotator.es8.js.map +1 -0
  67. package/dist/react-text-annotator.es9.js +10 -670
  68. package/dist/react-text-annotator.es9.js.map +1 -1
  69. package/package.json +5 -3
  70. package/dist/TextAnnotatorPopup.d.ts.map +0 -1
  71. package/dist/react-text-annotator.es10.js +0 -244
  72. package/dist/react-text-annotator.es10.js.map +0 -1
  73. package/dist/react-text-annotator.es15.js +0 -901
  74. package/dist/react-text-annotator.es15.js.map +0 -1
@@ -1,7 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { TextAnnotation } from '@soomo/text-annotator';
3
3
 
4
4
  interface TextAnnotationPopupProps {
5
+ popupNavigationMessage?: string;
5
6
  popup(props: TextAnnotatorPopupProps): ReactNode;
6
7
  }
7
8
  export interface TextAnnotatorPopupProps {
@@ -10,6 +11,6 @@ export interface TextAnnotatorPopupProps {
10
11
  editable?: boolean;
11
12
  }[];
12
13
  }
13
- export declare const TextAnnotatorPopup: (props: TextAnnotationPopupProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const TextAnnotatorPopup: FC<TextAnnotationPopupProps>;
14
15
  export {};
15
16
  //# sourceMappingURL=TextAnnotatorPopup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnnotatorPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/TextAnnotatorPopup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAgB,SAAS,EAAoC,MAAM,OAAO,CAAC;AAgB7F,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,0BAA0B,CAAC;AAElC,UAAU,wBAAwB;IAEhC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,KAAK,CAAC,KAAK,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAElD;AAED,MAAM,WAAW,uBAAuB;IAEtC,QAAQ,EAAE;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAEhE;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,CAiJ3D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './TextAnnotatorPopup';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './useRestoreSelectionCaret';
2
+ export * from './useAnnouncePopupNavigation';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface AnnouncePopupOpeningArgs {
2
+ message?: string;
3
+ floatingOpen: boolean;
4
+ disabled?: boolean;
5
+ }
6
+ export declare const useAnnouncePopupNavigation: (args: AnnouncePopupOpeningArgs) => void;
7
+ export {};
8
+ //# sourceMappingURL=useAnnouncePopupNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnnouncePopupNavigation.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnouncePopupNavigation.ts"],"names":[],"mappings":"AAOA,UAAU,wBAAwB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,0BAA0B,SAAU,wBAAwB,SA0DxE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Restores the caret position after the floating element gets closed
3
+ * and the selection is lost and moved to the `body`.
4
+ * The caret is placed at the start of the previous selection range.
5
+ *
6
+ * However, when the floating element is dismissed with intentional
7
+ * caret repositioning via the mouse click or arrow key navigation ->
8
+ * we shouldn't restore its position to the previous selection.
9
+ */
10
+ export declare const useRestoreSelectionCaret: (args: {
11
+ floatingOpen: boolean;
12
+ }) => void;
13
+ //# sourceMappingURL=useRestoreSelectionCaret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRestoreSelectionCaret.d.ts","sourceRoot":"","sources":["../../src/hooks/useRestoreSelectionCaret.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,SAAU;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,SAsCvE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './tei';
2
+ export * from './hooks';
2
3
  export * from './TextAnnotator';
3
4
  export * from './TextAnnotatorPopup';
4
5
  export * from './TextAnnotatorPlugin';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,KAAK,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,IAAI,EACJ,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACN,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,aAAa,IAAI,qBAAqB,EACtC,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,KAAK,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,IAAI,EACJ,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACN,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,aAAa,IAAI,qBAAqB,EACtC,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC"}
@@ -1 +1,31 @@
1
- .r6o-canvas-highlight-layer{position:fixed;top:0;bottom:0;left:0;width:100vw;height:100vh;pointer-events:none}.r6o-canvas-highlight-layer.bg{mix-blend-mode:multiply;z-index:1}.r6o-annotatable .r6o-span-highlight-layer{height:100%;left:0;mix-blend-mode:multiply;pointer-events:none;position:absolute;top:0;width:100%}.r6o-annotatable .r6o-span-highlight-layer.hidden{display:none}.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation{border-style:solid;border-width:0;box-sizing:content-box;display:block;position:absolute}.r6o-annotation{box-sizing:content-box}.r6o-presence-layer{left:0;position:fixed;top:0;bottom:0;width:100vw;pointer-events:none}html,body{overscroll-behavior-y:none}.r6o-annotatable{position:relative;-webkit-tap-highlight-color:transparent}.r6o-annotatable.no-focus-outline{outline:none}.hovered *{cursor:pointer}*::selection,::selection{background:#0080ff2e}::-moz-selection{background:#0080ff2e}
1
+ .r6o-canvas-highlight-layer{position:fixed;top:0;bottom:0;left:0;width:100vw;height:100vh;pointer-events:none}.r6o-canvas-highlight-layer.bg{mix-blend-mode:multiply;z-index:1}.r6o-annotatable .r6o-span-highlight-layer{position:absolute;top:0;left:0;width:100%;height:100%;mix-blend-mode:multiply;pointer-events:none;z-index:1}.r6o-annotatable .r6o-span-highlight-layer.hidden{display:none}.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation{border-style:solid;border-width:0;box-sizing:content-box;display:block;position:absolute}.r6o-annotation{box-sizing:content-box}.r6o-presence-layer{left:0;position:fixed;top:0;bottom:0;width:100vw;pointer-events:none}html,body{overscroll-behavior-y:none}.r6o-annotatable{position:relative;-webkit-tap-highlight-color:transparent}.r6o-annotatable.no-focus-outline{outline:none}.hovered *{cursor:pointer}*::selection,::selection{background:#0080ff2e}::-moz-selection{background:#0080ff2e}
2
+ /*
3
+ * Close message should be visible only to the keyboard
4
+ * or the screen reader users as the popup behavior hint
5
+ * Inspired by https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
6
+ */
7
+ .popup-close-message {
8
+ border: 0 !important;
9
+ clip: rect(1px, 1px, 1px, 1px);
10
+ -webkit-clip-path: inset(50%);
11
+ clip-path: inset(50%);
12
+ height: 1px;
13
+ margin: -1px;
14
+ overflow: hidden;
15
+ padding: 0;
16
+ position: absolute;
17
+ width: 1px;
18
+ white-space: nowrap;
19
+ }
20
+
21
+ .popup-close-message:focus,
22
+ .popup-close-message:active {
23
+ clip: auto;
24
+ -webkit-clip-path: none;
25
+ clip-path: none;
26
+ height: auto;
27
+ margin: auto;
28
+ overflow: visible;
29
+ width: auto;
30
+ white-space: normal;
31
+ }
@@ -1,10 +1,12 @@
1
1
  import { CETEIcean } from "./react-text-annotator.es2.js";
2
2
  import { TEIAnnotator } from "./react-text-annotator.es3.js";
3
- import { TextAnnotator } from "./react-text-annotator.es4.js";
4
- import { TextAnnotatorPopup } from "./react-text-annotator.es5.js";
3
+ import { useRestoreSelectionCaret } from "./react-text-annotator.es4.js";
4
+ import { useAnnouncePopupNavigation } from "./react-text-annotator.es5.js";
5
+ import { TextAnnotator } from "./react-text-annotator.es6.js";
6
+ import { TextAnnotatorPopup } from "./react-text-annotator.es7.js";
5
7
  import { Origin, UserSelectAction, createBody } from "@annotorious/core";
6
8
  import { AnnotoriousPlugin } from "@annotorious/react";
7
- import { W3CTextFormat } from "./react-text-annotator.es6.js";
9
+ import { W3CTextFormat } from "./react-text-annotator.es8.js";
8
10
  export {
9
11
  AnnotoriousPlugin,
10
12
  CETEIcean,
@@ -14,6 +16,8 @@ export {
14
16
  TextAnnotatorPopup,
15
17
  UserSelectAction,
16
18
  W3CTextFormat,
17
- createBody
19
+ createBody,
20
+ useAnnouncePopupNavigation,
21
+ useRestoreSelectionCaret
18
22
  };
19
23
  //# sourceMappingURL=react-text-annotator.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"react-text-annotator.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}