@wix/ricos-editor-elements 11.21.2 → 11.22.0

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 (2) hide show
  1. package/dist/lib/Viewer.js +72 -68
  2. package/package.json +5 -7
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
1
2
  import { truncateContent, RicosViewer, pluginEmojiViewer, pluginHashtagViewer, pluginLinkViewer, pluginMentionsViewer, pluginTextColorViewer, pluginTextHighlightViewer, pluginSpoilerViewer } from "@wix/ricos";
2
3
  import { pluginCollapsibleListLazy, pluginDividerLazy, pluginGiphyLazy, pluginImageLazy, pluginGalleryLazy, pluginVideoLazy, pluginAudioLazy, pluginFileUploadLazy, pluginTableLazy, pluginHtmlLazy, pluginLinkPreviewLazy, pluginVerticalEmbedLazy, pluginPollLazy, pluginLinkButtonLazy, pluginTocLazy } from "@wix/ricos/lazy";
3
4
  import { useService } from "@wix/services-manager-react";
@@ -26,7 +27,7 @@ import "@wix/ricos/css/plugin-table-viewer.global.css";
26
27
  import "@wix/ricos/css/plugin-video-viewer.global.css";
27
28
  import "@wix/ricos/css/plugin-audio-viewer.global.css";
28
29
  import "@wix/ricos/css/plugin-toc-viewer.global.css";
29
- import React, { useState } from "react";
30
+ import { useState } from "react";
30
31
  import { CSS_PROPERTIES, DISPLAY_GROUPS, ELEMENTS, DATA, ACTIONS, LAYOUT } from "@wix/react-component-schema";
31
32
  import './Viewer.css';const customPropKey = (tag, cssVar) => `editor-ricos-${tag}-${cssVar}`;
32
33
  const elementClassName = (tag) => `editor-ricos-${tag}`;
@@ -179,20 +180,23 @@ const ContentTrimmer = ({
179
180
  }) => {
180
181
  const [collapsed, setCollapsed] = useState(true);
181
182
  if (!trimEnabled) {
182
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(content));
183
+ return /* @__PURE__ */ jsx(Fragment, { children: children(content) });
183
184
  }
184
185
  const { content: truncated, isTruncated } = trimMode === "word" ? trimByWords(content, trimLengthWord) : trimByBlocks(content, trimLengthParagraph, trimExclude === "plugins");
185
186
  const shownContent = isTruncated && collapsed ? trimTrailingEmptyParagraph(truncated) : content;
186
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(shownContent), isTruncated && trimEllipsisEnabled ? /* @__PURE__ */ React.createElement(
187
- "button",
188
- {
189
- type: "button",
190
- style: { ...defaultEllipsisStyle, ...ellipsisStyle },
191
- onClick: () => setCollapsed((isCollapsed) => !isCollapsed),
192
- "data-hook": "trim-ellipsis-button"
193
- },
194
- collapsed ? trimEllipsisExpandText : trimEllipsisCollapseText
195
- ) : null);
187
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
188
+ children(shownContent),
189
+ isTruncated && trimEllipsisEnabled ? /* @__PURE__ */ jsx(
190
+ "button",
191
+ {
192
+ type: "button",
193
+ style: { ...defaultEllipsisStyle, ...ellipsisStyle },
194
+ onClick: () => setCollapsed((isCollapsed) => !isCollapsed),
195
+ "data-hook": "trim-ellipsis-button",
196
+ children: collapsed ? trimEllipsisExpandText : trimEllipsisCollapseText
197
+ }
198
+ ) : null
199
+ ] });
196
200
  };
197
201
  const DEFAULT_CONTENT_TEXT = "No content provided";
198
202
  const DEFAULT_CONTENT_NODE_ID = "ricos-viewer-default-content";
