@frontify/guideline-blocks-settings 0.28.2 → 0.28.4

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 (129) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js +67 -67
  3. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  4. package/dist/components/Attachments/Attachments.es.js +80 -80
  5. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  6. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +67 -67
  7. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
  8. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +28 -28
  9. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
  10. package/dist/components/BlockItemWrapper/Toolbar.es.js +33 -33
  11. package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -1
  12. package/dist/components/DownloadButton/DownloadButton.es.js +12 -12
  13. package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
  14. package/dist/components/RichTextEditor/RichTextEditor.es.js +12 -12
  15. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
  16. package/dist/components/RichTextEditor/SerializedText.es.js +4 -4
  17. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
  18. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +9 -9
  19. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
  20. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +8 -8
  21. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
  22. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +6 -6
  23. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
  24. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +10 -10
  25. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
  26. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +13 -13
  27. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
  28. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +18 -18
  29. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
  30. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
  31. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +11 -11
  32. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
  33. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +15 -15
  34. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
  35. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +3 -3
  36. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
  37. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +40 -40
  38. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
  39. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +10 -10
  40. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
  41. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +4 -4
  42. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
  43. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
  44. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +14 -14
  45. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
  46. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +14 -14
  47. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
  48. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +14 -14
  49. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
  50. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +20 -20
  51. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
  52. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +17 -17
  53. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
  54. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +17 -17
  55. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
  56. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +17 -17
  57. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
  58. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +18 -18
  59. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
  60. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +16 -16
  61. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
  62. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +19 -19
  63. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
  64. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +15 -15
  65. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
  66. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +32 -32
  67. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -1
  68. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +15 -15
  69. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -1
  70. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +30 -30
  71. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -1
  72. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +27 -27
  73. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -1
  74. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +12 -12
  75. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -1
  76. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +14 -14
  77. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -1
  78. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
  79. package/dist/components/RichTextEditor/serializer/nodes/button.es.js +3 -2
  80. package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -1
  81. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js +7 -7
  82. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -1
  83. package/dist/components/RichTextEditor/serializer/nodes/default.es.js +27 -12
  84. package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
  85. package/dist/components/RichTextEditor/serializer/nodes/link.es.js +7 -7
  86. package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -1
  87. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js +33 -33
  88. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -1
  89. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -1
  90. package/dist/index.cjs.js +12 -37
  91. package/dist/index.cjs.js.map +1 -1
  92. package/dist/index.umd.js +12 -37
  93. package/dist/index.umd.js.map +1 -1
  94. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
  95. package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
  96. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
  97. package/package.json +12 -11
  98. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +1 -1
  99. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +2 -2
  100. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +1 -1
  101. package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +2 -1
  102. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +1 -1
  103. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +1 -1
  104. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +1 -1
  105. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +1 -1
  106. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +1 -1
  107. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +1 -1
  108. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +1 -1
  109. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +1 -1
  110. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +1 -1
  111. package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +1 -1
  112. package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +1 -1
  113. package/src/components/RichTextEditor/plugins/styles.ts +1 -1
  114. package/src/components/RichTextEditor/serializer/nodes/button.ts +3 -1
  115. package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +5 -4
  116. package/src/components/RichTextEditor/serializer/nodes/default.ts +30 -14
  117. package/src/components/RichTextEditor/serializer/nodes/link.ts +5 -4
  118. package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +5 -5
  119. package/src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts +1 -1
  120. package/src/utilities/react/getBackgroundColorStyles.ts +2 -3
  121. package/src/utilities/react/getBorderStyles.ts +2 -3
  122. package/src/utilities/react/getRadiusStyles.ts +1 -1
  123. package/vite.config.ts +4 -2
  124. package/dist/_virtual/jsx-runtime.es.js +0 -5
  125. package/dist/_virtual/jsx-runtime.es.js.map +0 -1
  126. package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
  127. package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
  128. package/dist/_virtual/react-jsx-runtime.production.min.es.js +0 -5
  129. package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getBackgroundColorStyles.es.js","sources":["../../../src/utilities/react/getBackgroundColorStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nimport { Color } from '@frontify/fondue';\n\nimport { toRgbaString } from '../color';\n\nexport const getBackgroundColorStyles = (backgroundColor: Color): CSSProperties => ({\n backgroundColor: toRgbaString(backgroundColor),\n});\n"],"names":["getBackgroundColorStyles","backgroundColor","toRgbaString"],"mappings":";AAQa,MAAAA,IAA2B,CAACC,OAA2C;AAAA,EAChF,iBAAiBC,EAAaD,CAAe;AACjD;"}
