@frontify/guideline-blocks-settings 0.28.1 → 0.28.2

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 (172) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js +54 -54
  3. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  4. package/dist/components/Attachments/Attachments.es.js +69 -69
  5. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  6. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +42 -42
  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.map +1 -1
  11. package/dist/components/RichTextEditor/RichTextEditor.es.js +23 -23
  12. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
  13. package/dist/components/RichTextEditor/SerializedText.es.js +7 -7
  14. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
  15. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
  16. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +11 -11
  17. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
  18. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
  19. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +10 -10
  20. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -1
  21. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +13 -13
  22. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -1
  23. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +2 -2
  24. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
  25. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +30 -30
  26. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
  27. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +7 -7
  28. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -1
  29. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +30 -30
  30. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
  31. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
  32. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
  33. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +8 -8
  34. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
  35. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
  36. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
  37. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
  38. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
  39. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
  40. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
  41. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
  42. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
  43. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
  44. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
  45. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +30 -30
  46. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
  47. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +7 -7
  48. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -1
  49. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +29 -29
  50. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
  51. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
  52. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -1
  53. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +14 -14
  54. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -1
  55. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +27 -27
  56. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -1
  57. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +27 -27
  58. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -1
  59. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +15 -15
  60. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -1
  61. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +13 -13
  62. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -1
  63. package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -1
  64. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -1
  65. package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
  66. package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -1
  67. package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +1 -1
  68. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -1
  69. package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -1
  70. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -1
  71. package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -1
  72. package/dist/helpers/addHttps.es.js.map +1 -1
  73. package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
  74. package/dist/helpers/hasRichTextValue.es.js.map +1 -1
  75. package/dist/hooks/useAttachments.es.js.map +1 -1
  76. package/dist/hooks/useDndSensors.es.js.map +1 -1
  77. package/dist/index.cjs.js +22 -229
  78. package/dist/index.cjs.js.map +1 -1
  79. package/dist/index.d.ts +12 -10
  80. package/dist/index.es.js +1 -1
  81. package/dist/index.es.js.map +1 -1
  82. package/dist/index.umd.js +22 -229
  83. package/dist/index.umd.js.map +1 -1
  84. package/dist/settings/background.es.js.map +1 -1
  85. package/dist/settings/border.es.js +1 -1
  86. package/dist/settings/border.es.js.map +1 -1
  87. package/dist/settings/borderRadius.es.js +1 -1
  88. package/dist/settings/borderRadius.es.js.map +1 -1
  89. package/dist/settings/borderRadiusExtended.es.js +1 -1
  90. package/dist/settings/borderRadiusExtended.es.js.map +1 -1
  91. package/dist/settings/gutter.es.js +1 -1
  92. package/dist/settings/margin.es.js +1 -1
  93. package/dist/settings/margin.es.js.map +1 -1
  94. package/dist/settings/marginExtended.es.js +1 -1
  95. package/dist/settings/marginExtended.es.js.map +1 -1
  96. package/dist/settings/padding.es.js +1 -1
  97. package/dist/settings/padding.es.js.map +1 -1
  98. package/dist/settings/paddingExtended.es.js +1 -1
  99. package/dist/settings/paddingExtended.es.js.map +1 -1
  100. package/dist/settings/securityGlobalControl.es.js +1 -1
  101. package/dist/styles.css +1 -0
  102. package/dist/styles.css.es.js +5 -0
  103. package/dist/styles.css.es.js.map +1 -0
  104. package/dist/utilities/moveItemInArray.es.js.map +1 -1
  105. package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
  106. package/package.json +25 -24
  107. package/src/components/Attachments/AttachmentItem.tsx +2 -2
  108. package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
  109. package/src/components/Attachments/Attachments.tsx +2 -2
  110. package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
  111. package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
  112. package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
  113. package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
  114. package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
  115. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
  116. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
  117. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
  118. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
  119. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
  120. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
  121. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
  122. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +2 -0
  123. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
  124. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
  125. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
  126. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
  127. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
  128. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
  129. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
  130. package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
  131. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
  132. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
  133. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
  134. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
  135. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
  136. package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +1 -1
  137. package/src/components/RichTextEditor/serializer/nodes/default.ts +2 -2
  138. package/src/components/RichTextEditor/serializer/nodes/link.ts +1 -1
  139. package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +4 -4
  140. package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
  141. package/src/hooks/useAttachments.ts +1 -1
  142. package/src/hooks/useDndSensors.ts +1 -1
  143. package/src/index.ts +3 -3
  144. package/src/settings/background.spec.ts +1 -1
  145. package/src/settings/border.spec.ts +1 -1
  146. package/src/settings/borderRadiusExtended.spec.ts +4 -4
  147. package/src/settings/marginExtended.spec.ts +4 -4
  148. package/src/settings/paddingExtended.spec.ts +4 -4
  149. package/src/styles.css +3 -0
  150. package/src/utilities/react/getBorderStyles.ts +1 -1
  151. package/vite.config.ts +22 -2
  152. package/dist/_virtual/_commonjsHelpers.es.js +0 -7
  153. package/dist/_virtual/_commonjsHelpers.es.js.map +0 -1
  154. package/dist/_virtual/index.es.js +0 -5
  155. package/dist/_virtual/index.es.js.map +0 -1
  156. package/dist/_virtual/index.es2.js +0 -5
  157. package/dist/_virtual/index.es2.js.map +0 -1
  158. package/dist/_virtual/index.es3.js +0 -5
  159. package/dist/_virtual/index.es3.js.map +0 -1
  160. package/dist/_virtual/react-dom.development.es.js +0 -5
  161. package/dist/_virtual/react-dom.development.es.js.map +0 -1
  162. package/dist/_virtual/react-dom.production.min.es.js +0 -5
  163. package/dist/_virtual/react-dom.production.min.es.js.map +0 -1
  164. package/dist/_virtual/react.development.es.js +0 -5
  165. package/dist/_virtual/react.development.es.js.map +0 -1
  166. package/dist/_virtual/react.production.min.es.js +0 -5
  167. package/dist/_virtual/react.production.min.es.js.map +0 -1
  168. package/dist/_virtual/scheduler.development.es.js +0 -5
  169. package/dist/_virtual/scheduler.development.es.js.map +0 -1
  170. package/dist/_virtual/scheduler.production.min.es.js +0 -5
  171. package/dist/_virtual/scheduler.production.min.es.js.map +0 -1
  172. package/dist/style.css +0 -1
