@appquality/unguess-design-system 3.1.91-highlight-obs → 3.1.91-load-tests

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.
package/build/index.js CHANGED
@@ -4794,7 +4794,9 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4794
4794
  const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4795
4795
  const isLoaded = !!videoRef;
4796
4796
  const containerRef = React.useRef(null);
4797
- React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
4797
+ React.useImperativeHandle(forwardRef, () => videoRef, [
4798
+ videoRef,
4799
+ ]);
4798
4800
  React.useEffect(() => {
4799
4801
  if (videoRef) {
4800
4802
  videoRef.addEventListener("pause", () => {
@@ -4809,8 +4811,10 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4809
4811
  }
4810
4812
  };
4811
4813
  }, [setIsPlaying, videoRef]);
4812
- return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef, showControls: props.showControls }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, showControls: props.showControls, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n, showControls: props.showControls }) })] })));
4813
- });
4814
+ return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n }) })] })));
4815
+ });
4816
+ const PlayerProvider = (props) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: props.children })));
4817
+ PlayerProvider.Core = PlayerCore;
4814
4818
 
4815
4819
  const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
4816
4820
  if (!isOpen) {
@@ -5688,12 +5692,15 @@ const StyledWord = styled__default["default"].div `
5688
5692
 
5689
5693
  ${({ observations, theme }) => {
5690
5694
  var _a;
5691
- return observations && observations.length > 0 &&
5695
+ return observations &&
5696
+ observations.length > 0 &&
5692
5697
  `
5693
5698
  color: ${(_a = observations[observations.length - 1].color) !== null && _a !== void 0 ? _a : theme.palette.grey[600]};
5694
5699
  box-sizing: border-box;
5695
- font-weight: ${getFocusedObs(observations) ? theme.fontWeights.extrabold : theme.fontWeights.semibold};
5696
- font-style: ${getFocusedObs(observations) ? 'italic' : 'normal'};
5700
+ font-weight: ${getFocusedObs(observations)
5701
+ ? theme.fontWeights.extrabold
5702
+ : theme.fontWeights.semibold};
5703
+ font-style: ${getFocusedObs(observations) ? "italic" : "normal"};
5697
5704
  z-index: 1;
5698
5705
  &:focus {
5699
5706
  outline: none;
@@ -5723,6 +5730,23 @@ const Layer = styled__default["default"].div `
5723
5730
  z-index: 0;
5724
5731
  background-color: ${({ color }) => getColor(color, undefined, undefined, 0.2)};
5725
5732
  `;
5733
+ const textFromSelection = (selection) => {
5734
+ if (!selection || !selection.toString().length)
5735
+ return "";
5736
+ if (selection.anchorNode === null || selection.focusNode === null)
5737
+ return "";
5738
+ var range = selection.getRangeAt(0);
5739
+ var tempDiv = document.createElement("div");
5740
+ tempDiv.appendChild(range.cloneContents());
5741
+ var items = tempDiv.querySelectorAll("div");
5742
+ items.forEach(function (item) {
5743
+ if (item.getAttribute("data-unselectable")) {
5744
+ item.remove();
5745
+ }
5746
+ });
5747
+ var filteredText = tempDiv.textContent || tempDiv.innerText;
5748
+ return filteredText.length ? filteredText.trim() : selection.toString();
5749
+ };
5726
5750
  /**
5727
5751
  * Use Highlight to use highlight interation on any text element
5728
5752
  */
@@ -5734,26 +5758,12 @@ const Highlight = (props) => {
5734
5758
  const [position, setPosition] = React.useState();
5735
5759
  const [selection, setSelection] = React.useState();
5736
5760
  const activeSelection = document.getSelection();
5737
- const extractText = (selection) => {
5738
- if (selection.anchorNode === null || selection.focusNode === null)
5739
- return "";
5740
- var range = selection.getRangeAt(0);
5741
- var tempDiv = document.createElement("div");
5742
- tempDiv.appendChild(range.cloneContents());
5743
- var items = tempDiv.querySelectorAll("div");
5744
- items.forEach(function (item) {
5745
- if (item.getAttribute("data-unselectable")) {
5746
- item.remove();
5747
- }
5748
- });
5749
- var filteredText = tempDiv.textContent || tempDiv.innerText;
5750
- return filteredText.length ? filteredText.trim() : selection.toString();
5751
- };
5761
+ const extractText = React.useMemo(() => textFromSelection(activeSelection), [activeSelection]);
5752
5762
  const handleSelectionChange = React.useCallback(() => {
5753
5763
  var _a, _b, _c, _d, _e, _f, _g, _h;
5754
5764
  if (activeSelection && activeSelection.toString().length > 0) {
5755
5765
  // Extract the text from the selection cleaning unselectable items
5756
- const text = extractText(activeSelection);
5766
+ const text = extractText;
5757
5767
  if (!text)
5758
5768
  return;
5759
5769
  const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
@@ -5768,9 +5778,7 @@ const Highlight = (props) => {
5768
5778
  const range = activeSelection.getRangeAt(0);
5769
5779
  const rects = range.getClientRects();
5770
5780
  const lastRect = rects[rects.length - 1];
5771
- const containerRect = ref && ref.current
5772
- ? ref.current.getBoundingClientRect()
5773
- : null;
5781
+ const containerRect = ref && ref.current ? ref.current.getBoundingClientRect() : null;
5774
5782
  if (!lastRect || !containerRect)
5775
5783
  return;
5776
5784
  const relativeY = lastRect.bottom - containerRect.top + ref.current.scrollTop;
@@ -5798,7 +5806,7 @@ const Highlight = (props) => {
5798
5806
  else {
5799
5807
  setIsSelecting(false);
5800
5808
  }
5801
- }, [onSelectionButtonClick, activeSelection]);
5809
+ }, [activeSelection, extractText, onSelectionButtonClick]);
5802
5810
  React.useEffect(() => {
5803
5811
  if (ref.current === null)
5804
5812
  return;
@@ -5821,10 +5829,11 @@ const Word = (props) => {
5821
5829
  var _a, _b;
5822
5830
  return (_b = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.filter((obs) => props.start >= obs.start && props.end <= obs.end)) !== null && _b !== void 0 ? _b : [];
5823
5831
  }, [props.observations, props.start, props.end]);
5824
- const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 && foundObservations.map((obs) => {
5825
- var _a;
5826
- return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
5827
- }), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
5832
+ const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
5833
+ foundObservations.map((obs) => {
5834
+ var _a;
5835
+ return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
5836
+ }), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
5828
5837
  if (props.tooltipContent !== undefined && foundObservations.length > 0) {
5829
5838
  return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(foundObservations), isTransparent: true }, { children: ObsWord })));
5830
5839
  }
@@ -7254,6 +7263,10 @@ Object.defineProperty(exports, 'ModalClose', {
7254
7263
  enumerable: true,
7255
7264
  get: function () { return reactModals.Close; }
7256
7265
  });
7266
+ Object.defineProperty(exports, 'useVideoContext', {
7267
+ enumerable: true,
7268
+ get: function () { return Video.useVideoContext; }
7269
+ });
7257
7270
  exports.Accordion = Accordion;
7258
7271
  exports.Alert = Alert;
7259
7272
  exports.Anchor = Anchor;
@@ -7351,6 +7364,7 @@ exports.Pagination = Pagination;
7351
7364
  exports.Paragraph = Paragraph;
7352
7365
  exports.PieChart = PieChart;
7353
7366
  exports.Player = Player;
7367
+ exports.PlayerProvider = PlayerProvider;
7354
7368
  exports.PreviousItem = PreviousItem;
7355
7369
  exports.ProductCard = ProductCard;
7356
7370
  exports.ProfileModal = ProfileModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonArgs } from "./_types";