@@ -583,7 +587,7 @@ const ViewerContent = ({
583
587
  const { language } = useService(LocaleDefinition);
584
588
  const { siteId: metaSiteId } = useService(SiteInfoDefinition);
585
589
  const { siteUrl } = useService(UrlDefinition);
586
- return /* @__PURE__ */ React.createElement("div", { className: `${s.root} ${className}`, id }, /* @__PURE__ */ React.createElement("div", { className: elementClassNames }, /* @__PURE__ */ React.createElement(
590
+ return /* @__PURE__ */ jsx("div", { className: `${s.root} ${className}`, id, children: /* @__PURE__ */ jsx("div", { className: elementClassNames, children: /* @__PURE__ */ jsx(
587
591
  ContentTrimmer,
588
592
  {
589
593
  content,
@@ -594,63 +598,63 @@ const ViewerContent = ({
594
598
  trimExclude,
595
599
  trimEllipsisEnabled,
596
600
  trimEllipsisExpandText,
597
- trimEllipsisCollapseText
598
- },
599
- (trimmedContent) => /* @__PURE__ */ React.createElement(
600
- RicosViewer,
601
- {
602
- firstFoldNodeCount: 8,
603
- responsiveBehavior: "viewport",
604
- isMobile: deviceType === "Smartphone",
605
- locale: language,
606
- biSettings: {
607
- consumer: editorName,
608
- platform: "Livesite",
609
- postId: "",
610
- containerId: ""
611
- },
612
- msid: metaSiteId,
613
- baseUrl: siteUrl,
614
- content: trimmedContent,
615
- theme: {
616
- colorPalette: viewerColorPalette,
617
- customStyles: {
618
- ...viewerCustomStyles,
619
- button: { ...viewerButtonStyle, buttonSize },
620
- image: viewerImageStyle
621
- }
622
- },
623
- plugins: [
624
- pluginCollapsibleListLazy(),
625
- pluginDividerLazy(),
626
- pluginEmojiViewer(),
627
- pluginGiphyLazy(),
628
- pluginHashtagViewer(),
629
- pluginImageLazy(),
630
- pluginGalleryLazy(),
631
- pluginVideoLazy(),
632
- pluginAudioLazy(),
633
- pluginFileUploadLazy({ resolveFileUrl }),
634
- pluginLinkViewer(),
635
- pluginMentionsViewer(),
636
- pluginTableLazy(),
637
- pluginTextColorViewer(),
638
- pluginTextHighlightViewer(),
639
- pluginHtmlLazy(),
640
- pluginLinkPreviewLazy(),
641
- pluginVerticalEmbedLazy(),
642
- pluginSpoilerViewer(),
643
- pluginPollLazy(),
644
- pluginLinkButtonLazy(),
645
- pluginTocLazy()
646
- ]
647
- }
648
- )
649
- )));
601
+ trimEllipsisCollapseText,
602
+ children: (trimmedContent) => /* @__PURE__ */ jsx(
603
+ RicosViewer,
604
+ {
605
+ firstFoldNodeCount: 8,
606
+ responsiveBehavior: "viewport",
607
+ isMobile: deviceType === "Smartphone",
608
+ locale: language,
609
+ biSettings: {
610
+ consumer: editorName,
611
+ platform: "Livesite",
612
+ postId: "",
613
+ containerId: ""
614
+ },
615
+ msid: metaSiteId,
616
+ baseUrl: siteUrl,
617
+ content: trimmedContent,
618
+ theme: {
619
+ colorPalette: viewerColorPalette,
620
+ customStyles: {
621
+ ...viewerCustomStyles,
622
+ button: { ...viewerButtonStyle, buttonSize },
623
+ image: viewerImageStyle
624
+ }
625
+ },
626
+ plugins: [
627
+ pluginCollapsibleListLazy(),
628
+ pluginDividerLazy(),
629
+ pluginEmojiViewer(),
630
+ pluginGiphyLazy(),
631
+ pluginHashtagViewer(),
632
+ pluginImageLazy(),
633
+ pluginGalleryLazy(),
634
+ pluginVideoLazy(),
635
+ pluginAudioLazy(),
636
+ pluginFileUploadLazy({ resolveFileUrl }),
637
+ pluginLinkViewer(),
638
+ pluginMentionsViewer(),
639
+ pluginTableLazy(),
640
+ pluginTextColorViewer(),
641
+ pluginTextHighlightViewer(),
642
+ pluginHtmlLazy(),
643
+ pluginLinkPreviewLazy(),
644
+ pluginVerticalEmbedLazy(),
645
+ pluginSpoilerViewer(),
646
+ pluginPollLazy(),
647
+ pluginLinkButtonLazy(),
648
+ pluginTocLazy()
649
+ ]
650
+ }
651
+ )
652
+ }
653
+ ) }) });
650
654
  };
651
- const Viewer = ({ content, ...props }) => isContentProvided(content) ? /* @__PURE__ */ React.createElement(ViewerContent, { ...props, content }) : (
655
+ const Viewer = ({ content, ...props }) => isContentProvided(content) ? /* @__PURE__ */ jsx(ViewerContent, { ...props, content }) : (
652
656
  // Keep the root so the platform still finds the component node.
653
- /* @__PURE__ */ React.createElement("div", { className: `${s.root} ${props.className}`, id: props.id })
657
+ /* @__PURE__ */ jsx("div", { className: `${s.root} ${props.className}`, id: props.id })
654
658
  );
655
659
  export {
656
660
  ViewerContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ricos-editor-elements",
3
- "version": "11.21.2",
3
+ "version": "11.22.0",
4
4
  "files": [
5
5
  "dist/lib/**"
6
6
  ],
@@ -36,14 +36,14 @@
36
36
  "generate-translation-keys": "babel-cli"
37
37
  },
38
38
  "dependencies": {
39
- "@wix/astro": "^2.75.3",
39
+ "@wix/custom-extensions": "^0.2.28",
40
40
  "@wix/dashboard": "^1.3.48",
41
41
  "@wix/design-system": "^1.338.0",
42
42
  "@wix/editor": "^1.956.0",
43
43
  "@wix/essentials": "^1.0.15",
44
44
  "@wix/fed-cli-i18next": "^1.7.0",
45
45
  "@wix/react-component-schema": "^1.10.0",
46
- "@wix/ricos": "11.21.2",
46
+ "@wix/ricos": "11.22.0",
47
47
  "@wix/services-manager": "^1.0.7",
48
48
  "@wix/services-manager-react": "^1.0.8",
49
49
  "@wix/site-service-device-info": "^1.0.8",
@@ -52,12 +52,9 @@
52
52
  "@wix/site-service-site-info": "^1.0.8",
53
53
  "@wix/site-service-url": "^1.0.9",
54
54
  "@wix/wix-ui-icons-common": "^3.190.8",
55
- "astro": "^5.18.1",
56
55
  "lodash": "^4.17.15"
57
56
  },
58
57
  "devDependencies": {
59
- "@astrojs/cloudflare": "^12.6.13",
60
- "@astrojs/react": "^4.4.2",
61
58
  "@playwright/test": "~1.51.0",
62
59
  "@storybook/react-vite": "^10.4.1",
63
60
  "@testing-library/dom": "^10.4.1",
@@ -68,6 +65,7 @@
68
65
  "@wix/babel-cli": "^1.20.0",
69
66
  "@wix/cli": "^1.1.263",
70
67
  "@wix/fed-cli-oxlint": "^1.0.6",
68
+ "@wix/fed-cli-plugin": "^1.0.1",
71
69
  "@wix/fed-cli-sled": "^1.0.39",
72
70
  "@wix/fed-cli-vitest": "^1.0.17",
73
71
  "@wix/sdk-types": "^1.17.12",
@@ -107,5 +105,5 @@
107
105
  ]
108
106
  }
109
107
  },
110
- "falconPackageHash": "73a13614655772a35d6ba4504e8b482546dd4968a12fcce2e8639291"
108
+ "falconPackageHash": "f7cbb1a371e2cf95ed5d98f90c5b03a83a61066975f1085ba9dd6692"
111
109
  }