@@ -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
  };
@@ -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
  };
@@ -125,7 +125,7 @@ export const useInsertModal = () => {
125
125
  {
126
126
  enableOnFormTags: ['INPUT'],
127
127
  },
128
- []
128
+ [],
129
129
  );
130
130
 
131
131
  return {
@@ -95,7 +95,7 @@ export const useFloatingButtonEdit = ({ floatingOptions, ...props }: FloatingBut
95
95
  {
96
96
  enableOnContentEditable: true,
97
97
  },
98
- []
98
+ [],
99
99
  );
100
100
 
101
101
  useFloatingButtonEnter();
@@ -16,6 +16,6 @@ export const useFloatingButtonEnter = () => {
16
16
  {
17
17
  enableOnFormTags: ['INPUT'],
18
18
  },
19
- []
19
+ [],
20
20
  );
21
21
  };
@@ -25,6 +25,6 @@ export const useFloatingButtonEscape = () => {
25
25
  enableOnFormTags: ['INPUT'],
26
26
  enableOnContentEditable: true,
27
27
  },
28
- []
28
+ [],
29
29
  );
30
30
  };
@@ -40,7 +40,7 @@ export const useFloatingButtonInsert = ({ floatingOptions, ...props }: FloatingB
40
40
  {
41
41
  enableOnContentEditable: true,
42
42
  },
43
- [focused]
43
+ [focused],
44
44
  );
45
45
 
