@frontify/guideline-blocks-settings 0.28.1 → 0.28.3
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/CHANGELOG.md +17 -0
- package/dist/components/Attachments/AttachmentItem.es.js +78 -78
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +86 -86
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +68 -68
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +34 -34
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar.es.js +33 -33
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +12 -12
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +22 -22
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +8 -8
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +19 -19
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +11 -11
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +3 -3
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +40 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +4 -4
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +20 -20
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +18 -18
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +16 -16
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +19 -19
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +34 -34
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +28 -28
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +36 -36
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js +5 -5
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/helpers/hasRichTextValue.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/hooks/useDndSensors.es.js.map +1 -1
- package/dist/index.cjs.js +13 -246
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +13 -246
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +1 -1
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +1 -1
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +1 -1
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js +1 -1
- package/dist/settings/margin.es.js +1 -1
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +1 -1
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +1 -1
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +1 -1
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +1 -1
- package/dist/styles.css +1 -0
- package/dist/styles.css.es.js +5 -0
- package/dist/styles.css.es.js.map +1 -0
- package/dist/utilities/moveItemInArray.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/package.json +26 -24
- package/src/components/Attachments/AttachmentItem.tsx +2 -2
- package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
- package/src/components/Attachments/Attachments.tsx +2 -2
- package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
- package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
- package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
- package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +3 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +2 -2
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +2 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/styles.ts +1 -1
- package/src/components/RichTextEditor/serializer/nodes/button.ts +2 -1
- package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +3 -2
- package/src/components/RichTextEditor/serializer/nodes/default.ts +5 -4
- package/src/components/RichTextEditor/serializer/nodes/link.ts +4 -3
- package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +5 -5
- package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
- package/src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts +1 -1
- package/src/hooks/useAttachments.ts +1 -1
- package/src/hooks/useDndSensors.ts +1 -1
- package/src/index.ts +3 -3
- package/src/settings/background.spec.ts +1 -1
- package/src/settings/border.spec.ts +1 -1
- package/src/settings/borderRadiusExtended.spec.ts +4 -4
- package/src/settings/marginExtended.spec.ts +4 -4
- package/src/settings/paddingExtended.spec.ts +4 -4
- package/src/styles.css +3 -0
- package/src/utilities/react/getBackgroundColorStyles.ts +2 -3
- package/src/utilities/react/getBorderStyles.ts +3 -4
- package/src/utilities/react/getRadiusStyles.ts +1 -1
- package/vite.config.ts +25 -3
- package/dist/_virtual/_commonjsHelpers.es.js +0 -7
- package/dist/_virtual/_commonjsHelpers.es.js.map +0 -1
- package/dist/_virtual/index.es.js +0 -5
- package/dist/_virtual/index.es.js.map +0 -1
- package/dist/_virtual/index.es2.js +0 -5
- package/dist/_virtual/index.es2.js.map +0 -1
- package/dist/_virtual/index.es3.js +0 -5
- package/dist/_virtual/index.es3.js.map +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -5
- package/dist/_virtual/jsx-runtime.es.js.map +0 -1
- package/dist/_virtual/react-dom.development.es.js +0 -5
- package/dist/_virtual/react-dom.development.es.js.map +0 -1
- package/dist/_virtual/react-dom.production.min.es.js +0 -5
- package/dist/_virtual/react-dom.production.min.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +0 -1
- package/dist/_virtual/react.development.es.js +0 -5
- package/dist/_virtual/react.development.es.js.map +0 -1
- package/dist/_virtual/react.production.min.es.js +0 -5
- package/dist/_virtual/react.production.min.es.js.map +0 -1
- package/dist/_virtual/scheduler.development.es.js +0 -5
- package/dist/_virtual/scheduler.development.es.js.map +0 -1
- package/dist/_virtual/scheduler.production.min.es.js +0 -5
- package/dist/_virtual/scheduler.production.min.es.js.map +0 -1
- package/dist/style.css +0 -1
|
@@ -16,7 +16,7 @@ describe('Block Item Wrapper', () => {
|
|
|
16
16
|
mount(
|
|
17
17
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]}>
|
|
18
18
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
19
|
-
</BlockItemWrapper
|
|
19
|
+
</BlockItemWrapper>,
|
|
20
20
|
);
|
|
21
21
|
cy.get(BlockItemWrapperSelector).should('exist');
|
|
22
22
|
cy.get(ChildSelector).should('exist');
|
|
@@ -26,7 +26,7 @@ describe('Block Item Wrapper', () => {
|
|
|
26
26
|
mount(
|
|
27
27
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]}>
|
|
28
28
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
29
|
-
</BlockItemWrapper
|
|
29
|
+
</BlockItemWrapper>,
|
|
30
30
|
);
|
|
31
31
|
cy.get(BlockItemWrapperSelector).should('have.class', 'hover:tw-outline');
|
|
32
32
|
});
|
|
@@ -35,7 +35,7 @@ describe('Block Item Wrapper', () => {
|
|
|
35
35
|
mount(
|
|
36
36
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]} shouldHideWrapper>
|
|
37
37
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
38
|
-
</BlockItemWrapper
|
|
38
|
+
</BlockItemWrapper>,
|
|
39
39
|
);
|
|
40
40
|
cy.get(BlockItemWrapperSelector).should('not.exist');
|
|
41
41
|
});
|
|
@@ -50,7 +50,7 @@ describe('Block Item Wrapper', () => {
|
|
|
50
50
|
]}
|
|
51
51
|
>
|
|
52
52
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
53
|
-
</BlockItemWrapper
|
|
53
|
+
</BlockItemWrapper>,
|
|
54
54
|
);
|
|
55
55
|
cy.get(ToolbarButtonSelector).should('have.length', 2);
|
|
56
56
|
});
|
|
@@ -85,7 +85,7 @@ describe('Block Item Wrapper', () => {
|
|
|
85
85
|
]}
|
|
86
86
|
>
|
|
87
87
|
<div data-test-id="block-item-wrapper-child" className="tw-mt-8 tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
88
|
-
</BlockItemWrapper
|
|
88
|
+
</BlockItemWrapper>,
|
|
89
89
|
);
|
|
90
90
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
91
91
|
cy.get(FlyoutSelector).should('exist');
|
|
@@ -103,7 +103,7 @@ describe('Block Item Wrapper', () => {
|
|
|
103
103
|
]}
|
|
104
104
|
>
|
|
105
105
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
106
|
-
</BlockItemWrapper
|
|
106
|
+
</BlockItemWrapper>,
|
|
107
107
|
);
|
|
108
108
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
109
109
|
cy.get(BlockItemWrapperSelector).should('have.css', 'outline-style', 'solid');
|
|
@@ -120,7 +120,7 @@ describe('Block Item Wrapper', () => {
|
|
|
120
120
|
]}
|
|
121
121
|
>
|
|
122
122
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
123
|
-
</BlockItemWrapper
|
|
123
|
+
</BlockItemWrapper>,
|
|
124
124
|
);
|
|
125
125
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
126
126
|
cy.get(ToolbarSelector).should('be.visible');
|
|
@@ -137,7 +137,7 @@ describe('Block Item Wrapper', () => {
|
|
|
137
137
|
shouldBeShown
|
|
138
138
|
>
|
|
139
139
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
140
|
-
</BlockItemWrapper
|
|
140
|
+
</BlockItemWrapper>,
|
|
141
141
|
);
|
|
142
142
|
cy.get(ChildSelector).should('exist');
|
|
143
143
|
cy.get(BlockItemWrapperSelector).should('have.css', 'outline-style', 'solid');
|
|
@@ -62,7 +62,7 @@ describe('RichTextEditor', () => {
|
|
|
62
62
|
isEditing={true}
|
|
63
63
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
64
64
|
value={convertToRteValue('p', 'This is a link')}
|
|
65
|
-
|
|
65
|
+
/>,
|
|
66
66
|
);
|
|
67
67
|
cy.get(RichTextSelector).click();
|
|
68
68
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -83,7 +83,7 @@ describe('RichTextEditor', () => {
|
|
|
83
83
|
isEditing={true}
|
|
84
84
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
85
85
|
value={convertToRteValue('p', 'This is a link')}
|
|
86
|
-
|
|
86
|
+
/>,
|
|
87
87
|
);
|
|
88
88
|
cy.get(RichTextSelector).click();
|
|
89
89
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -102,7 +102,7 @@ describe('RichTextEditor', () => {
|
|
|
102
102
|
isEditing={true}
|
|
103
103
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
104
104
|
value={convertToRteValue('p', 'This is a link')}
|
|
105
|
-
|
|
105
|
+
/>,
|
|
106
106
|
);
|
|
107
107
|
|
|
108
108
|
cy.get(RichTextSelector).click();
|
|
@@ -122,7 +122,7 @@ describe('RichTextEditor', () => {
|
|
|
122
122
|
isEditing={true}
|
|
123
123
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
124
124
|
value={convertToRteValue('p', 'This is a link')}
|
|
125
|
-
|
|
125
|
+
/>,
|
|
126
126
|
);
|
|
127
127
|
cy.get(RichTextSelector).click();
|
|
128
128
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -140,7 +140,7 @@ describe('RichTextEditor', () => {
|
|
|
140
140
|
<RichTextEditor
|
|
141
141
|
isEditing={true}
|
|
142
142
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
143
|
-
|
|
143
|
+
/>,
|
|
144
144
|
);
|
|
145
145
|
cy.get(RichTextSelector).click();
|
|
146
146
|
cy.get(RichTextSelector).type('mailto:info@frontify.com {enter}');
|
|
@@ -155,7 +155,7 @@ describe('RichTextEditor', () => {
|
|
|
155
155
|
<RichTextEditor
|
|
156
156
|
isEditing={true}
|
|
157
157
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
158
|
-
|
|
158
|
+
/>,
|
|
159
159
|
);
|
|
160
160
|
cy.get(RichTextSelector).click();
|
|
161
161
|
cy.get(RichTextSelector).type('list:{enter}');
|
|
@@ -171,7 +171,7 @@ describe('RichTextEditor', () => {
|
|
|
171
171
|
isEditing={true}
|
|
172
172
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
173
173
|
value={convertToRteValue('p', 'This is a link')}
|
|
174
|
-
|
|
174
|
+
/>,
|
|
175
175
|
);
|
|
176
176
|
cy.get(RichTextSelector).click();
|
|
177
177
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -190,7 +190,7 @@ describe('RichTextEditor', () => {
|
|
|
190
190
|
isEditing={true}
|
|
191
191
|
plugins={new PluginComposer().setPlugin([new ButtonPlugin({ appBridge })])}
|
|
192
192
|
value={convertToRteValue('p', 'This is a button')}
|
|
193
|
-
|
|
193
|
+
/>,
|
|
194
194
|
);
|
|
195
195
|
cy.get(RichTextSelector).click();
|
|
196
196
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -27,7 +27,7 @@ export const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {
|
|
|
27
27
|
new SoftBreakPlugin(),
|
|
28
28
|
new TextStylePlugin({
|
|
29
29
|
textStyles: TextStylePluginsWithoutImage,
|
|
30
|
-
})
|
|
30
|
+
}),
|
|
31
31
|
)
|
|
32
32
|
.setPlugin(
|
|
33
33
|
[
|
|
@@ -48,6 +48,6 @@ export const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {
|
|
|
48
48
|
new CheckboxListPlugin(),
|
|
49
49
|
new OrderedListPlugin(),
|
|
50
50
|
new ResetFormattingPlugin(),
|
|
51
|
-
]
|
|
51
|
+
],
|
|
52
52
|
);
|
|
53
53
|
};
|
package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export const ButtonToolbarButton = ({ type, ...props }: LinkToolbarButtonProps)
|
|
|
32
32
|
tooltip={getTooltip(
|
|
33
33
|
isEnabled
|
|
34
34
|
? `Button\n${getHotkeyByPlatform('Ctrl+Shift+K')}`
|
|
35
|
-
: 'Buttons can only be set for a single text block.'
|
|
35
|
+
: 'Buttons can only be set for a single text block.',
|
|
36
36
|
)}
|
|
37
37
|
classNames={getButtonClassNames(isEnabled)}
|
|
38
38
|
active={isLink}
|
|
@@ -25,6 +25,6 @@ export const useFloatingButtonUrlInput = (props: HTMLPropsAs<'input'>): HTMLProp
|
|
|
25
25
|
onChange,
|
|
26
26
|
defaultValue: floatingButtonSelectors.url(),
|
|
27
27
|
},
|
|
28
|
-
{ ...props, ref: useComposedRef<HTMLInputElement>(props.ref, ref) }
|
|
28
|
+
{ ...props, ref: useComposedRef<HTMLInputElement>(props.ref, ref) },
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
4
4
|
import { Plugin, PluginProps } from '@frontify/fondue';
|
|
5
5
|
import { RangeBeforeOptions, createPluginFactory } from '@udecode/plate';
|
|
6
|
-
import { CSSProperties } from 'react';
|
|
6
|
+
import type { CSSProperties } from 'react';
|
|
7
7
|
import { isValidUrl } from '../LinkPlugin/utils/url';
|
|
8
8
|
import { ButtonMarkupElement } from './ButtonMarkupElement';
|
|
9
9
|
import { ButtonButton } from './components/ButtonButton';
|
|
@@ -14,6 +14,7 @@ import { withButton } from './withButton';
|
|
|
14
14
|
export const ELEMENT_BUTTON = 'button';
|
|
15
15
|
export const BUTTON_PLUGIN = 'button-plugin';
|
|
16
16
|
|
|
17
|
+
// eslint-disable-next-line
|
|
17
18
|
export interface ButtonPlugin {
|
|
18
19
|
forceSubmit?: boolean;
|
|
19
20
|
|
|
@@ -97,6 +98,7 @@ export type ButtonPluginProps = Omit<PluginProps, 'styles'> & {
|
|
|
97
98
|
styles?: Record<string, CSSProperties & { hover?: CSSProperties }>;
|
|
98
99
|
} & { appBridge: AppBridgeBlock };
|
|
99
100
|
|
|
101
|
+
// eslint-disable-next-line
|
|
100
102
|
export class ButtonPlugin extends Plugin {
|
|
101
103
|
public styles: CSSProperties = {};
|
|
102
104
|
private appBridge: AppBridgeBlock;
|
|
@@ -7,11 +7,11 @@ import { CreateButtonNodeOptions, createButtonNode } from '../utils/index';
|
|
|
7
7
|
export const insertButton = <V extends Value>(
|
|
8
8
|
editor: PlateEditor<V>,
|
|
9
9
|
createButtonNodeOptions: CreateButtonNodeOptions,
|
|
10
|
-
options?: InsertNodesOptions<V
|
|
10
|
+
options?: InsertNodesOptions<V>,
|
|
11
11
|
) => {
|
|
12
12
|
insertNodes<TButtonElement | TText>(
|
|
13
13
|
editor,
|
|
14
14
|
[createButtonNode(editor, createButtonNodeOptions)],
|
|
15
|
-
options as InsertNodesOptions
|
|
15
|
+
options as InsertNodesOptions,
|
|
16
16
|
);
|
|
17
17
|
};
|
|
@@ -55,7 +55,7 @@ export const upsertButton = <V extends Value>(
|
|
|
55
55
|
insertTextInButton,
|
|
56
56
|
insertNodesOptions,
|
|
57
57
|
isUrl = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON).isUrl,
|
|
58
|
-
}: UpsertButtonOptions<V
|
|
58
|
+
}: UpsertButtonOptions<V>,
|
|
59
59
|
) => {
|
|
60
60
|
const at = editor.selection;
|
|
61
61
|
if (!at) {
|
|
@@ -136,7 +136,7 @@ export const upsertButton = <V extends Value>(
|
|
|
136
136
|
},
|
|
137
137
|
],
|
|
138
138
|
},
|
|
139
|
-
insertNodesOptions
|
|
139
|
+
insertNodesOptions,
|
|
140
140
|
);
|
|
141
141
|
return true;
|
|
142
142
|
};
|
|
@@ -151,7 +151,7 @@ function anchorAndFocusInButton<V extends Value>(
|
|
|
151
151
|
url: string,
|
|
152
152
|
buttonStyle?: RichTextButtonStyle,
|
|
153
153
|
target?: string,
|
|
154
|
-
text?: string
|
|
154
|
+
text?: string,
|
|
155
155
|
) {
|
|
156
156
|
if (buttonAbove) {
|
|
157
157
|
unwrapButton(editor, {
|
|
@@ -178,7 +178,7 @@ function editButtonUrlAndTarget<V extends Value>(
|
|
|
178
178
|
buttonAbove: TNodeEntry<TButtonElement>,
|
|
179
179
|
target?: string,
|
|
180
180
|
buttonStyle?: string,
|
|
181
|
-
text?: string
|
|
181
|
+
text?: string,
|
|
182
182
|
) {
|
|
183
183
|
if (
|
|
184
184
|
url !== buttonAbove[0]?.url ||
|
|
@@ -190,7 +190,7 @@ function editButtonUrlAndTarget<V extends Value>(
|
|
|
190
190
|
{ url, target, buttonStyle },
|
|
191
191
|
{
|
|
192
192
|
at: buttonAbove[1],
|
|
193
|
-
}
|
|
193
|
+
},
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -14,7 +14,7 @@ export interface WrapButtonOptions<V extends Value = Value> extends WrapNodesOpt
|
|
|
14
14
|
*/
|
|
15
15
|
export const wrapButton = <V extends Value>(
|
|
16
16
|
editor: PlateEditor<V>,
|
|
17
|
-
{ url, buttonStyle, target, ...options }: WrapButtonOptions<V
|
|
17
|
+
{ url, buttonStyle, target, ...options }: WrapButtonOptions<V>,
|
|
18
18
|
) => {
|
|
19
19
|
wrapNodes<TButtonElement, Value>(
|
|
20
20
|
editor,
|
|
@@ -25,6 +25,6 @@ export const wrapButton = <V extends Value>(
|
|
|
25
25
|
target,
|
|
26
26
|
children: [],
|
|
27
27
|
},
|
|
28
|
-
{ split: true, ...options } as WrapNodesOptions
|
|
28
|
+
{ split: true, ...options } as WrapNodesOptions,
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -14,7 +14,7 @@ export interface CreateButtonNodeOptions {
|
|
|
14
14
|
|
|
15
15
|
export const createButtonNode = <V extends Value>(
|
|
16
16
|
editor: PlateEditor<V>,
|
|
17
|
-
{ url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions
|
|
17
|
+
{ url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions,
|
|
18
18
|
): TButtonElement => {
|
|
19
19
|
const type = getPluginType(editor, ELEMENT_BUTTON);
|
|
20
20
|
|
|
@@ -15,7 +15,7 @@ import { FC, ReactNode } from 'react';
|
|
|
15
15
|
import { LinkSelector } from '../../../shared/LinkSelector';
|
|
16
16
|
import { InsertModalStateProps } from './types';
|
|
17
17
|
|
|
18
|
-
type
|
|
18
|
+
type InsertModalProps = {
|
|
19
19
|
state: InsertModalStateProps;
|
|
20
20
|
onTextChange: (value: string) => void;
|
|
21
21
|
onUrlChange: (value: string) => void;
|
|
@@ -29,7 +29,7 @@ type Props = {
|
|
|
29
29
|
appBridge: AppBridgeBlock;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export const InsertModal: FC<
|
|
32
|
+
export const InsertModal: FC<InsertModalProps> = ({
|
|
33
33
|
state,
|
|
34
34
|
onTextChange,
|
|
35
35
|
onUrlChange,
|
|
@@ -22,7 +22,7 @@ export const LinkButton = ({ id, editorId }: PluginButtonProps) => {
|
|
|
22
22
|
tooltip={getTooltip(
|
|
23
23
|
isEnabled
|
|
24
24
|
? `Link\n${getHotkeyByPlatform('Ctrl+K')}`
|
|
25
|
-
: 'Links can only be set for a single text block.'
|
|
25
|
+
: 'Links can only be set for a single text block.',
|
|
26
26
|
)}
|
|
27
27
|
icon={
|
|
28
28
|
<span className="tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex">
|
package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { HTMLPropsAs, LinkRootProps, useElementProps } from '@udecode/plate';
|
|
4
|
-
import { MouseEvent } from 'react';
|
|
4
|
+
import type { MouseEvent } from 'react';
|
|
5
5
|
import { TLinkElement } from '../types';
|
|
6
6
|
import { BlockStyles } from '../../styles';
|
|
7
7
|
import { LINK_PLUGIN } from '../id';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
|
+
import type { CSSProperties } from 'react';
|
|
3
4
|
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
4
5
|
import { Plugin, PluginProps } from '@frontify/fondue';
|
|
5
6
|
import { createLinkPlugin as createPlateLinkPlugin, createPluginFactory } from '@udecode/plate';
|
|
7
|
+
|
|
6
8
|
import { CustomFloatingLink } from './FloatingLink/CustomFloatingLink';
|
|
7
9
|
import { LINK_PLUGIN } from './id';
|
|
8
10
|
import { LinkButton } from './LinkButton';
|
|
9
11
|
import { LinkMarkupElement } from './LinkMarkupElement';
|
|
10
12
|
import { isValidUrl } from './utils/url';
|
|
11
|
-
import { CSSProperties } from 'react';
|
|
12
13
|
import { BlockStyles } from '../styles';
|
|
13
14
|
|
|
14
15
|
export const createLinkPlugin = (appBridge: AppBridgeBlock) =>
|
|
@@ -4,32 +4,29 @@ import { describe, expect, it } from 'vitest';
|
|
|
4
4
|
import { relativeUrlRegex } from './relativeUrlRegex';
|
|
5
5
|
|
|
6
6
|
describe('Regex values', () => {
|
|
7
|
-
it(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const isMatching = relativeUrlRegex.test(data.input);
|
|
32
|
-
expect(isMatching).toBe(data.shouldMatch);
|
|
33
|
-
}
|
|
7
|
+
it.each([
|
|
8
|
+
{
|
|
9
|
+
input: '/document/123',
|
|
10
|
+
shouldMatch: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
input: '/r/123',
|
|
14
|
+
shouldMatch: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
input: '/wrong/123',
|
|
18
|
+
shouldMatch: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
input: '/r/',
|
|
22
|
+
shouldMatch: false,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
input: '/document/',
|
|
26
|
+
shouldMatch: false,
|
|
27
|
+
},
|
|
28
|
+
])('should only match internal documents starting with /r/ or /document/', ({ input, shouldMatch }) => {
|
|
29
|
+
const isMatching = relativeUrlRegex.test(input);
|
|
30
|
+
expect(isMatching).toBe(shouldMatch);
|
|
34
31
|
});
|
|
35
32
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { createParagraphPlugin as createPlateParagraphPlugin, createPluginFactory } from '@udecode/plate';
|
|
4
|
-
import { CSSProperties } from 'react';
|
|
4
|
+
import type { CSSProperties } from 'react';
|
|
5
5
|
import {
|
|
6
6
|
MarkupElement,
|
|
7
7
|
Plugin,
|