3
2
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
4
3
  export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
@@ -8,18 +8,18 @@ export declare const variants: readonly [{}, {
8
8
  readonly disabled: true;
9
9
  }];
10
10
  export declare const Row: import("styled-components").IStyledComponent<"web", {
11
- alignItems?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
12
- alignItemsXs?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
13
- alignItemsSm?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
14
- alignItemsMd?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
15
- alignItemsLg?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
16
- alignItemsXl?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
17
- justifyContent?: "center" | "start" | "end" | "between" | "around" | undefined;
18
- justifyContentXs?: "center" | "start" | "end" | "between" | "around" | undefined;
19
- justifyContentSm?: "center" | "start" | "end" | "between" | "around" | undefined;
20
- justifyContentMd?: "center" | "start" | "end" | "between" | "around" | undefined;
21
- justifyContentLg?: "center" | "start" | "end" | "between" | "around" | undefined;
22
- justifyContentXl?: "center" | "start" | "end" | "between" | "around" | undefined;
11
+ alignItems?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "start" | "center" | "end" | "between" | "around" | undefined;
18
+ justifyContentXs?: "start" | "center" | "end" | "between" | "around" | undefined;
19
+ justifyContentSm?: "start" | "center" | "end" | "between" | "around" | undefined;
20
+ justifyContentMd?: "start" | "center" | "end" | "between" | "around" | undefined;
21
+ justifyContentLg?: "start" | "center" | "end" | "between" | "around" | undefined;
22
+ justifyContentXl?: "start" | "center" | "end" | "between" | "around" | undefined;
23
23
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
24
24
  wrapXs?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
25
25
  wrapSm?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
@@ -73,7 +73,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
73
73
  results?: number | undefined;
74
74
  security?: string | undefined;
75
75
  unselectable?: "on" | "off" | undefined;
76
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
76
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -299,18 +299,18 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
299
299
  md?: string | number | boolean | undefined;
300
300
  lg?: string | number | boolean | undefined;
301
301
  xl?: string | number | boolean | undefined;
302
- alignSelf?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
- alignSelfXs?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
- alignSelfSm?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
- alignSelfMd?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
- alignSelfLg?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
- alignSelfXl?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
- textAlign?: "center" | "start" | "end" | "justify" | undefined;
309
- textAlignXs?: "center" | "start" | "end" | "justify" | undefined;
310
- textAlignSm?: "center" | "start" | "end" | "justify" | undefined;
311
- textAlignMd?: "center" | "start" | "end" | "justify" | undefined;
312
- textAlignLg?: "center" | "start" | "end" | "justify" | undefined;
313
- textAlignXl?: "center" | "start" | "end" | "justify" | undefined;
302
+ alignSelf?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
+ alignSelfXs?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
+ alignSelfSm?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
+ alignSelfMd?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
+ alignSelfLg?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
+ alignSelfXl?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
+ textAlign?: "start" | "center" | "end" | "justify" | undefined;
309
+ textAlignXs?: "start" | "center" | "end" | "justify" | undefined;
310
+ textAlignSm?: "start" | "center" | "end" | "justify" | undefined;
311
+ textAlignMd?: "start" | "center" | "end" | "justify" | undefined;
312
+ textAlignLg?: "start" | "center" | "end" | "justify" | undefined;
313
+ textAlignXl?: "start" | "center" | "end" | "justify" | undefined;
314
314
  offset?: string | number | undefined;
315
315
  offsetXs?: string | number | undefined;
316
316
  offsetSm?: string | number | undefined;
@@ -370,7 +370,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
370
370
  results?: number | undefined;
371
371
  security?: string | undefined;
372
372
  unselectable?: "on" | "off" | undefined;
373
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
373
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
374
374
  is?: string | undefined;
375
375
  "aria-activedescendant"?: string | undefined;
376
376
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -640,7 +640,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
640
640
  results?: number | undefined;
641
641
  security?: string | undefined;
642
642
  unselectable?: "on" | "off" | undefined;
643
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
643
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
644
644
  is?: string | undefined;
645
645
  "aria-activedescendant"?: string | undefined;
646
646
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PlaceholderOptions } from "@tiptap/extension-placeholder";
3
2
  import { Editor as TipTapEditor } from "@tiptap/react";