46
46
  const { update, style, floating } = useVirtualFloatingButton({
@@ -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
  };
@@ -20,7 +20,7 @@ export const unwrapButton = <V extends Value>(
20
20
  editor: PlateEditor<V>,
21
21
  options?: UnwrapNodesOptions & {
22
22
  split?: boolean;
23
- }
23
+ },
24
24
  ) => {
25
25
  return withoutNormalizing(editor, () => {
26
26
  if (options?.split) {
@@ -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
 
@@ -10,7 +10,7 @@ export const triggerFloatingButton = <V extends Value>(
10
10
  focused,
11
11
  }: {
12
12
  focused?: boolean;
13
- } = {}
13
+ } = {},
14
14
  ) => {
15
15
  if (floatingButtonSelectors.mode() === 'edit') {
16
16
  triggerFloatingButtonEdit(editor);
@@ -19,7 +19,7 @@ export const triggerFloatingButtonInsert = <V extends Value>(
19
19
  focused,
20
20
  }: {
21
21
  focused?: boolean;
22
- } = {}
22
+ } = {},
23
23
  ) => {
24
24
  if (floatingButtonSelectors.mode()) {
25
25
  return;
@@ -101,6 +101,6 @@ export const withButton: WithOverride = (editor, { type }) => {
101
101
  editor,
102
102
  mockPlugin<AnyObject, Value, PlateEditor<Value>>({
103
103
  options: { types: type },
104
- })
104
+ }),
105
105
  );
106
106
  };
@@ -95,7 +95,7 @@ export const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkP
95
95
  {
96
96
  enableOnContentEditable: true,
97
97
  },
98
- []
98
+ [],
99
99
  );
100
100
 
101
101
  useFloatingLinkEnter();
@@ -38,7 +38,7 @@ export const useFloatingLinkInsert = ({ floatingOptions, ...props }: FloatingLin
38
38
  {
39
39
  enableOnContentEditable: true,
40
40
  },
41
- [focused]
41
+ [focused],
42
42
  );
43
43
 