1
+ {"version":3,"file":"getBackgroundColorStyles.es.js","sources":["../../../src/utilities/react/getBackgroundColorStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport type { Color } from '@frontify/fondue';\n\nimport { toRgbaString } from '../color';\n\nexport const getBackgroundColorStyles = (backgroundColor: Color): CSSProperties => ({\n backgroundColor: toRgbaString(backgroundColor),\n});\n"],"names":["getBackgroundColorStyles","backgroundColor","toRgbaString"],"mappings":";AAOa,MAAAA,IAA2B,CAACC,OAA2C;AAAA,EAChF,iBAAiBC,EAAaD,CAAe;AACjD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getBorderStyles.es.js","sources":["../../../src/utilities/react/getBorderStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nimport { Color } from '@frontify/fondue';\n\nimport { BorderStyle, borderStyleMap } from '../../settings/types';\nimport { BORDER_COLOR_DEFAULT_VALUE } from '../../settings/defaultValues';\nimport { toRgbaString } from '../color';\n\nexport const getBorderStyles = (\n style = BorderStyle.Solid,\n borderWidth = '1px',\n color = BORDER_COLOR_DEFAULT_VALUE as Color,\n): CSSProperties => {\n return {\n borderStyle: borderStyleMap[style],\n borderWidth,\n borderColor: toRgbaString(color),\n };\n};\n"],"names":["getBorderStyles","style","BorderStyle","borderWidth","color","BORDER_COLOR_DEFAULT_VALUE","borderStyleMap","toRgbaString"],"mappings":";;;AAUa,MAAAA,IAAkB,CAC3BC,IAAQC,EAAY,OACpBC,IAAc,OACdC,IAAQC,OAED;AAAA,EACH,aAAaC,EAAeL,CAAK;AAAA,EACjC,aAAAE;AAAA,EACA,aAAaI,EAAaH,CAAK;AAAA;"}
1
+ {"version":3,"file":"getBorderStyles.es.js","sources":["../../../src/utilities/react/getBorderStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport type { Color } from '@frontify/fondue';\n\nimport { BorderStyle, borderStyleMap } from '../../settings/types';\nimport { BORDER_COLOR_DEFAULT_VALUE } from '../../settings/defaultValues';\nimport { toRgbaString } from '../color';\n\nexport const getBorderStyles = (\n style = BorderStyle.Solid,\n borderWidth = '1px',\n color = BORDER_COLOR_DEFAULT_VALUE as Color,\n): CSSProperties => {\n return {\n borderStyle: borderStyleMap[style],\n borderWidth,\n borderColor: toRgbaString(color),\n };\n};\n"],"names":["getBorderStyles","style","BorderStyle","borderWidth","color","BORDER_COLOR_DEFAULT_VALUE","borderStyleMap","toRgbaString"],"mappings":";;;AASa,MAAAA,IAAkB,CAC3BC,IAAQC,EAAY,OACpBC,IAAc,OACdC,IAAQC,OAED;AAAA,EACH,aAAaC,EAAeL,CAAK;AAAA,EACjC,aAAAE;AAAA,EACA,aAAaI,EAAaH,CAAK;AAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getRadiusStyles.es.js","sources":["../../../src/utilities/react/getRadiusStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { Radius, radiusStyleMap } from '../../settings/types';\n\nexport const getRadiusStyles = (radiusChoice: Radius, hasRadius = false, radiusValue?: number): CSSProperties => ({\n borderRadius: hasRadius ? radiusValue : radiusStyleMap[radiusChoice],\n});\n"],"names":["getRadiusStyles","radiusChoice","hasRadius","radiusValue","radiusStyleMap"],"mappings":";AAKO,MAAMA,IAAkB,CAACC,GAAsBC,IAAY,IAAOC,OAAyC;AAAA,EAC9G,cAAcD,IAAYC,IAAcC,EAAeH,CAAY;AACvE;"}
1
+ {"version":3,"file":"getRadiusStyles.es.js","sources":["../../../src/utilities/react/getRadiusStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport { Radius, radiusStyleMap } from '../../settings/types';\n\nexport const getRadiusStyles = (radiusChoice: Radius, hasRadius = false, radiusValue?: number): CSSProperties => ({\n borderRadius: hasRadius ? radiusValue : radiusStyleMap[radiusChoice],\n});\n"],"names":["getRadiusStyles","radiusChoice","hasRadius","radiusValue","radiusStyleMap"],"mappings":";AAKO,MAAMA,IAAkB,CAACC,GAAsBC,IAAY,IAAOC,OAAyC;AAAA,EAC9G,cAAcD,IAAYC,IAAcC,EAAeH,CAAY;AACvE;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontify/guideline-blocks-settings",
3
- "version": "0.28.2",
3
+ "version": "0.28.4",
4
4
  "description": "Provides types and helpers for the guideline block development",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.umd.js",
@@ -22,12 +22,12 @@
22
22
  "./styles": "./dist/styles.css"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/core": "^7.22.9",
25
+ "@babel/core": "^7.22.10",
26
26
  "@frontify/eslint-config-typescript": "^0.16.1",
27
27
  "@testing-library/react": "^14.0.0",
28
28
  "@types/escape-html": "^1.0.2",
29
- "@types/node": "^20.4.7",
30
- "@types/react": "^18.2.18",
29
+ "@types/node": "^18.17.4",
30
+ "@types/react": "^18.2.20",
31
31
  "@types/react-dom": "^18.2.7",
32
32
  "@types/sinon": "^10.0.16",
33
33
  "@vitejs/plugin-react": "^4.0.4",
@@ -36,19 +36,20 @@
36
36
  "cypress-real-events": "^1.10.0",
37
37
  "eslint": "^8.46.0",
38
38
  "eslint-plugin-notice": "^0.9.10",
39
- "happy-dom": "^10.7.0",
39
+ "happy-dom": "^10.9.0",
40
40
  "mitt": "^3.0.1",
41
41
  "msw": "^1.2.3",
42
42
  "postcss": "^8.4.27",
43
43
  "prettier": "^3.0.1",
44
44
  "react": "^18.2.0",
45
45
  "react-dom": "^18.2.0",
46
- "rollup": "^3.27.2",
46
+ "rollup": "^3.28.0",
47
47
  "sinon": "15.2.0",
48
48
  "tailwindcss": "^3.3.3",
49
49
  "typescript": "^5.1.6",
50
- "vite": "^4.4.8",
51
- "vite-plugin-dts": "^3.5.0",
50
+ "vite": "^4.4.9",
51
+ "vite-plugin-dts": "^3.5.1",
52
+ "vite-plugin-externals": "^0.6.2",
52
53
  "vitest": "^0.34.1"
53
54
  },