4
3
  import { ChatEditorArgs, CommentMedia, SuggestedUser } from "./_types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DropdownArgs, SelectArgs } from "./_types";
3
2
  import { MenuArgs } from "../menu/_types";
4
3
  interface IItem {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditorArgs } from "./_types";
3
2
  interface EditorStoryArgs extends EditorArgs {
4
3
  children?: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { HighlightArgs, WordProps } from "./_types";
3
2
  export interface StoryArgs extends HighlightArgs {
4
3
  words: Array<WordProps & {
@@ -1,4 +1,5 @@
1
- /// <reference types="react" />
1
+ import { useVideoContext } from "@appquality/stream-player";
2
+ import { PropsWithChildren } from "react";
2
3
  import { PlayerArgs } from "./_types";
3
4
  /**
4
5
  * The Player is a styled media tag with custom controls
@@ -7,4 +8,8 @@ import { PlayerArgs } from "./_types";
7
8
  - To display a video
8
9
  */
9
10
  declare const Player: import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
10
- export { Player };
11
+ declare const PlayerProvider: {
12
+ (props: PropsWithChildren<PlayerArgs>): import("react/jsx-runtime").JSX.Element;
13
+ Core: import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
14
+ };
15
+ export { Player, PlayerProvider, useVideoContext };
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { PlayerArgs } from "./_types";
3
2
  interface PlayerStoryArgs extends PlayerArgs {
4
3
  }
5
4
  export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
6
- export declare const ShowControls: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
7
5
  export declare const Streaming: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
8
6
  export declare const WithBookmarks: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
7
+ export declare const WithContext: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
9
8
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
10
9
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.91-highlight-obs",
3
+ "version": "3.1.91-load-tests",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",