44
44
  const { update, style, floating } = useVirtualFloatingLink({
@@ -119,7 +119,7 @@ export const useInsertModal = () => {
119
119
  {
120
120
  enableOnFormTags: ['INPUT'],
121
121
  },
122
- []
122
+ [],
123
123
  );
124
124
 
125
125
  return {
@@ -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">
@@ -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('should only match internal documents starting with /r/ or /document/', () => {
8
- const testData = [
9
- {
10
- input: '/document/123',
11
- shouldMatch: true,
12
- },
13
- {
14
- input: '/r/123',
15
- shouldMatch: true,
16
- },
17
- {
18
- input: '/wrong/123',
19
- shouldMatch: false,
20
- },
21
- {
22
- input: '/r/',
23
- shouldMatch: false,
24
- },
25
- {
26
- input: '/document/',
27
- shouldMatch: false,
28
- },
29
- ];
30
- for (const data of testData) {
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
  });
@@ -9,7 +9,7 @@ export const checkItemNode = (
9
9
  node: TElement,
10
10
  children: string,
11
11
  defaultClassNames: string,
12
- styles: Record<string, CSSProperties & { hover?: CSSProperties }>
12
+ styles: Record<string, CSSProperties & { hover?: CSSProperties }>,
13
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
15
  ((node.indent as number) ?? 0) * 24
@@ -36,13 +36,13 @@ export const defaultNode = (node: TElement, children: string, styles: CSSPropert
36
36
  if (node.type === TextStyles.imageTitle) {
37
37
  return `<p class="${merge([defaultClassNames, 'a-image-title'])}">${getStyledChild(
38
38
  children,
39
- defaultStyles
39
+ defaultStyles,
40
40
  )}</p>`;
41
41
  }
42
42
  if (node.type === TextStyles.imageCaption) {
43
43
  return `<p class="${merge([defaultClassNames, 'a-image-caption'])}">${getStyledChild(
44
44
  children,
45
- defaultStyles
45
+ defaultStyles,
46
46
  )}</p>`;
47
47
  }
48
48
 
@@ -11,7 +11,7 @@ export const linkNode = (
11
11
  node: TElement,
12
12
  children: string,
13
13
  defaultClassNames: string,
14
- styles: Record<string, CSSProperties & { hover?: CSSProperties }>
14
+ styles: Record<string, CSSProperties & { hover?: CSSProperties }>,
15
15
  ) => {
16
16
  if (node.chosenLink) {
17
17
  const { chosenLink } = node as TLinkElement;
@@ -57,7 +57,7 @@ type SerializeNodeToHtmlRecursiveOptions = {
57
57
  export const serializeNodeToHtmlRecursive = (
58
58
  node: TDescendant,
59
59
  styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,
60
- { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions
60
+ { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions,
61
61
  ): string => {
62
62
  if (isText(node)) {
63
63
  return serializeLeafToHtml(node);
@@ -90,7 +90,7 @@ export const serializeNodeToHtmlRecursive = (
90
90
  node,
91
91
  children,
92
92
  styles[node.type],
93
- getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined)
93
+ getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),
94
94
  );
95
95
  }
96
96
  };
@@ -109,12 +109,12 @@ const MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string }
109
109
  [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {
110
110
  const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);
111
111
  return `<ol class="${getOrderedListClasses(nestingLevel)} ${classNames}" style="${reactCssPropsToCss(
112
- OL_STYLES
112
+ OL_STYLES,
113
113
  )}">${children}</ol>`;
114
114
  },
115
115
  [ELEMENT_LI]: ({ classNames, children, node, styles }) =>
116
116
  `<li class="${classNames} ${LI_CLASSNAMES}" style="${reactCssPropsToCss(
117
- getLiStyles(node, styles)
117
+ getLiStyles(node, styles),
118
118
  )}">${children}</li>`,
119
119
  [ELEMENT_LIC]: ({ classNames, children, node }) =>
120
120
  `<p class="${classNames} ${getLicElementClassNames(node)}"><span>${children}</span></p>`,
@@ -9,7 +9,7 @@ export const serializeRawToHtmlAsync = async (
9
9
  raw: string,
10
10
  columns: SerializeNodesToHtmlOptions['columns'] = 1,
11
11
  columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',
12
- plugins: PluginComposer = new PluginComposer()
12
+ plugins: PluginComposer = new PluginComposer(),
13
13
  ): Promise<string> => {
14
14
  const nodes = parseRawValue({ raw, plugins });
15
15
  const styles = plugins.getStyles;
@@ -18,7 +18,7 @@ export const serializeRawToHtmlAsync = async (
18
18
 
19
19
  export const serializeNodesToHtml = (
20
20
  nodes: TDescendant[],
21
- { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {}
21
+ { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {},
22
22
  ): string => {
23
23
  const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();
24
24
 
@@ -24,7 +24,7 @@ export const useAttachments = (appBridge: AppBridgeBlock, assetId: string) => {
24
24
 
25
25
  const onAttachmentReplace = async (attachmentToReplace: Asset, newAsset: Asset) => {
26
26
  const newAssetIds = attachments.map((attachment) =>
27
- attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id
27
+ attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id,
28
28
  );
29
29
 
30
30
  await updateAssetIdsFromKey(assetId, newAssetIds);
@@ -16,7 +16,7 @@ export const useDndSensors = (columnGap = 0, rowGap = 0) => {
16
16
  useSensor(KeyboardSensor, {
17
17
  coordinateGetter: customCoordinatesGetter,
18
18
  keyboardCodes,
19
- })
19
+ }),
20
20
  );
21
21
 
22
22
  return sensors;
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import 'tailwindcss/tailwind.css';
3
+ import './styles.css';
4
4
 
5
5
  import type { FC } from 'react';
6
6
  import type { AppBridgeBlock } from '@frontify/app-bridge';
@@ -124,9 +124,9 @@ export const defineSettings = <
124
124
  T extends
125
125
  | BlockSettingsStructureExport
126
126
  | (() => Promise<BlockSettingsStructureExport>)
127
- | (() => BlockSettingsStructureExport)
127
+ | (() => BlockSettingsStructureExport),
128
128
  >(
129
- settingsStructure: T
129
+ settingsStructure: T,
130
130
  ): T => settingsStructure;
131
131
 
132
132
  export * from './components';
@@ -94,7 +94,7 @@ describe('getBackgroundSettings', () => {
94
94
  id: 'Test',
95
95
  defaultValue: true,
96
96
  defaultColor: { red: 0, green: 0, blue: 0, alpha: 1 },
97
- })
97
+ }),
98
98
  ).toEqual({
99
99
  id: 'hasBackgroundTest',
100
100
  label: 'Background',
@@ -41,7 +41,7 @@ describe('getBorderSettings', () => {
41
41
  });
42
42
  expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
43
43
  'id',
44
- 'borderWidth'
44
+ 'borderWidth',
45
45
  );
46
46
  expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty('type', 'input');
47
47
  expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toEqual({
@@ -20,19 +20,19 @@ describe('getBorderRadiusExtendedSettings', () => {
20
20
 
21
21
  expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[0]).toHaveProperty(
22
22
  'id',
23
- 'extendedRadiusTopLeft'
23
+ 'extendedRadiusTopLeft',
24
24
  );
25
25
  expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
26
26
  'id',
27
- 'extendedRadiusTopRight'
27
+ 'extendedRadiusTopRight',
28
28
  );
29
29
  expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toHaveProperty(
30
30
  'id',
31
- 'extendedRadiusBottomLeft'
31
+ 'extendedRadiusBottomLeft',
32
32
  );
33
33
  expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[3]).toHaveProperty(
34
34
  'id',
35
- 'extendedRadiusBottomRight'
35
+ 'extendedRadiusBottomRight',
36
36
  );
37
37
  expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('id', 'extendedRadiusChoice');
38
38
  expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
@@ -20,19 +20,19 @@ describe('getMarginExtendedSettings', () => {
20
20
 
21
21
  expect((extendedMarginSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[0]).toHaveProperty(
22
22
  'id',
23
- 'extendedMarginTop'
23
+ 'extendedMarginTop',
24
24
  );
25
25
  expect((extendedMarginSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
26
26
  'id',
27
- 'extendedMarginLeft'
27
+ 'extendedMarginLeft',
28
28
  );
29
29
  expect((extendedMarginSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toHaveProperty(
30
30
  'id',
31
- 'extendedMarginRight'
31
+ 'extendedMarginRight',
32
32
  );
33
33
  expect((extendedMarginSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[3]).toHaveProperty(
34
34
  'id',
35
- 'extendedMarginBottom'
35
+ 'extendedMarginBottom',
36
36
  );
37
37
  expect(extendedMarginSettings.off?.[0]).toHaveProperty('id', 'extendedMarginChoice');
38
38
  expect(extendedMarginSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
@@ -20,19 +20,19 @@ describe('getPaddingExtendedSettings', () => {
20
20
 
21
21
  expect((extendedPaddingSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[0]).toHaveProperty(
22
22
  'id',
23
- 'extendedPaddingTop'
23
+ 'extendedPaddingTop',
24
24
  );
25
25
  expect((extendedPaddingSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
26
26
  'id',
27
- 'extendedPaddingLeft'
27
+ 'extendedPaddingLeft',
28
28
  );
29
29
  expect((extendedPaddingSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toHaveProperty(
30
30
  'id',
31
- 'extendedPaddingRight'
31
+ 'extendedPaddingRight',
32
32
  );
33
33
  expect((extendedPaddingSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[3]).toHaveProperty(
34
34
  'id',
35
- 'extendedPaddingBottom'
35
+ 'extendedPaddingBottom',
36
36
  );
37
37
  expect(extendedPaddingSettings.off?.[0]).toHaveProperty('id', 'extendedPaddingChoice');
38
38
  expect(extendedPaddingSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
package/src/styles.css ADDED
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -11,7 +11,7 @@ import { toRgbaString } from '../color';
11
11
  export const getBorderStyles = (
12
12
  style = BorderStyle.Solid,
13
13
  borderWidth = '1px',
14
- color = BORDER_COLOR_DEFAULT_VALUE as Color
14
+ color = BORDER_COLOR_DEFAULT_VALUE as Color,
15
15
  ): CSSProperties => {
16
16
  return {
17
17
  borderStyle: borderStyleMap[style],