54
55
  "dependencies": {
@@ -56,15 +57,15 @@
56
57
  "@dnd-kit/core": "^6.0.8",
57
58
  "@dnd-kit/modifiers": "^6.0.1",
58
59
  "@dnd-kit/sortable": "^7.0.2",
59
- "@frontify/fondue": "^12.0.0-beta.296",
60
+ "@frontify/fondue": "12.0.0-beta.296",
60
61
  "@react-aria/focus": "^3.13.0",
61
62
  "@react-stately/overlays": "^3.6.0",
62
63
  "@udecode/plate": "^21",
63
64
  "escape-html": "^1.0.3",
64
65
  "slate": "^0.94.1",
65
66
  "slate-react": "^0.97.1",
66
- "@frontify/app-bridge": "3.0.0-beta.86",
67
- "@frontify/sidebar-settings": "0.6.1"
67
+ "@frontify/app-bridge": "3.0.0-beta.87",
68
+ "@frontify/sidebar-settings": "0.6.2"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "react": "^18",
@@ -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';
@@ -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 Props = {
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<Props> = ({
32
+ export const InsertModal: FC<InsertModalProps> = ({
33
33
  state,
34
34
  onTextChange,
35
35
  onUrlChange,
@@ -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) =>
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { PlateRenderElementProps, createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { PlateRenderElementProps, createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -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,
@@ -1,7 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { createPluginFactory } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
4
+ import type { CSSProperties } from 'react';
5
5
  import {
6
6
  MarkupElement,
7
7
  Plugin,
@@ -1,6 +1,6 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { CSSProperties } from 'react';
3
+ import type { CSSProperties } from 'react';
4
4
  import { LINK_PLUGIN } from './LinkPlugin/id';
5
5
  import { BlockButtonStyles } from './ButtonPlugin';
6
6
 
@@ -1,8 +1,9 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
+ import type { CSSProperties } from 'react';
3
4
  import { TElement } from '@udecode/plate';
5
+
4
6
  import { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';
5
- import { CSSProperties } from 'react';
6
7
  import { BUTTON_PLUGIN } from '../../plugins';
7
8
 
8
9
  export type ButtonStylesType = Record<string, Record<string, CSSProperties & { hover?: CSSProperties }>>;
@@ -17,6 +18,7 @@ export const buttonNode = (node: TElement, children: string, defaultClassNames:
17
18
 
18
19
  return `<a href="${node.url}"
19
20
  target="${node.target ?? '_blank'}"
21
+ dir="auto"
20
22
  style="${defaultStyles}"
21
23
  class="${defaultClassNames}"
22
24
  onmouseenter="this.setAttribute('style', '${defaultStyles} ${reactCssPropsToCss(buttonStyle?.hover)}');"
@@ -1,8 +1,9 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
+ import type { CSSProperties } from 'react';
3
4
  import { merge } from '@frontify/fondue';
4
5
  import { TElement } from '@udecode/plate';
5
- import { CSSProperties } from 'react';
6
+
6
7
  import { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';
7
8
 
8
9
  export const checkItemNode = (
@@ -11,17 +12,17 @@ export const checkItemNode = (
11
12
  defaultClassNames: string,
12
13
  styles: Record<string, CSSProperties & { hover?: CSSProperties }>,
13
14
  ) => {
14
- return `<div disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}" style="margin-left:${
15
+ return `<div dir="auto" disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}" style="margin-left:${
15
16
  ((node.indent as number) ?? 0) * 24
16
17
  }px;">
17
- <div class="tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5">
18
+ <div dir="auto" class="tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5">
18
19
  <input
19
20
  class="tw-w-4 tw-h-4 tw-m-0"
20
21
  type="checkbox"
21
22
  ${node.checked ? 'checked' : ''}
22
23
  onclick="return false;" />
23
24
  </div>
24
- <span class="${merge([
25
+ <span dir="auto" class="${merge([
25
26
  'tw-flex-1 tw-focus:outline-none',
26
27
  node.checked ? '!tw-line-through' : '',
27
28
  ])}" style="${reactCssPropsToCss(styles[node.children[0].textStyle as string])}">${children}</span>
@@ -1,52 +1,68 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
+ import type { CSSProperties } from 'react';
4
+ import { merge } from '@frontify/fondue';
3
5
  import { TElement } from '@udecode/plate';
4
- import { CSSProperties } from 'react';
6
+
5
7
  import { TextStyles } from '../../plugins';
6
8
  import { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';
7
- import { merge } from '@frontify/fondue';
8
9
 
9
10
  export const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {
10
11
  const defaultStyles = reactCssPropsToCss(styles);
11
12
 
12
13
  if (node.type === TextStyles.heading1) {
13
- return `<h1 class="${merge([defaultClassNames, 'a-h1'])}">${getStyledChild(children, defaultStyles)}</h1>`;
14
+ return `<h1 dir="auto" class="${merge([defaultClassNames, 'a-h1'])}">${getStyledChild(
15
+ children,
16
+ defaultStyles,
17
+ )}</h1>`;
14
18
  }
15
19
  if (node.type === TextStyles.heading2) {
16
- return `<h2 class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h2>`;
20
+ return `<h2 dir="auto" class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h2>`;
17
21
  }
18
22
  if (node.type === TextStyles.heading3) {
19
- return `<h3 class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h3>`;
23
+ return `<h3 dir="auto" class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h3>`;
20
24
  }
21
25
  if (node.type === TextStyles.heading4) {
22
- return `<h4 class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h4>`;
26
+ return `<h4 dir="auto" class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</h4>`;
23
27
  }
24
28
  if (node.type === TextStyles.custom1) {
25
- return `<p class="${merge([defaultClassNames, 'a-custom1'])}">${getStyledChild(children, defaultStyles)}</p>`;
29
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-custom1'])}">${getStyledChild(
30
+ children,
31
+ defaultStyles,
32
+ )}</p>`;
26
33
  }
27
34
  if (node.type === TextStyles.custom2) {
28
- return `<p class="${merge([defaultClassNames, 'a-custom2'])}">${getStyledChild(children, defaultStyles)}</p>`;
35
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-custom2'])}">${getStyledChild(
36
+ children,
37
+ defaultStyles,
38
+ )}</p>`;
29
39
  }
30
40
  if (node.type === TextStyles.custom3) {
31
- return `<p class="${merge([defaultClassNames, 'a-custom3'])}">${getStyledChild(children, defaultStyles)}</p>`;
41
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-custom3'])}">${getStyledChild(
42
+ children,
43
+ defaultStyles,
44
+ )}</p>`;
32
45
  }
33
46
  if (node.type === TextStyles.quote) {
34
- return `<p class="${merge([defaultClassNames, 'a-quote'])}">${getStyledChild(children, defaultStyles)}</p>`;
47
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-quote'])}">${getStyledChild(
48
+ children,
49
+ defaultStyles,
50
+ )}</p>`;
35
51
  }
36
52
  if (node.type === TextStyles.imageTitle) {
37
- return `<p class="${merge([defaultClassNames, 'a-image-title'])}">${getStyledChild(
53
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-image-title'])}">${getStyledChild(
38
54
  children,
39
55
  defaultStyles,
40
56
  )}</p>`;
41
57
  }
42
58
  if (node.type === TextStyles.imageCaption) {
43
- return `<p class="${merge([defaultClassNames, 'a-image-caption'])}">${getStyledChild(
59
+ return `<p dir="auto" class="${merge([defaultClassNames, 'a-image-caption'])}">${getStyledChild(
44
60
  children,
45
61
  defaultStyles,
46
62
  )}</p>`;
47
63
  }
48
64
 
49
- return `<p class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</p>`;
65
+ return `<p dir="auto" class="${defaultClassNames}">${getStyledChild(children, defaultStyles)}</p>`;
50
66
  };
51
67
 
52
- const getStyledChild = (children: string, styles: string) => `<span style="${styles}">${children}</span>`;
68
+ const getStyledChild = (children: string, styles: string) => `<span dir="auto" style="${styles}">${children}</span>`;
@@ -1,11 +1,12 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
+ import type { CSSProperties } from 'react';
4
+ import escapeHtml from 'escape-html';
3
5
  import { TElement } from '@udecode/plate';
6
+
4
7
  import { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';
5
8
  import { TLinkElement } from '../../plugins/LinkPlugin/types';
6
9
  import { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';
7
- import escapeHtml from 'escape-html';
8
- import { CSSProperties } from 'react';
9
10
 
10
11
  export const linkNode = (
11
12
  node: TElement,
@@ -15,11 +16,11 @@ export const linkNode = (
15
16
  ) => {
16
17
  if (node.chosenLink) {
17
18
  const { chosenLink } = node as TLinkElement;
18
- return `<a class="${defaultClassNames}" style="${reactCssPropsToCss(styles[LINK_PLUGIN])}" target=${
19
+ return `<a dir="auto" class="${defaultClassNames}" style="${reactCssPropsToCss(styles[LINK_PLUGIN])}" target=${
19
20
  chosenLink?.openInNewTab ? '_blank' : '_self'
20
21
  } href="${escapeHtml(chosenLink?.searchResult?.link)}">${children}</a>`;
21
22
  }
22
- return `<a class="${defaultClassNames}" style="${reactCssPropsToCss(styles[LINK_PLUGIN])}" target="${
23
+ return `<a dir="auto" class="${defaultClassNames}" style="${reactCssPropsToCss(styles[LINK_PLUGIN])}" target="${
23
24
  node?.target ?? '_blank'
24
25
  }" href="${escapeHtml(node.url as string)}">${children}</a>`;
25
26
  };
@@ -25,7 +25,7 @@ import {
25
25
  } from '@udecode/plate';
26
26
  import { serializeLeafToHtml } from './utlis/serializeLeafToHtml';
27
27
  import { reactCssPropsToCss } from './utlis/reactCssPropsToCss';
28
- import { CSSProperties } from 'react';
28
+ import type { CSSProperties } from 'react';
29
29
  import { ButtonStylesType, buttonNode } from './nodes/button';
30
30
  import { linkNode } from './nodes/link';
31
31
  import { defaultNode } from './nodes/default';
@@ -105,19 +105,19 @@ type Arguments = {
105
105
  };
106
106
 
107
107
  const MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string } = {
108
- [ELEMENT_UL]: (args) => `<ul class="${UL_CLASSES} ${args.classNames}">${args.children}</ul>`,
108
+ [ELEMENT_UL]: (args) => `<ul dir="auto" class="${UL_CLASSES} ${args.classNames}">${args.children}</ul>`,
109
109
  [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {
110
110
  const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);
111
- return `<ol class="${getOrderedListClasses(nestingLevel)} ${classNames}" style="${reactCssPropsToCss(
111
+ return `<ol dir="auto" class="${getOrderedListClasses(nestingLevel)} ${classNames}" style="${reactCssPropsToCss(
112
112
  OL_STYLES,
113
113
  )}">${children}</ol>`;
114
114
  },
115
115
  [ELEMENT_LI]: ({ classNames, children, node, styles }) =>
116
- `<li class="${classNames} ${LI_CLASSNAMES}" style="${reactCssPropsToCss(
116
+ `<li dir="auto" class="${classNames} ${LI_CLASSNAMES}" style="${reactCssPropsToCss(
117
117
  getLiStyles(node, styles),
118
118
  )}">${children}</li>`,
119
119
  [ELEMENT_LIC]: ({ classNames, children, node }) =>
120
- `<p class="${classNames} ${getLicElementClassNames(node)}"><span>${children}</span></p>`,
120
+ `<p dir="auto" class="${classNames} ${getLicElementClassNames(node)}"><span>${children}</span></p>`,
121
121
  [ELEMENT_LINK]: ({ node, children, classNames, styles }) => linkNode(node, children, classNames, styles),
122
122
  [ELEMENT_BUTTON]: ({ node, children, classNames, styles }) =>
123
123
  buttonNode(node, children, classNames, styles as ButtonStylesType),
@@ -1,6 +1,6 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { CSSProperties } from 'react';
3
+ import type { CSSProperties } from 'react';
4
4
 
5
5
  export const reactCssPropsToCss = (props?: CSSProperties): string => {
6
6
  if (!props) {
@@ -1,8 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { CSSProperties } from 'react';
4
-
5
- import { Color } from '@frontify/fondue';
3
+ import type { CSSProperties } from 'react';
4
+ import type { Color } from '@frontify/fondue';
6
5
 
7
6
  import { toRgbaString } from '../color';
8
7
 
@@ -1,8 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { CSSProperties } from 'react';
4
-
5
- import { Color } from '@frontify/fondue';
3
+ import type { CSSProperties } from 'react';
4
+ import type { Color } from '@frontify/fondue';
6
5
 
7
6
  import { BorderStyle, borderStyleMap } from '../../settings/types';
8
7
  import { BORDER_COLOR_DEFAULT_VALUE } from '../../settings/defaultValues';
@@ -1,6 +1,6 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { CSSProperties } from 'react';
3
+ import type { CSSProperties } from 'react';
4
4
  import { Radius, radiusStyleMap } from '../../settings/types';
5
5
 
6
6
  export const getRadiusStyles = (radiusChoice: Radius, hasRadius = false, radiusValue?: number): CSSProperties => ({
package/vite.config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
3
  import { defineConfig } from 'vitest/config';
4
+ import react from '@vitejs/plugin-react';
4
5
  import { PreRenderedAsset } from 'rollup';
5
6
  import { dependencies as dependenciesMap, peerDependencies as peerDependenciesMap } from './package.json';
6
7
  import { resolve } from 'path';
@@ -12,6 +13,7 @@ const peerDependencies = Object.keys(peerDependenciesMap);
12
13
  export const globals = {
13
14
  react: 'React',
14
15
  'react-dom': 'ReactDOM',
16
+ 'react-dom/client': 'ReactDOM',
15
17
  };
16
18
 
17
19
  const assetFileNames = (chunkInfo: PreRenderedAsset): string => {
@@ -22,7 +24,7 @@ const assetFileNames = (chunkInfo: PreRenderedAsset): string => {
22
24
  };
23
25
 
24
26
  export default defineConfig({
25
- plugins: [dts({ insertTypesEntry: true, rollupTypes: true })],
27
+ plugins: [dts({ insertTypesEntry: true, rollupTypes: true }), react()],
26
28
  resolve: {
27
29
  mainFields: ['module', 'main'],
28
30
  },
@@ -41,7 +43,7 @@ export default defineConfig({
41
43
  sourcemap: true,
42
44
  minify: true,
43
45
  rollupOptions: {
44
- external: [...dependencies, ...peerDependencies],
46
+ external: [...dependencies, ...peerDependencies, 'react-dom/client', 'react/jsx-runtime'],
45
47
  output: [
46
48
  {
47
49
  name: 'GuidelineBlocksSettings',
@@ -1,5 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
5
- //# sourceMappingURL=jsx-runtime.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx-runtime.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
5
- //# sourceMappingURL=react-jsx-runtime.development.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-jsx-runtime.development.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
5
- //# sourceMappingURL=react-jsx-runtime.production.min.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-jsx-runtime.production.min.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}