@makeswift/runtime 0.9.9 → 0.9.11

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 (174) hide show
  1. package/dist/PreviewProvider.es.js +2 -2
  2. package/dist/ReadOnlyText.es.js +1 -1
  3. package/dist/ReadOnlyTextV2.cjs.js +3 -1
  4. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  5. package/dist/ReadOnlyTextV2.es.js +4 -2
  6. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  7. package/dist/api.cjs.js +19 -0
  8. package/dist/api.cjs.js.map +1 -1
  9. package/dist/api.es.js +19 -0
  10. package/dist/api.es.js.map +1 -1
  11. package/dist/controls.cjs.js +2 -0
  12. package/dist/controls.cjs.js.map +1 -1
  13. package/dist/controls.es.js +1 -1
  14. package/dist/index.cjs.js +127 -32
  15. package/dist/index.cjs.js.map +1 -1
  16. package/dist/index.cjs10.js +6 -2
  17. package/dist/index.cjs10.js.map +1 -1
  18. package/dist/index.cjs5.js +30 -75
  19. package/dist/index.cjs5.js.map +1 -1
  20. package/dist/index.cjs9.js +4 -1
  21. package/dist/index.cjs9.js.map +1 -1
  22. package/dist/index.es.js +128 -33
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/index.es10.js +8 -4
  25. package/dist/index.es10.js.map +1 -1
  26. package/dist/index.es5.js +31 -73
  27. package/dist/index.es5.js.map +1 -1
  28. package/dist/index.es6.js +1 -1
  29. package/dist/index.es9.js +5 -2
  30. package/dist/index.es9.js.map +1 -1
  31. package/dist/react-page.cjs.js +37 -17
  32. package/dist/react-page.cjs.js.map +1 -1
  33. package/dist/react-page.es.js +36 -18
  34. package/dist/react-page.es.js.map +1 -1
  35. package/dist/slate.cjs.js +69 -6
  36. package/dist/slate.cjs.js.map +1 -1
  37. package/dist/slate.es.js +69 -7
  38. package/dist/slate.es.js.map +1 -1
  39. package/dist/types/src/api/graphql/documents/fragments.d.ts +1 -0
  40. package/dist/types/src/api/graphql/documents/fragments.d.ts.map +1 -1
  41. package/dist/types/src/api/graphql/documents/queries.d.ts +1 -0
  42. package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
  43. package/dist/types/src/api/graphql/generated/fragment-document-nodes.d.ts +1 -0
  44. package/dist/types/src/api/graphql/generated/fragment-document-nodes.d.ts.map +1 -1
  45. package/dist/types/src/api/graphql/generated/types.d.ts +17 -0
  46. package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
  47. package/dist/types/src/api/graphql/types.d.ts +3 -3
  48. package/dist/types/src/api/graphql/types.d.ts.map +1 -1
  49. package/dist/types/src/api/react.d.ts +14 -3
  50. package/dist/types/src/api/react.d.ts.map +1 -1
  51. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -39
  52. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  53. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  54. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  55. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +0 -1
  56. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
  57. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +2 -2
  58. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  59. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +0 -1
  60. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  61. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +0 -1
  62. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
  63. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
  64. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  65. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +0 -1
  66. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  67. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
  68. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  69. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +0 -1
  70. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  71. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +0 -1
  72. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  73. package/dist/types/src/components/builtin/SocialLinks/options.d.ts +23 -24
  74. package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -1
  75. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -2
  76. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  77. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -2
  78. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  79. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +1 -2
  80. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
  81. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -2
  82. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  83. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -2
  84. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  85. package/dist/types/src/components/page/Page.d.ts +0 -1
  86. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  87. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +0 -1
  88. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  89. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +0 -1
  90. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  91. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  92. package/dist/types/src/components/shared/GutterContainer/index.d.ts +1 -1
  93. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  94. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  95. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  96. package/dist/types/src/components/shared/grid-item.d.ts +1 -1
  97. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  98. package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts +3 -0
  99. package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -0
  100. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  101. package/dist/types/src/controls/rich-text-v2/index.d.ts +1 -0
  102. package/dist/types/src/controls/rich-text-v2/index.d.ts.map +1 -1
  103. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -11
  104. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  105. package/dist/types/src/controls/rich-text-v2/translation.d.ts +5 -0
  106. package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -0
  107. package/dist/types/src/controls/typography.d.ts +2 -2
  108. package/dist/types/src/controls/typography.d.ts.map +1 -1
  109. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  110. package/dist/types/src/next/client.d.ts +7 -2
  111. package/dist/types/src/next/client.d.ts.map +1 -1
  112. package/dist/types/src/next/document.d.ts +1 -2
  113. package/dist/types/src/next/document.d.ts.map +1 -1
  114. package/dist/types/src/next/index.d.ts +1 -1
  115. package/dist/types/src/next/index.d.ts.map +1 -1
  116. package/dist/types/src/next/preview-mode.d.ts +1 -2
  117. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  118. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  119. package/dist/types/src/runtimes/react/components/render-hook.d.ts +0 -1
  120. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  121. package/dist/types/src/runtimes/react/controls/control.d.ts +0 -1
  122. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  123. package/dist/types/src/runtimes/react/controls/list.d.ts +0 -1
  124. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  125. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -2
  126. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  127. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +1 -2
  128. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  129. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +1 -2
  130. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  131. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +2 -2
  132. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  133. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  134. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  135. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +1 -1
  136. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  137. package/dist/types/src/runtimes/react/controls/shape.d.ts +0 -1
  138. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  139. package/dist/types/src/runtimes/react/controls/slot.d.ts +2 -2
  140. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  141. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +0 -1
  142. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -1
  143. package/dist/types/src/runtimes/react/controls/typography.d.ts +5 -5
  144. package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -1
  145. package/dist/types/src/runtimes/react/controls.d.ts +0 -1
  146. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  147. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  148. package/dist/types/src/runtimes/react/hooks/makeswift-api.d.ts +2 -1
  149. package/dist/types/src/runtimes/react/hooks/makeswift-api.d.ts.map +1 -1
  150. package/dist/types/src/runtimes/react/index.d.ts +1 -1
  151. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  152. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  153. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
  154. package/dist/types/src/slate/TypographyPlugin/getValue.d.ts +1 -1
  155. package/dist/types/src/slate/TypographyPlugin/getValue.d.ts.map +1 -1
  156. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  157. package/dist/types/src/slate/utils/responsive.d.ts +1 -1
  158. package/dist/types/src/slate/utils/responsive.d.ts.map +1 -1
  159. package/dist/types/src/state/makeswift-api-client.d.ts +1 -1
  160. package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
  161. package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
  162. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  163. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  164. package/dist/types.cjs.js +1 -0
  165. package/dist/types.cjs.js.map +1 -1
  166. package/dist/types.cjs2.js +1 -5
  167. package/dist/types.cjs2.js.map +1 -1
  168. package/dist/types.es.js +1 -0
  169. package/dist/types.es.js.map +1 -1
  170. package/dist/types.es2.js +2 -6
  171. package/dist/types.es2.js.map +1 -1
  172. package/dist/typography.cjs.js.map +1 -1
  173. package/dist/typography.es.js.map +1 -1
  174. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"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AAkB,CAChC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,SAAS,GAC9C,sBAAsB,CAMxB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import * as ReactPage from '../../state/react-page';
3
2
  import { BorderDescriptor, BorderPropControllerFormat, BorderRadiusDescriptor, BorderRadiusPropControllerFormat, BorderRadiusValue, BorderValue, Descriptor, MarginDescriptor, MarginPropControllerFormat, MarginValue, PaddingDescriptor, PaddingPropControllerFormat, PaddingValue, ResolveOptions, ResponsiveValue, ShadowsDescriptor, ShadowsPropControllerFormat, ShadowsValue, WidthPropControllerFormat, WidthDescriptor, WidthValue } from '../../prop-controllers/descriptors';
4
3
  import type { ColorValue } from '../../components/utils/types';
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/controls.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,gCAAgC,EAChC,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,WAAW,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,UAAU,EACX,MAAM,oCAAoC,CAAA;AAM3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAyC9D,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;AAMzD,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS,eAAe,GAClF,SAAS,SAAS,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GACtD,UAAU,GAAG,SAAS,GACtB,cAAc,CAA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gB,GACpF,SAAS,SAAS,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GACtD,WAAW,GAAG,SAAS,GACvB,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,OAAO,0BAA0B,CAAC,SAAS,GAC1F,MAAM,GACN,cAAc,CACZ,CAAC,CAAC,SAAS,CAAC,CACb,CAAC,QAAQ,CAAC,SAAS,OAAO,0BAA0B,CAAC,eAAe,GACrE,WAAW,GAAG,SAAS,GACvB,KAAK,GACP,KAAK,CAAA;AAET,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,WAAW,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CAAA;CACtD,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAyN9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"find-dom-node.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/find-dom-node.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,SAAS,EAAE,MAAM,OAAO,CAAA;AAyC5C,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,WAAW,mGAAoB,OAAO,GAAG,IAAI,GAAG,IAAI,EAQhE,CAAA"}
1
+ {"version":3,"file":"find-dom-node.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/find-dom-node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAIV,MAAM,OAAO,CAAA;AA0Cd,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,WAAW,mGAAoB,OAAO,GAAG,IAAI,GAAG,IAAI,EAQhE,CAAA"}
@@ -1,10 +1,11 @@
1
- import { File, GlobalElement, PagePathnameSlice, Swatch, Table, Typography } from '../../../api';
1
+ import { File, GlobalElement, LocalizedGlobalElement, PagePathnameSlice, Swatch, Table, Typography } from '../../../api';
2
2
  export declare function useSwatch(swatchId: string | null): Swatch | null;
3
3
  export declare function useSwatches(swatchIds: string[]): (Swatch | null)[];
4
4
  export declare function useFile(fileId: string | null): File | null;
5
5
  export declare function useFiles(fileIds: string[]): (File | null)[];
6
6
  export declare function useTypography(typographyId: string | null): Typography | null;
7
7
  export declare function useGlobalElement(globalElementId: string | null): GlobalElement | null;
8
+ export declare function useLocalizedGlobalElement(globalElementId: string | null): LocalizedGlobalElement | null;
8
9
  export declare function usePagePathnameSlice(pageId: string | null): PagePathnameSlice | null;
9
10
  export declare function useTable(tableId: string | null): Table | null;
10
11
  //# sourceMappingURL=makeswift-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeswift-api.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/hooks/makeswift-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGhG,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAUhE;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAyBlE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAU1D;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAyB3D;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,G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AI,CAcpF;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAU7D"}
@@ -53,7 +53,7 @@ type PageProviderProps = {
53
53
  id: string;
54
54
  children: ComponentPropsWithoutRef<typeof PageContext['Provider']>['children'];
55
55
  };
56
- export declare function PageProvider({ id, children }: PageProviderProps): JSX.Element;
56
+ export declare function PageProvider({ id, children }: PageProviderProps): import("react/jsx-runtime").JSX.Element;
57
57
  export declare function useDocumentKey(): string | null;
58
58
  type State = ReactPage.State | ReactBuilderPreview.State;
59
59
  export declare function useStore(): ReactPage.Store;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,wBAAwB,EAIxB,SAAS,EASV,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,KAAK,mBAAmB,MAAM,mCAAmC,CAAA;AAO7E,OAAO,KAAK,EACV,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EACL,WAAW,EACX,gBAAgB,EAEjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAA;AAE7E,qBAAa,YAAY;IAIvB,MAAM,CAAC,KAAK,kBAA6B;IACzC,MAAM,CAAC,iBAAiB,CACtB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,EAClD,CAAC,SAAS,SAAS,CAAC,aAAa,CAAC;SAAG,CAAC,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AI,OAAO,CAExC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAsHD,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,OAAO,iMAgDnB,CAAA;AAmBD,KAAK,sBAAsB,GAAG;IAC5B,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,iBAAiB,2MAa7B,CAAA"}
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { Editor } from 'slate';
3
- export declare const withTextAlign: (editor: Editor) => import("..").MakeswiftEditor;
3
+ export declare const withTextAlign: (editor: Editor) => import("../types").MakeswiftEditor;
4
4
  export declare function TextAlignPlugin(): {
5
5
  control: import("../../controls").RichTextV2PluginControlDefinition<import("../../controls").StyleV2ControlDefinition> | undefined;
6
- withPlugin: ((editor: import("..").MakeswiftEditor) => import("..").MakeswiftEditor) | undefined;
7
- onKeyDown: ((event: import("react").KeyboardEvent<globalThis.Element>, editor: import("..").MakeswiftEditor) => void) | undefined;
6
+ withPlugin: ((editor: import("../types").MakeswiftEditor) => import("../types").MakeswiftEditor) | undefined;
7
+ onKeyDown: ((event: import("react").KeyboardEvent<globalThis.Element>, editor: import("../types").MakeswiftEditor) => void) | undefined;
8
8
  renderElement: ((renderElement: import("../../controls").RenderElement, value: any) => (props: import("slate-react").RenderElementProps) => JSX.Element) | undefined;
9
9
  renderLeaf: ((renderLeaf: import("../../controls").RenderLeaf, value: any) => (props: import("slate-react").RenderLeafProps) => JSX.Element) | undefined;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TextAlignPlugin/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,OAAO,CAAA;AAcvC,eAAO,MAAM,aAAa,WAAY,MAAM,iCAY3C,CAAA;AAED,wBAAgB,eAAe;;;;;;EAuD9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TextAlignPlugin/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAA;AAelD,eAAO,MAAM,aAAa,WAAY,MAAM,uCAc3C,CAAA;AAED,wBAAgB,eAAe;;;;;;EAuD9B"}
@@ -1,4 +1,4 @@
1
1
  import { Editor } from 'slate';
2
2
  import { RichTextTypography } from '../types';
3
- export declare function getValue(editor: Editor): RichTextTypography | null | undefined;
3
+ export declare function getValue(editor: Editor): (RichTextTypography | undefined)[];
4
4
  //# sourceMappingURL=getValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getValue.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/getValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAI7C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,yCAetC"}
1
+ {"version":3,"file":"getValue.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/getValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,sCAStC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAKrE,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAA;AAED,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,gCAsB5C;AAED,wBAAgB,gBAAgB;;;;;;EA0B/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAc,MAAM,EAA+B,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAKrE,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAA;AAED,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,gCAsB5C;AAED,wBAAgB,gBAAgB;;;;;;EAmE/B"}
@@ -8,7 +8,7 @@ export declare function setResponsiveValue<T extends Descendant, K extends keyof
8
8
  type NormalizeResponsiveValueOptions<T extends Descendant> = {
9
9
  match: NodeMatch<T>;
10
10
  };
11
- export declare function normalizeResponsiveValue<T extends Descendant, K extends keyof T & string>(editor: Editor, key: K, options: NormalizeResponsiveValueOptions<T>): (entry: NodeEntry) => boolean;
11
+ export declare function normalizeResponsiveValue<T extends Descendant, K extends keyof T & string>(editor: Editor, key: K, options: NormalizeResponsiveValueOptions<T>): (entry: NodeEntry<T>) => boolean;
12
12
  export declare function responsiveShallowEqual<T>(a?: ResponsiveValue<T>, b?: ResponsiveValue<T>): ResponsiveValue<T>;
13
13
  export {};
14
14
  //# sourceMappingURL=responsive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../../../src/slate/utils/responsive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAIxD,KAAK,yBAAyB,CAAC,CAAC,SAAS,UAAU,IAAI;IACrD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,CAAC,EACxE,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EAC9B,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,QA0CtC;AAED,KAAK,+BAA+B,CAAC,CAAC,SAAS,UAAU,IAAI;IAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CACpB,CAAA;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACvF,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,+BAA+B,CAAC,CAAC,CAAC,iCAuB5C;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,CAAC,GAAE,eAAe,CAAC,CAAC,CAAM,EAC1B,CAAC,GAAE,eAAe,CAAC,CAAC,CAAM,GACzB,eAAe,CAAC,CAAC,CAAC,CA0BpB"}
1
+ {"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../../../src/slate/utils/responsive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAIxD,KAAK,yBAAyB,CAAC,CAAC,SAAS,UAAU,IAAI;IACrD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,CAAC,EACxE,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EAC9B,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,QA0CtC;AAED,KAAK,+BAA+B,CAAC,CAAC,SAAS,UAAU,IAAI;IAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CACpB,CAAA;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACvF,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,+BAA+B,CAAC,CAAC,CAAC,oCAuB5C;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,CAAC,GAAE,eAAe,CAAC,CAAC,CAAM,EAC1B,CAAC,GAAE,eAAe,CAAC,CAAC,CAAM,GACzB,eAAe,CAAC,CAAC,CAAC,CA0BpB"}
@@ -12,7 +12,7 @@ export declare function getAPIResource<T extends APIResourceType>(state: State,
12
12
  __typename: T;
13
13
  }> | null;
14
14
  type Thunk<ReturnType> = ThunkAction<ReturnType, State, unknown, Action>;
15
- export declare function fetchAPIResource<T extends APIResourceType>(resourceType: T, resourceId: string): Thunk<Promise<Extract<APIResource, {
15
+ export declare function fetchAPIResource<T extends APIResourceType>(resourceType: T, resourceId: string, locale?: Intl.Locale): Thunk<Promise<Extract<APIResource, {
16
16
  __typename: T;
17
17
  }> | null>>;
18
18
  export type Dispatch = ThunkDispatch<State, unknown, Action>;
@@ -1 +1 @@
1
- {"version":3,"file":"makeswift-api-client.d.ts","sourceRoot":"","sources":["../../../../src/state/makeswift-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,IAAI,UAAU,EAAE,MAAM,OAAO,CAAA;AACzE,OAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/D,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAwB,MAAM,WAAW,CAAA;AACxD,OAAO,EACL,WAAW,EACX,eAAe,EAOhB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,OAAO,6BAAuB,CAAA;AAEpC,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,eAAe,CAAA;AAE1D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAEhE;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,eAAe,EAC7B,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,eAAe,EACtD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAEhD;AAED,KAAK,KAAK,CAAC,UAAU,IAAI,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAoBxE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,GAAG,IAAI,CAAA;KACxD,EAAE;CACJ,CAAA;AAED,wBAAgB,eAAe,CAC7B,eAAe,GAAE,eAWhB,GACA,KAAK,CAOP;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CA2BhE;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,eAAe,EAC7B,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,eAAe,EACtD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAMhD;AAED,wBAAgB,OAAO,CAAC,KAAK,mBAA2B,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CA4C/E"}
@@ -1,8 +1,8 @@
1
- import type { Component, PropsWithoutRef, ReactElement, RefAttributes } from 'react';
1
+ import type { Component, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
2
2
  import { Action } from '../actions';
3
3
  export type ComponentType<P = Record<string, any>, T = any> = {
4
4
  new (props: PropsWithoutRef<P> & RefAttributes<T>, context?: any): Component<P>;
5
- } | ((props: PropsWithoutRef<P> & RefAttributes<T>, context?: any) => ReactElement<any, any> | null);
5
+ } | ((props: PropsWithoutRef<P> & RefAttributes<T>, context?: any) => ReactNode);
6
6
  export type State = Map<string, ComponentType>;
7
7
  export declare function getInitialState({ reactComponents, }?: {
8
8
  reactComponents?: Map<string, ComponentType>;
@@ -1 +1 @@
1
- {"version":3,"file":"react-components.d.ts","sourceRoot":"","sources":["../../../../../src/state/modules/react-components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAEpF,OAAO,EAAE,MAAM,EAAe,MAAM,YAA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Aa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;CAAE,GACnF,CAAC,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,CAAA;AAEhF,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAE9C,wBAAgB,eAAe,CAAC,EAC9B,eAA2B,GAC5B,GAAE;IAAE,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CAAO,GAAG,KAAK,CAE/D;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAElF;AAED,wBAAgB,OAAO,CAAC,KAAK,mBAA2B,EAAE,MAAM,EAAE,MAAM,SAgBvE"}
package/dist/types.cjs.js CHANGED
@@ -5,6 +5,7 @@ const APIResourceType = {
5
5
  Typography: "Typography",
6
6
  PagePathnameSlice: "PagePathnameSlice",
7
7
  GlobalElement: "GlobalElement",
8
+ LocalizedGlobalElement: "LocalizedGlobalElement",
8
9
  Table: "Table",
9
10
  Snippet: "Snippet",
10
11
  Page: "Page",
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs.js","sources":["../src/api/graphql/types.ts"],"sourcesContent":["import {\n SwatchFragment as Swatch,\n FileFragment as File,\n TypographyFragment as Typography,\n PagePathnameSliceFragment as PagePathnameSlice,\n GlobalElementFragment as GlobalElement,\n TableFragment as Table,\n SnippetFragment as Snippet,\n PageFragment as Page,\n SiteFragment as Site,\n} from './generated/types'\n\nexport type {\n Swatch,\n File,\n Typography,\n PagePathnameSlice,\n GlobalElement,\n Table,\n Snippet,\n Page,\n Site,\n}\n\nexport type APIResource =\n | Swatch\n | File\n | Typography\n | PagePathnameSlice\n | GlobalElement\n | Table\n | Snippet\n | Page\n | Site\n\nexport const APIResourceType: { [R in APIResource as R['__typename']]: R['__typename'] } = {\n Swatch: 'Swatch',\n File: 'File',\n Typography: 'Typography',\n PagePathnameSlice: 'PagePathnameSlice',\n GlobalElement: 'GlobalElement',\n Table: 'Table',\n Snippet: 'Snippet',\n Page: 'Page',\n Site: 'Site',\n}\n\nexport type APIResourceType = typeof APIResourceType[keyof typeof APIResourceType]\n"],"names":[],"mappings":";AAmCO,MAAM,kBAA8E;AAAA,EACzF,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;;"}
1
+ {"version":3,"file":"types.cjs.js","sources":["../src/api/graphql/types.ts"],"sourcesContent":["import {\n SwatchFragment as Swatch,\n FileFragment as File,\n TypographyFragment as Typography,\n PagePathnameSliceFragment as PagePathnameSlice,\n GlobalElementFragment as GlobalElement,\n LocalizedGlobalElementFragment as LocalizedGlobalElement,\n TableFragment as Table,\n SnippetFragment as Snippet,\n PageFragment as Page,\n SiteFragment as Site,\n} from './generated/types'\n\nexport type {\n Swatch,\n File,\n Typography,\n PagePathnameSlice,\n GlobalElement,\n LocalizedGlobalElement,\n Table,\n Snippet,\n Page,\n Site,\n}\n\nexport type APIResource =\n | Swatch\n | File\n | Typography\n | PagePathnameSlice\n | GlobalElement\n | LocalizedGlobalElement\n | Table\n | Snippet\n | Page\n | Site\n\nexport const APIResourceType: { [R in APIResource as R['__typename']]: R['__typename'] } = {\n Swatch: 'Swatch',\n File: 'File',\n Typography: 'Typography',\n PagePathnameSlice: 'PagePathnameSlice',\n GlobalElement: 'GlobalElement',\n LocalizedGlobalElement: 'LocalizedGlobalElement',\n Table: 'Table',\n Snippet: 'Snippet',\n Page: 'Page',\n Site: 'Site',\n}\n\nexport type APIResourceType = typeof APIResourceType[keyof typeof APIResourceType]\n"],"names":[],"mappings":";AAsCO,MAAM,kBAA8E;AAAA,EACzF,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;;"}
@@ -635,6 +635,7 @@ function BlockPluginComponent({
635
635
  className: css.cx(...blockStyles),
636
636
  children
637
637
  }));
638
+ case reactPage.BlockType.Default:
638
639
  case reactPage.BlockType.Paragraph:
639
640
  return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, attributes), {
640
641
  className: css.cx(...blockStyles),
@@ -695,11 +696,6 @@ function BlockPluginComponent({
695
696
  className: css.cx(...blockStyles),
696
697
  children
697
698
  }));
698
- case reactPage.BlockType.Default:
699
- return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, attributes), {
700
- className: css.cx(...blockStyles),
701
- children
702
- }));
703
699
  default:
704
700
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
705
701
  children: renderElement({
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs2.js","sources":["../src/slate/utils/element.ts","../src/slate/utils/unhangRange.ts","../src/slate/selectors.ts","../src/slate/BlockPlugin/setBlockKeyForDevice.ts","../src/slate/BlockPlugin/clearBlockKeyForDevice.ts","../src/slate/BlockPlugin/wrapInline.ts","../src/slate/BlockPlugin/unwrapInline.ts","../src/slate/utils/editor.ts","../src/slate/BlockPlugin/constants.ts","../src/slate/BlockPlugin/utils/filterForSubtreeRoots.ts","../src/slate/BlockPlugin/unwrapList.ts","../src/slate/BlockPlugin/wrapList.ts","../src/slate/BlockPlugin/utils/location.ts","../src/slate/BlockPlugin/utils/getSelectedListItems.ts","../src/slate/BlockPlugin/indent.ts","../src/slate/BlockPlugin/dedent.ts","../src/slate/BlockPlugin/toggleList.ts","../src/slate/BlockPlugin/index.tsx","../src/slate/InlinePlugin/types.ts"],"sourcesContent":["import { Node, Element } from 'slate'\nimport {\n RootBlock,\n BlockType,\n Block,\n Inline,\n InlineType,\n OrderedListElement,\n UnorderedListElement,\n ListItemElement,\n ListItemChildElement,\n} from '../types'\n\nexport const ElementUtils = {\n isRootBlock(node: Node): node is RootBlock {\n return (\n Element.isElement(node) &&\n (Element.isElementType(node, BlockType.Paragraph) ||\n Element.isElementType(node, BlockType.Heading1) ||\n Element.isElementType(node, BlockType.Heading2) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading4) ||\n Element.isElementType(node, BlockType.Heading5) ||\n Element.isElementType(node, BlockType.Heading6) ||\n Element.isElementType(node, BlockType.BlockQuote) ||\n Element.isElementType(node, BlockType.UnorderedList) ||\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.Text) ||\n Element.isElementType(node, BlockType.Default))\n )\n },\n isBlock(node: Node): node is Block {\n return (\n Element.isElement(node) &&\n (this.isRootBlock(node) ||\n Element.isElementType(node, BlockType.ListItem) ||\n Element.isElementType(node, BlockType.ListItemChild))\n )\n },\n isInline(node: Node): node is Inline {\n return (\n Element.isElementType(node, InlineType.Code) ||\n Element.isElementType(node, InlineType.Link) ||\n Element.isElementType(node, InlineType.SubScript) ||\n Element.isElementType(node, InlineType.SuperScript)\n )\n },\n isConvertibleToListTextNode(node: Node) {\n return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node)\n },\n isList(node: Node): node is OrderedListElement | UnorderedListElement {\n return (\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.UnorderedList)\n )\n },\n isListItem(node: Node): node is ListItemElement {\n return Element.isElementType(node, BlockType.ListItem)\n },\n isListItemChild(node: Node): node is ListItemChildElement {\n return Element.isElementType(node, BlockType.ListItemChild)\n },\n createText() {\n return { text: '' }\n },\n createParagraph() {\n return {\n children: [this.createText()],\n type: BlockType.Paragraph,\n }\n },\n createList(type: BlockType = BlockType.UnorderedList): Block {\n return { children: [this.createText()], type }\n },\n createListItem(): Block {\n return {\n children: [this.createListItemChild()],\n type: BlockType.ListItem,\n }\n },\n createListItemChild(): Block {\n return {\n children: [this.createText()],\n type: BlockType.ListItemChild,\n }\n },\n}\n","import { Editor, Range, Element, Text, Path } from 'slate'\n\n/**\n * The `Editor.unhangeRange` within Slate early exits if `Path.hasPrevious(end.path)` ie if this isn't a root block.\n * Unfortunately when you `setNode(..., {split:true})` or `wrapNodes()` you also have a hanging selection, but not in the root position.\n *\n * This c/p removes the `Path.hasPrevious(end.path)` from the early exit but it the same otherwise\n */\nfunction unhangRange(editor: Editor, range: Range): Range {\n // eslint-disable-next-line prefer-const\n let [start, end] = Range.edges(range)\n // PERF: exit early if we can guarantee that the range isn't hanging.\n if (start.offset !== 0 || end.offset !== 0 || Range.isCollapsed(range)) {\n return range\n }\n\n const endBlock = Editor.above(editor, {\n at: end,\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n })\n const blockPath = endBlock ? endBlock[1] : []\n const first = Editor.start(editor, start)\n const before = { anchor: first, focus: end }\n let skip = true\n\n for (const [node, path] of Editor.nodes(editor, {\n at: before,\n match: Text.isText,\n reverse: true,\n })) {\n if (skip) {\n skip = false\n continue\n }\n\n if (node.text !== '' || Path.isBefore(path, blockPath)) {\n end = { path, offset: node.text.length }\n break\n }\n }\n\n return { anchor: start, focus: end }\n}\n\nexport default unhangRange\n","import { Editor, NodeEntry, Range, Text } from 'slate'\nimport { EditableBlockKey } from './BlockPlugin/types'\nimport { ElementUtils } from './utils/element'\n\nimport unhangRange from './utils/unhangRange'\nimport shallowEqual from '../utils/shallowEqual'\nimport { isNonNullable } from '../utils/isNonNullable'\n\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../state/modules/breakpoints'\nimport deepEqual from '../utils/deepEqual'\nimport keys from '../utils/keys'\nimport {\n RootBlock,\n Inline,\n RootBlockType,\n ResponsiveBlockTextAlignment,\n BlockTextAlignment,\n RichTextTypography,\n} from './types'\n\nexport function getSelection(editor: Editor): Range {\n if (editor.selection) return unhangRange(editor, editor.selection)\n return {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n }\n}\n\nexport function getBlocksInSelection(editor: Editor): NodeEntry<RootBlock>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isRootBlock(node),\n }),\n ).filter((entry): entry is NodeEntry<RootBlock> => ElementUtils.isRootBlock(entry[0]))\n}\n\nexport function getInlinesInSelection(editor: Editor): NodeEntry<Inline>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isInline(node),\n }),\n ).filter((entry): entry is NodeEntry<Inline> => ElementUtils.isInline(entry[0]))\n}\n\nexport function getActiveBlockType(editor: Editor): RootBlockType | null {\n const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type)\n\n return rootBlocks.reduce<RootBlockType | null>(\n (a, b) => (a === b ? b : null),\n rootBlocks.at(0) ?? null,\n )\n}\n\nexport function getActiveBlockValue(editor: Editor, key: EditableBlockKey) {\n const blocks = getBlocksInSelection(editor)\n\n const active = blocks.map(\n ([block]) => block[key] ?? null,\n ) as (ResponsiveBlockTextAlignment | null)[]\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\nexport function getActiveBlockDeviceOverrideValue(\n editor: Editor,\n key: EditableBlockKey,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n) {\n const active: (BlockTextAlignment | null)[] = []\n const blocks = getBlocksInSelection(editor)\n\n blocks.forEach(([block]) => {\n const deviceOverride =\n findBreakpointOverride<BlockTextAlignment>(breakpoints, block[key], deviceId) || null\n active.push(deviceOverride?.value ?? null)\n })\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\n// Typography\n\nconst concat = (a: unknown[], b: unknown[]) => a.concat(b)\n\n// TODO: This is more cruft from trying to remove null from the typography type. This optimization is not worth it.\n/**\n * This is a c/p of the intersection of the utils from the root utils folder.\n * The only change is defaulting to undefined instead of to null.\n */\nexport default function intersection<A extends Record<string, unknown>, B extends A>(\n a: A,\n b: B,\n isEqual: (a: unknown, b: unknown) => boolean = deepEqual,\n): { [K in keyof A]: A[K] | undefined } {\n const allKeys = [...new Set([...keys(a), ...keys(b)])] as (keyof A)[]\n\n return allKeys.reduce((acc, k) => {\n if (isEqual(a[k], b[k])) acc[k] = a[k]\n else acc[k] = undefined\n\n return acc\n }, {} as { [K in keyof A]: A[K] | undefined })\n}\n\nconst fuseTypographyMarks = (\n values: Array<RichTextTypography | null | undefined>,\n breakpoints: Breakpoints,\n): RichTextTypography => {\n const devices = [\n ...new Set(\n values\n .filter(isNonNullable)\n .map(({ style }) => style.map(({ deviceId }) => deviceId))\n .reduce(concat, []),\n ),\n ] as BreakpointId[]\n\n return {\n id: values.map(v => v && v.id).reduce((a, b) => (a === b ? a : undefined)) ?? undefined,\n style: devices.map(deviceId =>\n values\n .map(\n v =>\n (v && findBreakpointOverride(breakpoints, v.style, deviceId)) || {\n deviceId,\n value: {},\n },\n )\n .reduce((acc, { value }) => {\n const a = intersection(acc.value, value)\n return {\n deviceId,\n value: a,\n }\n }),\n ),\n }\n}\n\nexport function getActiveTypographyMark(\n editor: Editor,\n breakpoints: Breakpoints,\n): RichTextTypography {\n const active: RichTextTypography[] = []\n\n const textNodes = Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => Text.isText(node),\n })\n\n for (const [node] of textNodes) {\n if (Text.isText(node) && 'typography' in node && node.typography != undefined) {\n active.push(node.typography)\n }\n }\n return active.length === 0 ? { style: [] } : fuseTypographyMarks(active, breakpoints)\n}\n","import { Editor, Transforms, Location } from 'slate'\nimport { getBlocksInSelection } from '../selectors'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey, EditableBlockValue } from './types'\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../../state/modules/breakpoints'\n\ntype SetBlockKeyForDeviceOptions = {\n at?: Location\n}\n\nexport function setBlockKeyForDevice(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n value: EditableBlockValue[number]['value'],\n options?: SetBlockKeyForDeviceOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceValues = node[key] ?? []\n const currentDeviceValue = findBreakpointOverride(breakpoints, deviceValues, deviceId, v => v)\n const nextDeviceValue = {\n ...currentDeviceValue,\n deviceId,\n value,\n }\n Transforms.setNodes(\n editor,\n {\n [key]: [...deviceValues.filter(v => v.deviceId !== deviceId), nextDeviceValue],\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey } from './types'\nimport { getBlocksInSelection } from '../selectors'\nimport { BreakpointId } from '../../state/modules/breakpoints'\n\nexport function clearBlockKeyForDevice(\n editor: Editor,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n) {\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceOverrides = node[key] ?? []\n Transforms.setNodes(\n editor,\n {\n [key]: deviceOverrides.filter(v => v.deviceId !== deviceId),\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { getSelection } from '../selectors'\nimport { Inline } from '../types'\n\nexport function wrapInline(editor: Editor, inline: Inline) {\n Transforms.wrapNodes(editor, inline, {\n at: getSelection(editor),\n split: true,\n })\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { getSelection } from '../selectors'\nimport { InlineType } from '../types'\n\nexport function unwrapInline(editor: Editor, type: InlineType) {\n Transforms.unwrapNodes(editor, {\n match: node => ElementUtils.isInline(node) && node.type === type,\n at: getSelection(editor),\n })\n}\n","import { Path, Editor, NodeEntry } from 'slate'\n\nimport { ElementUtils } from './element'\nimport { ListElement, ListItemElement } from '../types'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n try {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n } catch (e) {\n return null\n }\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\n try {\n const parentListItem = Editor.above(editor, {\n at: path,\n match: (node): node is ListItemElement => ElementUtils.isListItem(node),\n })\n\n return parentListItem ?? null\n } catch (e) {\n return null\n }\n },\n}\n","export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import type { Node, NodeEntry } from 'slate'\nimport { Path } from 'slate'\n\nexport function filterForSubtreeRoots(entries: NodeEntry<Node>[]): NodeEntry<Node>[] {\n return entries.filter(\n ([, nodePath]) =>\n !Path.ancestors(nodePath).some(ancestor => {\n return entries.some(([, path]) => Path.equals(path, ancestor))\n }),\n )\n}\n","import { Editor, Element, Transforms, Path, Node, Location, Span } from 'slate'\nimport { EditorUtils } from '../utils/editor'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../types'\n\nexport function unwrapPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n //if this is a nested item we don't want to unwrap it\n if (!parentList || listItemContainingParentList) return\n\n Editor.withoutNormalizing(editor, () => {\n const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION]\n const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION]\n\n if (Node.has(editor, listItemNestedListPath)) {\n Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: Path.next(listItemPath) })\n }\n\n if (Node.has(editor, listItemTextPath)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.Paragraph },\n {\n at: listItemTextPath,\n },\n )\n Transforms.liftNodes(editor, { at: listItemTextPath })\n Transforms.liftNodes(editor, { at: listItemPath })\n }\n })\n}\n\ntype UnwrapListOptions = {\n at?: Location | Span\n}\n\nexport function unwrapList(editor: Editor, options?: UnwrapListOptions) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const listItems = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isListItem(node)\n },\n }),\n )\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Element, Location, Span, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../types'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location | Span\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (!at) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node)\n },\n }),\n )\n\n const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n const path = ref.current\n if (path) {\n Editor.withoutNormalizing(editor, () => {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: path,\n },\n )\n Transforms.wrapNodes(editor, ElementUtils.createListItem(), {\n match: node => ElementUtils.isListItemChild(node),\n at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","import { Range, Point, Path, Location } from 'slate'\n\nexport const LocationUtils = {\n getStartPath(location: Location): Path {\n if (Range.isRange(location)) return Range.start(location).path\n if (Point.isPoint(location)) return location.path\n return location\n },\n}\n","import type { Element, NodeEntry } from 'slate'\nimport { Editor, Path } from 'slate'\nimport { EditorUtils } from '../../utils/editor'\nimport { ElementUtils } from '../../utils/element'\nimport { LocationUtils } from './location'\n\nexport function getSelectedListItems(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const listItems = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isListItem(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorListItem(editor, start)?.[1] ?? []\n\n return Array.from(listItems).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function indentPath(editor: Editor, path: Path) {\n const parent = Node.parent(editor, path)\n if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent)) return\n\n const previosPath = Path.previous(path)\n\n const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION]\n const previousHasChildList = Node.has(editor, previousChildListPath)\n\n Editor.withoutNormalizing(editor, () => {\n if (!previousHasChildList) {\n Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {\n at: previousChildListPath,\n })\n }\n\n const previousChildList = Node.get(editor, previousChildListPath)\n\n if (ElementUtils.isList(previousChildList)) {\n const index = previousHasChildList ? previousChildList.children.length : 0\n Transforms.moveNodes(editor, {\n at: path,\n to: [...previousChildListPath, index],\n })\n }\n })\n}\n\nexport function indent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n indentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Path, Transforms } from 'slate'\nimport { indentPath } from './indent'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { EditorUtils } from '../utils/editor'\n\nfunction dedentPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n if (!parentList || !listItemContainingParentList) return\n\n const [parentListNode, parentListPath] = parentList\n const [_, listItemContainingParentListPath] = listItemContainingParentList\n\n const listItemPosition = listItemPath[listItemPath.length - 1]\n const previousSiblings = parentListNode.children.slice(0, listItemPosition)\n const nextSiblings = parentListNode.children.slice(listItemPosition + 1)\n\n Editor.withoutNormalizing(editor, () => {\n // put next siblings into list item\n nextSiblings.forEach(() => {\n const nextSiblingPath = [...parentListPath, listItemPosition + 1]\n indentPath(editor, nextSiblingPath)\n })\n // move list item to parent list\n Transforms.moveNodes(editor, {\n at: listItemPath,\n to: Path.next(listItemContainingParentListPath),\n })\n // delete old parent list if there are no other list items\n if (previousSiblings.length === 0) {\n Transforms.removeNodes(editor, { at: parentListPath })\n }\n })\n}\n\nexport function dedent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n dedentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Location, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { unwrapList } from './unwrapList'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\nimport { BlockType } from '../types'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (at == null) return\n const start = LocationUtils.getStartPath(at)\n const ancestorPath = Path.ancestors(start).at(1)\n if (!ancestorPath || !Node.has(editor, ancestorPath)) return\n const ancestor = Node.get(editor, ancestorPath)\n\n if (!ElementUtils.isList(ancestor)) {\n return wrapList(editor, { type: options.type, at })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor, { at })\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef, Text } from 'slate'\nimport { setBlockKeyForDevice } from './setBlockKeyForDevice'\nimport { clearBlockKeyForDevice } from './clearBlockKeyForDevice'\nimport { wrapInline } from './wrapInline'\nimport { unwrapInline } from './unwrapInline'\nimport { getSelection } from '../selectors'\nimport { ElementUtils } from '../utils/element'\nimport { RenderElement, Select, createRichTextV2Plugin } from '../../controls'\nimport { getActiveBlockType } from '../selectors'\nimport { BlockType, RootBlockType } from '../types'\nimport { unwrapList } from './unwrapList'\nimport { wrapList } from './wrapList'\nimport { indent } from './indent'\nimport { dedent } from './dedent'\nimport { toggleList } from './toggleList'\nimport { EditorUtils } from '../utils/editor'\nimport isHotkey from 'is-hotkey'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\n\nexport const BlockActions = {\n setBlockKeyForDevice,\n clearBlockKeyForDevice,\n wrapInline,\n unwrapInline,\n}\n\n// TODO: This API is still litered with artifacts from the list plugin being seperated out.\n// This plugin needs to be rewritten to be assumptionless.\nexport const ListActions = {\n unwrapList,\n wrapList,\n indent,\n dedent,\n toggleList,\n}\n\nexport function onKeyDown(e: KeyboardEvent, editor: Editor) {\n if (\n !editor.selection ||\n Array.from(Editor.nodes(editor, { match: node => ElementUtils.isListItem(node) })).length === 0\n )\n return\n\n if (isHotkey('shift+tab', e)) {\n e.preventDefault()\n ListActions.dedent(editor)\n }\n\n if (isHotkey('tab', e)) {\n e.preventDefault()\n ListActions.indent(editor)\n }\n\n if (isHotkey('backspace', e)) {\n if (!editor.selection) return\n if (Range.isExpanded(editor.selection)) return\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (editor.selection.anchor.offset === 0 && listItem) {\n e.preventDefault()\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n const list = EditorUtils.getFirstAncestorList(editor, listItem[1])\n\n if (parentListItem) {\n ListActions.dedent(editor)\n } else if (list) {\n ListActions.unwrapList(editor)\n }\n return\n }\n }\n\n if (isHotkey('enter', e)) {\n e.preventDefault()\n\n if (!editor.selection) return\n\n if (Range.isExpanded(editor.selection)) {\n Transforms.delete(editor)\n return\n }\n\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (\n editor.selection.anchor.offset === 0 &&\n listItem &&\n Editor.string(editor, listItem[1]) === ''\n ) {\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n\n if (parentListItem) {\n ListActions.dedent(editor)\n } else {\n ListActions.unwrapList(editor)\n }\n return\n }\n\n Transforms.splitNodes(editor, {\n at: editor.selection,\n always: true,\n match: node => ElementUtils.isListItem(node),\n })\n }\n\n if (isHotkey('shift+enter', e)) {\n e.preventDefault()\n editor.insertText('\\n')\n }\n}\n\nexport function withBlock(editor: Editor) {\n const { normalizeNode } = editor\n\n editor.isInline = entry => {\n return ElementUtils.isInline(entry)\n }\n\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n // Normalization textAlign with empty array of values\n if (ElementUtils.isBlock(normalizationNode) && normalizationNode?.textAlign?.length == 0) {\n Transforms.unsetNodes(editor, 'textAlign', { at: normalizationPath })\n return\n }\n\n // Normalization for converting children of list items to list item children\n // In the case of backspace from position 0 of node into a list this converts the node into a list item.\n if (ElementUtils.isListItem(normalizationNode)) {\n const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION]\n\n if (Node.has(editor, pathToListItemText)) {\n const nodeInListItemTextPosition = Node.get(editor, pathToListItemText)\n if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: pathToListItemText,\n },\n )\n return\n }\n } else {\n Transforms.insertNodes(editor, ElementUtils.createListItem(), {\n at: pathToListItemText,\n })\n return\n }\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!Text.isText(normalizationNode)) {\n const mergeableChildren = Array.from(Node.children(editor, normalizationPath))\n .map((child, index, children) => {\n const potentialNodeToBeMerged = children.at(index + 1)\n if (\n !potentialNodeToBeMerged ||\n !ElementUtils.isList(potentialNodeToBeMerged[0]) ||\n !ElementUtils.isList(child[0]) ||\n potentialNodeToBeMerged[0].type !== child[0].type\n ) {\n return null\n }\n return [\n Editor.pathRef(editor, child[1]),\n Editor.pathRef(editor, potentialNodeToBeMerged[1]),\n ]\n })\n .filter((mergeableNodes): mergeableNodes is PathRef[] => Boolean(mergeableNodes))\n\n if (mergeableChildren.length !== 0) {\n mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {\n const nodePath = nodePathRef.current\n const nodeToBeMergedPath = nodeToBeMergedPathRef.current\n if (nodePath == null || nodeToBeMergedPath == null) return\n const nodeChildren = Array.from(Node.children(editor, nodePath))\n const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath))\n Editor.withoutNormalizing(editor, () => {\n childrenToBeMerged.reverse().forEach(([_, childPath]) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n\nconst definition = Select({\n label: 'Block',\n labelOrientation: 'horizontal',\n options: [\n {\n value: BlockType.Paragraph,\n label: 'Paragraph',\n },\n {\n value: BlockType.Heading1,\n label: 'Heading 1',\n },\n {\n value: BlockType.Heading2,\n label: 'Heading 2',\n },\n {\n value: BlockType.Heading3,\n label: 'Heading 3',\n },\n {\n value: BlockType.Heading4,\n label: 'Heading 4',\n },\n {\n value: BlockType.Heading5,\n label: 'Heading 5',\n },\n {\n value: BlockType.Heading6,\n label: 'Heading 6',\n },\n {\n value: BlockType.UnorderedList,\n label: 'Bulleted list',\n },\n {\n value: BlockType.OrderedList,\n label: 'Numbered list',\n },\n {\n value: BlockType.BlockQuote,\n label: 'Quote',\n },\n ],\n defaultValue: BlockType.Paragraph,\n})\n\nexport function BlockPlugin() {\n return createRichTextV2Plugin({\n withPlugin: withBlock,\n onKeyDown: onKeyDown,\n control: {\n definition,\n onChange: (editor, value) => {\n // TODO: This onChange being so complex is an artifact of how the List plugin used to be seperated out from the block plugin.\n // Would be great to refactor and simplify here.\n\n const activeBlockType = getActiveBlockType(editor)\n if (value === BlockType.UnorderedList || value === BlockType.OrderedList) {\n ListActions.toggleList(editor, {\n type: value,\n at: getSelection(editor),\n })\n } else if (activeBlockType === value) {\n Transforms.setNodes(\n editor,\n {\n type: BlockType.Default,\n },\n { at: getSelection(editor) },\n )\n } else {\n ListActions.unwrapList(editor, {\n at: getSelection(editor),\n })\n Transforms.setNodes(\n editor,\n {\n type: value ?? BlockType.Default,\n },\n { at: getSelection(editor) },\n )\n }\n },\n getValue: editor => {\n const activeBlock = getActiveBlockType(editor)\n\n if (activeBlock === RootBlockType.Text || activeBlock === RootBlockType.Default)\n return undefined\n\n return activeBlock\n },\n },\n renderElement: renderElement => props =>\n <BlockPluginComponent {...props} renderElement={renderElement} />,\n })\n}\n\nfunction BlockPluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const blockStyles = [useStyle({ margin: 0 }), element.className]\n const quoteStyles = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n const listStyles = useStyle({\n listStylePosition: 'inside',\n paddingInlineStart: '20px',\n listStyleType: 'disc',\n })\n\n switch (element.type) {\n case BlockType.Text:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote {...attributes} className={cx(...blockStyles, quoteStyles)}>\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles, listStyles)}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles, listStyles)}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n case BlockType.Default:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n\n default:\n return <>{renderElement({ element, attributes, children })}</>\n }\n}\n","import { Node, NodeEntry } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { Inline, InlineType, LinkElement } from '../types'\nimport { IconRadioGroupOption, unstable_IconRadioGroupIcon } from '../../controls'\n\nexport type SupportedInlineType = Exclude<InlineType, 'link'>\nexport type SupportedInline = Exclude<Inline, LinkElement>\n\nexport const supportedInlineOptions: IconRadioGroupOption<SupportedInlineType>[] = [\n {\n icon: unstable_IconRadioGroupIcon.Superscript,\n label: 'Superscript',\n value: 'superscript',\n },\n {\n icon: unstable_IconRadioGroupIcon.Subscript,\n label: 'Subscript',\n value: 'subscript',\n },\n {\n icon: unstable_IconRadioGroupIcon.Code,\n label: 'Code',\n value: 'code',\n },\n]\n\nexport function isSupportedInlineType(inline: InlineType): inline is SupportedInlineType {\n return supportedInlineOptions.findIndex(option => option.value === inline) !== -1\n}\n\nexport function isSupportedInlineEntry(\n entry: NodeEntry<Node>,\n): entry is NodeEntry<SupportedInline> {\n const node = entry[0]\n return (\n ElementUtils.isInline(node) &&\n supportedInlineOptions.findIndex(option => option.value === node.type) !== -1\n )\n}\n"],"names":["Element","BlockType","InlineType","Range","Editor","Text","Path","findBreakpointOverride","Transforms","Node","Point","BlockActions","setBlockKeyForDevice","clearBlockKeyForDevice","wrapInline","unwrapInline","ListActions","unwrapList","wrapList","indent","dedent","toggleList","e","editor","selection","Array","from","nodes","match","node","ElementUtils","isListItem","length","isHotkey","preventDefault","isExpanded","listItem","EditorUtils","getFirstAncestorListItem","anchor","path","offset","parentListItem","list","getFirstAncestorList","delete","string","splitNodes","at","always","insertText","normalizeNode","isInline","entry","normalizationNode","normalizationPath","isBlock","textAlign","unsetNodes","pathToListItemText","LIST_ITEM_CHILD_POSITION","has","nodeInListItemTextPosition","get","isRootBlock","setNodes","type","ListItemChild","insertNodes","createListItem","isText","mergeableChildren","children","map","child","index","potentialNodeToBeMerged","isList","pathRef","filter","mergeableNodes","Boolean","reverse","forEach","nodePathRef","nodeToBeMergedPathRef","nodePath","current","nodeToBeMergedPath","nodeChildren","childrenToBeMerged","withoutNormalizing","_","childPath","moveNodes","to","removeNodes","unref","definition","Select","label","labelOrientation","options","value","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","UnorderedList","OrderedList","BlockQuote","defaultValue","createRichTextV2Plugin","withPlugin","withBlock","onKeyDown","control","onChange","activeBlockType","getActiveBlockType","getSelection","Default","getValue","activeBlock","RootBlockType","undefined","renderElement","props","_jsx","element","attributes","blockStyles","useStyle","margin","className","quoteStyles","padding","fontSize","fontWeight","borderLeft","listStyles","listStylePosition","paddingInlineStart","listStyleType","cx","ListItem","_Fragment","unstable_IconRadioGroupIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAe;AAAA,EAC1B,YAAY,MAA+B;AACzC,WACEA,MAAAA,QAAQ,UAAU,IAAI,KACrBA,OAAAA,QAAQ,cAAc,MAAMC,oBAAU,SAAS,KAC9CD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,UAAU,UAAA,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,oBAAU,UAAU,KAChDD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,aAAa,KACnDD,MAAQ,QAAA,cAAc,MAAMC,UAAAA,UAAU,WAAW,KACjDD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,IAAI,KAC1CD,cAAQ,cAAc,MAAMC,oBAAU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AAAA,QAC7B9D;AAAAA,MAAAA,EAFL;AAAA;AAOO,4CAAA6E,WAAAA,UAAA;AAAA,QAAA,UAAGpB,cAAc;AAAA,UAAEG;AAAAA,UAASC;AAAAA,UAAY7D;AAAAA,QAAAA,CAAxB;AAAA,MAAA,CAAvB;AAAA;AAEL;ACnZM,MAAM,yBAAsE;AAAA,EACjF;AAAA,IACE,MAAM8E,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAMA,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAMA,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAEO,+BAA+B,QAAmD;AACvF,SAAO,uBAAuB,UAAU,CAAA,WAAU,OAAO,UAAU,MAAM,MAAM;AACjF;AAEO,gCACL,OACqC;AACrC,QAAM,OAAO,MAAM;AAEjB,SAAA,aAAa,SAAS,IAAI,KAC1B,uBAAuB,UAAU,CAAA,WAAU,OAAO,UAAU,KAAK,IAAI,MAAM;AAE/E;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"types.cjs2.js","sources":["../src/slate/utils/element.ts","../src/slate/utils/unhangRange.ts","../src/slate/selectors.ts","../src/slate/BlockPlugin/setBlockKeyForDevice.ts","../src/slate/BlockPlugin/clearBlockKeyForDevice.ts","../src/slate/BlockPlugin/wrapInline.ts","../src/slate/BlockPlugin/unwrapInline.ts","../src/slate/utils/editor.ts","../src/slate/BlockPlugin/constants.ts","../src/slate/BlockPlugin/utils/filterForSubtreeRoots.ts","../src/slate/BlockPlugin/unwrapList.ts","../src/slate/BlockPlugin/wrapList.ts","../src/slate/BlockPlugin/utils/location.ts","../src/slate/BlockPlugin/utils/getSelectedListItems.ts","../src/slate/BlockPlugin/indent.ts","../src/slate/BlockPlugin/dedent.ts","../src/slate/BlockPlugin/toggleList.ts","../src/slate/BlockPlugin/index.tsx","../src/slate/InlinePlugin/types.ts"],"sourcesContent":["import { Node, Element } from 'slate'\nimport {\n RootBlock,\n BlockType,\n Block,\n Inline,\n InlineType,\n OrderedListElement,\n UnorderedListElement,\n ListItemElement,\n ListItemChildElement,\n} from '../types'\n\nexport const ElementUtils = {\n isRootBlock(node: Node): node is RootBlock {\n return (\n Element.isElement(node) &&\n (Element.isElementType(node, BlockType.Paragraph) ||\n Element.isElementType(node, BlockType.Heading1) ||\n Element.isElementType(node, BlockType.Heading2) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading4) ||\n Element.isElementType(node, BlockType.Heading5) ||\n Element.isElementType(node, BlockType.Heading6) ||\n Element.isElementType(node, BlockType.BlockQuote) ||\n Element.isElementType(node, BlockType.UnorderedList) ||\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.Text) ||\n Element.isElementType(node, BlockType.Default))\n )\n },\n isBlock(node: Node): node is Block {\n return (\n Element.isElement(node) &&\n (this.isRootBlock(node) ||\n Element.isElementType(node, BlockType.ListItem) ||\n Element.isElementType(node, BlockType.ListItemChild))\n )\n },\n isInline(node: Node): node is Inline {\n return (\n Element.isElementType(node, InlineType.Code) ||\n Element.isElementType(node, InlineType.Link) ||\n Element.isElementType(node, InlineType.SubScript) ||\n Element.isElementType(node, InlineType.SuperScript)\n )\n },\n isConvertibleToListTextNode(node: Node) {\n return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node)\n },\n isList(node: Node): node is OrderedListElement | UnorderedListElement {\n return (\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.UnorderedList)\n )\n },\n isListItem(node: Node): node is ListItemElement {\n return Element.isElementType(node, BlockType.ListItem)\n },\n isListItemChild(node: Node): node is ListItemChildElement {\n return Element.isElementType(node, BlockType.ListItemChild)\n },\n createText() {\n return { text: '' }\n },\n createParagraph() {\n return {\n children: [this.createText()],\n type: BlockType.Paragraph,\n }\n },\n createList(type: BlockType = BlockType.UnorderedList): Block {\n return { children: [this.createText()], type }\n },\n createListItem(): Block {\n return {\n children: [this.createListItemChild()],\n type: BlockType.ListItem,\n }\n },\n createListItemChild(): Block {\n return {\n children: [this.createText()],\n type: BlockType.ListItemChild,\n }\n },\n}\n","import { Editor, Range, Element, Text, Path } from 'slate'\n\n/**\n * The `Editor.unhangeRange` within Slate early exits if `Path.hasPrevious(end.path)` ie if this isn't a root block.\n * Unfortunately when you `setNode(..., {split:true})` or `wrapNodes()` you also have a hanging selection, but not in the root position.\n *\n * This c/p removes the `Path.hasPrevious(end.path)` from the early exit but it the same otherwise\n */\nfunction unhangRange(editor: Editor, range: Range): Range {\n // eslint-disable-next-line prefer-const\n let [start, end] = Range.edges(range)\n // PERF: exit early if we can guarantee that the range isn't hanging.\n if (start.offset !== 0 || end.offset !== 0 || Range.isCollapsed(range)) {\n return range\n }\n\n const endBlock = Editor.above(editor, {\n at: end,\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n })\n const blockPath = endBlock ? endBlock[1] : []\n const first = Editor.start(editor, start)\n const before = { anchor: first, focus: end }\n let skip = true\n\n for (const [node, path] of Editor.nodes(editor, {\n at: before,\n match: Text.isText,\n reverse: true,\n })) {\n if (skip) {\n skip = false\n continue\n }\n\n if (node.text !== '' || Path.isBefore(path, blockPath)) {\n end = { path, offset: node.text.length }\n break\n }\n }\n\n return { anchor: start, focus: end }\n}\n\nexport default unhangRange\n","import { Editor, NodeEntry, Range, Text } from 'slate'\nimport { EditableBlockKey } from './BlockPlugin/types'\nimport { ElementUtils } from './utils/element'\n\nimport unhangRange from './utils/unhangRange'\nimport shallowEqual from '../utils/shallowEqual'\nimport { isNonNullable } from '../utils/isNonNullable'\n\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../state/modules/breakpoints'\nimport deepEqual from '../utils/deepEqual'\nimport keys from '../utils/keys'\nimport {\n RootBlock,\n Inline,\n RootBlockType,\n ResponsiveBlockTextAlignment,\n BlockTextAlignment,\n RichTextTypography,\n} from './types'\n\nexport function getSelection(editor: Editor): Range {\n if (editor.selection) return unhangRange(editor, editor.selection)\n return {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n }\n}\n\nexport function getBlocksInSelection(editor: Editor): NodeEntry<RootBlock>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isRootBlock(node),\n }),\n ).filter((entry): entry is NodeEntry<RootBlock> => ElementUtils.isRootBlock(entry[0]))\n}\n\nexport function getInlinesInSelection(editor: Editor): NodeEntry<Inline>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isInline(node),\n }),\n ).filter((entry): entry is NodeEntry<Inline> => ElementUtils.isInline(entry[0]))\n}\n\nexport function getActiveBlockType(editor: Editor): RootBlockType | null {\n const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type)\n\n return rootBlocks.reduce<RootBlockType | null>(\n (a, b) => (a === b ? b : null),\n rootBlocks.at(0) ?? null,\n )\n}\n\nexport function getActiveBlockValue(editor: Editor, key: EditableBlockKey) {\n const blocks = getBlocksInSelection(editor)\n\n const active = blocks.map(\n ([block]) => block[key] ?? null,\n ) as (ResponsiveBlockTextAlignment | null)[]\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\nexport function getActiveBlockDeviceOverrideValue(\n editor: Editor,\n key: EditableBlockKey,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n) {\n const active: (BlockTextAlignment | null)[] = []\n const blocks = getBlocksInSelection(editor)\n\n blocks.forEach(([block]) => {\n const deviceOverride =\n findBreakpointOverride<BlockTextAlignment>(breakpoints, block[key], deviceId) || null\n active.push(deviceOverride?.value ?? null)\n })\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\n// Typography\n\nconst concat = (a: unknown[], b: unknown[]) => a.concat(b)\n\n// TODO: This is more cruft from trying to remove null from the typography type. This optimization is not worth it.\n/**\n * This is a c/p of the intersection of the utils from the root utils folder.\n * The only change is defaulting to undefined instead of to null.\n */\nexport default function intersection<A extends Record<string, unknown>, B extends A>(\n a: A,\n b: B,\n isEqual: (a: unknown, b: unknown) => boolean = deepEqual,\n): { [K in keyof A]: A[K] | undefined } {\n const allKeys = [...new Set([...keys(a), ...keys(b)])] as (keyof A)[]\n\n return allKeys.reduce((acc, k) => {\n if (isEqual(a[k], b[k])) acc[k] = a[k]\n else acc[k] = undefined\n\n return acc\n }, {} as { [K in keyof A]: A[K] | undefined })\n}\n\nconst fuseTypographyMarks = (\n values: Array<RichTextTypography | null | undefined>,\n breakpoints: Breakpoints,\n): RichTextTypography => {\n const devices = [\n ...new Set(\n values\n .filter(isNonNullable)\n .map(({ style }) => style.map(({ deviceId }) => deviceId))\n .reduce(concat, []),\n ),\n ] as BreakpointId[]\n\n return {\n id: values.map(v => v && v.id).reduce((a, b) => (a === b ? a : undefined)) ?? undefined,\n style: devices.map(deviceId =>\n values\n .map(\n v =>\n (v && findBreakpointOverride(breakpoints, v.style, deviceId)) || {\n deviceId,\n value: {},\n },\n )\n .reduce((acc, { value }) => {\n const a = intersection(acc.value, value)\n return {\n deviceId,\n value: a,\n }\n }),\n ),\n }\n}\n\nexport function getActiveTypographyMark(\n editor: Editor,\n breakpoints: Breakpoints,\n): RichTextTypography {\n const active: RichTextTypography[] = []\n\n const textNodes = Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => Text.isText(node),\n })\n\n for (const [node] of textNodes) {\n if (Text.isText(node) && 'typography' in node && node.typography != undefined) {\n active.push(node.typography)\n }\n }\n return active.length === 0 ? { style: [] } : fuseTypographyMarks(active, breakpoints)\n}\n","import { Editor, Transforms, Location } from 'slate'\nimport { getBlocksInSelection } from '../selectors'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey, EditableBlockValue } from './types'\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../../state/modules/breakpoints'\n\ntype SetBlockKeyForDeviceOptions = {\n at?: Location\n}\n\nexport function setBlockKeyForDevice(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n value: EditableBlockValue[number]['value'],\n options?: SetBlockKeyForDeviceOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceValues = node[key] ?? []\n const currentDeviceValue = findBreakpointOverride(breakpoints, deviceValues, deviceId, v => v)\n const nextDeviceValue = {\n ...currentDeviceValue,\n deviceId,\n value,\n }\n Transforms.setNodes(\n editor,\n {\n [key]: [...deviceValues.filter(v => v.deviceId !== deviceId), nextDeviceValue],\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey } from './types'\nimport { getBlocksInSelection } from '../selectors'\nimport { BreakpointId } from '../../state/modules/breakpoints'\n\nexport function clearBlockKeyForDevice(\n editor: Editor,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n) {\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceOverrides = node[key] ?? []\n Transforms.setNodes(\n editor,\n {\n [key]: deviceOverrides.filter(v => v.deviceId !== deviceId),\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { getSelection } from '../selectors'\nimport { Inline } from '../types'\n\nexport function wrapInline(editor: Editor, inline: Inline) {\n Transforms.wrapNodes(editor, inline, {\n at: getSelection(editor),\n split: true,\n })\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { getSelection } from '../selectors'\nimport { InlineType } from '../types'\n\nexport function unwrapInline(editor: Editor, type: InlineType) {\n Transforms.unwrapNodes(editor, {\n match: node => ElementUtils.isInline(node) && node.type === type,\n at: getSelection(editor),\n })\n}\n","import { Path, Editor, NodeEntry } from 'slate'\n\nimport { ElementUtils } from './element'\nimport { ListElement, ListItemElement } from '../types'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n try {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n } catch (e) {\n return null\n }\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\n try {\n const parentListItem = Editor.above(editor, {\n at: path,\n match: (node): node is ListItemElement => ElementUtils.isListItem(node),\n })\n\n return parentListItem ?? null\n } catch (e) {\n return null\n }\n },\n}\n","export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import type { Node, NodeEntry } from 'slate'\nimport { Path } from 'slate'\n\nexport function filterForSubtreeRoots(entries: NodeEntry<Node>[]): NodeEntry<Node>[] {\n return entries.filter(\n ([, nodePath]) =>\n !Path.ancestors(nodePath).some(ancestor => {\n return entries.some(([, path]) => Path.equals(path, ancestor))\n }),\n )\n}\n","import { Editor, Element, Transforms, Path, Node, Location, Span } from 'slate'\nimport { EditorUtils } from '../utils/editor'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../types'\n\nexport function unwrapPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n //if this is a nested item we don't want to unwrap it\n if (!parentList || listItemContainingParentList) return\n\n Editor.withoutNormalizing(editor, () => {\n const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION]\n const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION]\n\n if (Node.has(editor, listItemNestedListPath)) {\n Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: Path.next(listItemPath) })\n }\n\n if (Node.has(editor, listItemTextPath)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.Paragraph },\n {\n at: listItemTextPath,\n },\n )\n Transforms.liftNodes(editor, { at: listItemTextPath })\n Transforms.liftNodes(editor, { at: listItemPath })\n }\n })\n}\n\ntype UnwrapListOptions = {\n at?: Location | Span\n}\n\nexport function unwrapList(editor: Editor, options?: UnwrapListOptions) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const listItems = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isListItem(node)\n },\n }),\n )\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Element, Location, Span, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../types'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location | Span\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (!at) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node)\n },\n }),\n )\n\n const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n const path = ref.current\n if (path) {\n Editor.withoutNormalizing(editor, () => {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: path,\n },\n )\n Transforms.wrapNodes(editor, ElementUtils.createListItem(), {\n match: node => ElementUtils.isListItemChild(node),\n at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","import { Range, Point, Path, Location } from 'slate'\n\nexport const LocationUtils = {\n getStartPath(location: Location): Path {\n if (Range.isRange(location)) return Range.start(location).path\n if (Point.isPoint(location)) return location.path\n return location\n },\n}\n","import type { Element, NodeEntry } from 'slate'\nimport { Editor, Path } from 'slate'\nimport { EditorUtils } from '../../utils/editor'\nimport { ElementUtils } from '../../utils/element'\nimport { LocationUtils } from './location'\n\nexport function getSelectedListItems(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const listItems = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isListItem(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorListItem(editor, start)?.[1] ?? []\n\n return Array.from(listItems).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function indentPath(editor: Editor, path: Path) {\n const parent = Node.parent(editor, path)\n if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent)) return\n\n const previosPath = Path.previous(path)\n\n const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION]\n const previousHasChildList = Node.has(editor, previousChildListPath)\n\n Editor.withoutNormalizing(editor, () => {\n if (!previousHasChildList) {\n Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {\n at: previousChildListPath,\n })\n }\n\n const previousChildList = Node.get(editor, previousChildListPath)\n\n if (ElementUtils.isList(previousChildList)) {\n const index = previousHasChildList ? previousChildList.children.length : 0\n Transforms.moveNodes(editor, {\n at: path,\n to: [...previousChildListPath, index],\n })\n }\n })\n}\n\nexport function indent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n indentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Path, Transforms } from 'slate'\nimport { indentPath } from './indent'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { EditorUtils } from '../utils/editor'\n\nfunction dedentPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n if (!parentList || !listItemContainingParentList) return\n\n const [parentListNode, parentListPath] = parentList\n const [_, listItemContainingParentListPath] = listItemContainingParentList\n\n const listItemPosition = listItemPath[listItemPath.length - 1]\n const previousSiblings = parentListNode.children.slice(0, listItemPosition)\n const nextSiblings = parentListNode.children.slice(listItemPosition + 1)\n\n Editor.withoutNormalizing(editor, () => {\n // put next siblings into list item\n nextSiblings.forEach(() => {\n const nextSiblingPath = [...parentListPath, listItemPosition + 1]\n indentPath(editor, nextSiblingPath)\n })\n // move list item to parent list\n Transforms.moveNodes(editor, {\n at: listItemPath,\n to: Path.next(listItemContainingParentListPath),\n })\n // delete old parent list if there are no other list items\n if (previousSiblings.length === 0) {\n Transforms.removeNodes(editor, { at: parentListPath })\n }\n })\n}\n\nexport function dedent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n dedentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Location, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { unwrapList } from './unwrapList'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\nimport { BlockType } from '../types'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (at == null) return\n const start = LocationUtils.getStartPath(at)\n const ancestorPath = Path.ancestors(start).at(1)\n if (!ancestorPath || !Node.has(editor, ancestorPath)) return\n const ancestor = Node.get(editor, ancestorPath)\n\n if (!ElementUtils.isList(ancestor)) {\n return wrapList(editor, { type: options.type, at })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor, { at })\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef, Text } from 'slate'\nimport { setBlockKeyForDevice } from './setBlockKeyForDevice'\nimport { clearBlockKeyForDevice } from './clearBlockKeyForDevice'\nimport { wrapInline } from './wrapInline'\nimport { unwrapInline } from './unwrapInline'\nimport { getSelection } from '../selectors'\nimport { ElementUtils } from '../utils/element'\nimport { RenderElement, Select, createRichTextV2Plugin } from '../../controls'\nimport { getActiveBlockType } from '../selectors'\nimport { BlockType, RootBlockType } from '../types'\nimport { unwrapList } from './unwrapList'\nimport { wrapList } from './wrapList'\nimport { indent } from './indent'\nimport { dedent } from './dedent'\nimport { toggleList } from './toggleList'\nimport { EditorUtils } from '../utils/editor'\nimport isHotkey from 'is-hotkey'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\n\nexport const BlockActions = {\n setBlockKeyForDevice,\n clearBlockKeyForDevice,\n wrapInline,\n unwrapInline,\n}\n\n// TODO: This API is still litered with artifacts from the list plugin being seperated out.\n// This plugin needs to be rewritten to be assumptionless.\nexport const ListActions = {\n unwrapList,\n wrapList,\n indent,\n dedent,\n toggleList,\n}\n\nexport function onKeyDown(e: KeyboardEvent, editor: Editor) {\n if (\n !editor.selection ||\n Array.from(Editor.nodes(editor, { match: node => ElementUtils.isListItem(node) })).length === 0\n )\n return\n\n if (isHotkey('shift+tab', e)) {\n e.preventDefault()\n ListActions.dedent(editor)\n }\n\n if (isHotkey('tab', e)) {\n e.preventDefault()\n ListActions.indent(editor)\n }\n\n if (isHotkey('backspace', e)) {\n if (!editor.selection) return\n if (Range.isExpanded(editor.selection)) return\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (editor.selection.anchor.offset === 0 && listItem) {\n e.preventDefault()\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n const list = EditorUtils.getFirstAncestorList(editor, listItem[1])\n\n if (parentListItem) {\n ListActions.dedent(editor)\n } else if (list) {\n ListActions.unwrapList(editor)\n }\n return\n }\n }\n\n if (isHotkey('enter', e)) {\n e.preventDefault()\n\n if (!editor.selection) return\n\n if (Range.isExpanded(editor.selection)) {\n Transforms.delete(editor)\n return\n }\n\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (\n editor.selection.anchor.offset === 0 &&\n listItem &&\n Editor.string(editor, listItem[1]) === ''\n ) {\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n\n if (parentListItem) {\n ListActions.dedent(editor)\n } else {\n ListActions.unwrapList(editor)\n }\n return\n }\n\n Transforms.splitNodes(editor, {\n at: editor.selection,\n always: true,\n match: node => ElementUtils.isListItem(node),\n })\n }\n\n if (isHotkey('shift+enter', e)) {\n e.preventDefault()\n editor.insertText('\\n')\n }\n}\n\nexport function withBlock(editor: Editor) {\n const { normalizeNode } = editor\n\n editor.isInline = entry => {\n return ElementUtils.isInline(entry)\n }\n\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n // Normalization textAlign with empty array of values\n if (ElementUtils.isBlock(normalizationNode) && normalizationNode?.textAlign?.length == 0) {\n Transforms.unsetNodes(editor, 'textAlign', { at: normalizationPath })\n return\n }\n\n // Normalization for converting children of list items to list item children\n // In the case of backspace from position 0 of node into a list this converts the node into a list item.\n if (ElementUtils.isListItem(normalizationNode)) {\n const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION]\n\n if (Node.has(editor, pathToListItemText)) {\n const nodeInListItemTextPosition = Node.get(editor, pathToListItemText)\n if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: pathToListItemText,\n },\n )\n return\n }\n } else {\n Transforms.insertNodes(editor, ElementUtils.createListItem(), {\n at: pathToListItemText,\n })\n return\n }\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!Text.isText(normalizationNode)) {\n const mergeableChildren = Array.from(Node.children(editor, normalizationPath))\n .map((child, index, children) => {\n const potentialNodeToBeMerged = children.at(index + 1)\n if (\n !potentialNodeToBeMerged ||\n !ElementUtils.isList(potentialNodeToBeMerged[0]) ||\n !ElementUtils.isList(child[0]) ||\n potentialNodeToBeMerged[0].type !== child[0].type\n ) {\n return null\n }\n return [\n Editor.pathRef(editor, child[1]),\n Editor.pathRef(editor, potentialNodeToBeMerged[1]),\n ]\n })\n .filter((mergeableNodes): mergeableNodes is PathRef[] => Boolean(mergeableNodes))\n\n if (mergeableChildren.length !== 0) {\n mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {\n const nodePath = nodePathRef.current\n const nodeToBeMergedPath = nodeToBeMergedPathRef.current\n if (nodePath == null || nodeToBeMergedPath == null) return\n const nodeChildren = Array.from(Node.children(editor, nodePath))\n const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath))\n Editor.withoutNormalizing(editor, () => {\n childrenToBeMerged.reverse().forEach(([_, childPath]) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n\nconst definition = Select({\n label: 'Block',\n labelOrientation: 'horizontal',\n options: [\n {\n value: BlockType.Paragraph,\n label: 'Paragraph',\n },\n {\n value: BlockType.Heading1,\n label: 'Heading 1',\n },\n {\n value: BlockType.Heading2,\n label: 'Heading 2',\n },\n {\n value: BlockType.Heading3,\n label: 'Heading 3',\n },\n {\n value: BlockType.Heading4,\n label: 'Heading 4',\n },\n {\n value: BlockType.Heading5,\n label: 'Heading 5',\n },\n {\n value: BlockType.Heading6,\n label: 'Heading 6',\n },\n {\n value: BlockType.UnorderedList,\n label: 'Bulleted list',\n },\n {\n value: BlockType.OrderedList,\n label: 'Numbered list',\n },\n {\n value: BlockType.BlockQuote,\n label: 'Quote',\n },\n ],\n defaultValue: BlockType.Paragraph,\n})\n\nexport function BlockPlugin() {\n return createRichTextV2Plugin({\n withPlugin: withBlock,\n onKeyDown: onKeyDown,\n control: {\n definition,\n onChange: (editor, value) => {\n // TODO: This onChange being so complex is an artifact of how the List plugin used to be seperated out from the block plugin.\n // Would be great to refactor and simplify here.\n\n const activeBlockType = getActiveBlockType(editor)\n if (value === BlockType.UnorderedList || value === BlockType.OrderedList) {\n ListActions.toggleList(editor, {\n type: value,\n at: getSelection(editor),\n })\n } else if (activeBlockType === value) {\n Transforms.setNodes(\n editor,\n {\n type: BlockType.Default,\n },\n { at: getSelection(editor) },\n )\n } else {\n ListActions.unwrapList(editor, {\n at: getSelection(editor),\n })\n Transforms.setNodes(\n editor,\n {\n type: value ?? BlockType.Default,\n },\n { at: getSelection(editor) },\n )\n }\n },\n getValue: editor => {\n const activeBlock = getActiveBlockType(editor)\n\n if (activeBlock === RootBlockType.Text || activeBlock === RootBlockType.Default)\n return undefined\n\n return activeBlock\n },\n },\n renderElement: renderElement => props =>\n <BlockPluginComponent {...props} renderElement={renderElement} />,\n })\n}\n\nfunction BlockPluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const blockStyles = [useStyle({ margin: 0 }), element.className]\n const quoteStyles = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n const listStyles = useStyle({\n listStylePosition: 'inside',\n paddingInlineStart: '20px',\n listStyleType: 'disc',\n })\n\n switch (element.type) {\n case BlockType.Text:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n case BlockType.Default:\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote {...attributes} className={cx(...blockStyles, quoteStyles)}>\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles, listStyles)}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles, listStyles)}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n default:\n return <>{renderElement({ element, attributes, children })}</>\n }\n}\n","import { Node, NodeEntry } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { Inline, InlineType, LinkElement } from '../types'\nimport { IconRadioGroupOption, unstable_IconRadioGroupIcon } from '../../controls'\n\nexport type SupportedInlineType = Exclude<InlineType, 'link'>\nexport type SupportedInline = Exclude<Inline, LinkElement>\n\nexport const supportedInlineOptions: IconRadioGroupOption<SupportedInlineType>[] = [\n {\n icon: unstable_IconRadioGroupIcon.Superscript,\n label: 'Superscript',\n value: 'superscript',\n },\n {\n icon: unstable_IconRadioGroupIcon.Subscript,\n label: 'Subscript',\n value: 'subscript',\n },\n {\n icon: unstable_IconRadioGroupIcon.Code,\n label: 'Code',\n value: 'code',\n },\n]\n\nexport function isSupportedInlineType(inline: InlineType): inline is SupportedInlineType {\n return supportedInlineOptions.findIndex(option => option.value === inline) !== -1\n}\n\nexport function isSupportedInlineEntry(\n entry: NodeEntry<Node>,\n): entry is NodeEntry<SupportedInline> {\n const node = entry[0]\n return (\n ElementUtils.isInline(node) &&\n supportedInlineOptions.findIndex(option => option.value === node.type) !== -1\n )\n}\n"],"names":["Element","BlockType","InlineType","Range","Editor","Text","Path","findBreakpointOverride","Transforms","Node","Point","BlockActions","setBlockKeyForDevice","clearBlockKeyForDevice","wrapInline","unwrapInline","ListActions","unwrapList","wrapList","indent","dedent","toggleList","e","editor","selection","Array","from","nodes","match","node","ElementUtils","isListItem","length","isHotkey","preventDefault","isExpanded","listItem","EditorUtils","getFirstAncestorListItem","anchor","path","offset","parentListItem","list","getFirstAncestorList","delete","string","splitNodes","at","always","insertText","normalizeNode","isInline","entry","normalizationNode","normalizationPath","isBlock","textAlign","unsetNodes","pathToListItemText","LIST_ITEM_CHILD_POSITION","has","nodeInListItemTextPosition","get","isRootBlock","setNodes","type","ListItemChild","insertNodes","createListItem","isText","mergeableChildren","children","map","child","index","potentialNodeToBeMerged","isList","pathRef","filter","mergeableNodes","Boolean","reverse","forEach","nodePathRef","nodeToBeMergedPathRef","nodePath","current","nodeToBeMergedPath","nodeChildren","childrenToBeMerged","withoutNormalizing","_","childPath","moveNodes","to","removeNodes","unref","definition","Select","label","labelOrientation","options","value","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","UnorderedList","OrderedList","BlockQuote","defaultValue","createRichTextV2Plugin","withPlugin","withBlock","onKeyDown","control","onChange","activeBlockType","getActiveBlockType","getSelection","Default","getValue","activeBlock","RootBlockType","undefined","renderElement","props","_jsx","element","attributes","blockStyles","useStyle","margin","className","quoteStyles","padding","fontSize","fontWeight","borderLeft","listStyles","listStylePosition","paddingInlineStart","listStyleType","cx","ListItem","_Fragment","unstable_IconRadioGroupIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAe;AAAA,EAC1B,YAAY,MAA+B;AACzC,WACEA,MAAAA,QAAQ,UAAU,IAAI,KACrBA,OAAAA,QAAQ,cAAc,MAAMC,oBAAU,SAAS,KAC9CD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,UAAU,UAAA,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,UAAAA,UAAU,QAAQ,KAC9CD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,QAAQ,KAC9CD,cAAQ,cAAc,MAAMC,oBAAU,UAAU,KAChDD,cAAQ,cAAc,MAAMC,UAAAA,UAAU,aAAa,KACnDD,MAAQ,QAAA,cAAc,MAAMC,UAAAA,UAAU,WAAW,KACjDD,MAAAA,QAAQ,cAAc,MAAMC,oBAAU,IAAI,KAC1CD,cAAQ,cAAc,MAAMC,oBAAU,OAAO;AAAA,EAEnD;AAAA,EACA,QAAQ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AAAA,UAAY7D;AAAAA,QAAAA,CAAxB;AAAA,MAAA,CAAvB;AAAA;AAEL;AC7YM,MAAM,yBAAsE;AAAA,EACjF;AAAA,IACE,MAAM8E,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAMA,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAMA,WAA4B,4BAAA;AAAA,IAClC,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAEO,+BAA+B,QAAmD;AACvF,SAAO,uBAAuB,UAAU,CAAA,WAAU,OAAO,UAAU,MAAM,MAAM;AACjF;AAEO,gCACL,OACqC;AACrC,QAAM,OAAO,MAAM;AAEjB,SAAA,aAAa,SAAS,IAAI,KAC1B,uBAAuB,UAAU,CAAA,WAAU,OAAO,UAAU,KAAK,IAAI,MAAM;AAE/E;;;;;;;;;;;;;;"}
package/dist/types.es.js CHANGED
@@ -4,6 +4,7 @@ const APIResourceType = {
4
4
  Typography: "Typography",
5
5
  PagePathnameSlice: "PagePathnameSlice",
6
6
  GlobalElement: "GlobalElement",
7
+ LocalizedGlobalElement: "LocalizedGlobalElement",
7
8
  Table: "Table",
8
9
  Snippet: "Snippet",
9
10
  Page: "Page",
@@ -1 +1 @@
1
- {"version":3,"file":"types.es.js","sources":["../src/api/graphql/types.ts"],"sourcesContent":["import {\n SwatchFragment as Swatch,\n FileFragment as File,\n TypographyFragment as Typography,\n PagePathnameSliceFragment as PagePathnameSlice,\n GlobalElementFragment as GlobalElement,\n TableFragment as Table,\n SnippetFragment as Snippet,\n PageFragment as Page,\n SiteFragment as Site,\n} from './generated/types'\n\nexport type {\n Swatch,\n File,\n Typography,\n PagePathnameSlice,\n GlobalElement,\n Table,\n Snippet,\n Page,\n Site,\n}\n\nexport type APIResource =\n | Swatch\n | File\n | Typography\n | PagePathnameSlice\n | GlobalElement\n | Table\n | Snippet\n | Page\n | Site\n\nexport const APIResourceType: { [R in APIResource as R['__typename']]: R['__typename'] } = {\n Swatch: 'Swatch',\n File: 'File',\n Typography: 'Typography',\n PagePathnameSlice: 'PagePathnameSlice',\n GlobalElement: 'GlobalElement',\n Table: 'Table',\n Snippet: 'Snippet',\n Page: 'Page',\n Site: 'Site',\n}\n\nexport type APIResourceType = typeof APIResourceType[keyof typeof APIResourceType]\n"],"names":[],"mappings":"AAmCO,MAAM,kBAA8E;AAAA,EACzF,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;;"}
1
+ {"version":3,"file":"types.es.js","sources":["../src/api/graphql/types.ts"],"sourcesContent":["import {\n SwatchFragment as Swatch,\n FileFragment as File,\n TypographyFragment as Typography,\n PagePathnameSliceFragment as PagePathnameSlice,\n GlobalElementFragment as GlobalElement,\n LocalizedGlobalElementFragment as LocalizedGlobalElement,\n TableFragment as Table,\n SnippetFragment as Snippet,\n PageFragment as Page,\n SiteFragment as Site,\n} from './generated/types'\n\nexport type {\n Swatch,\n File,\n Typography,\n PagePathnameSlice,\n GlobalElement,\n LocalizedGlobalElement,\n Table,\n Snippet,\n Page,\n Site,\n}\n\nexport type APIResource =\n | Swatch\n | File\n | Typography\n | PagePathnameSlice\n | GlobalElement\n | LocalizedGlobalElement\n | Table\n | Snippet\n | Page\n | Site\n\nexport const APIResourceType: { [R in APIResource as R['__typename']]: R['__typename'] } = {\n Swatch: 'Swatch',\n File: 'File',\n Typography: 'Typography',\n PagePathnameSlice: 'PagePathnameSlice',\n GlobalElement: 'GlobalElement',\n LocalizedGlobalElement: 'LocalizedGlobalElement',\n Table: 'Table',\n Snippet: 'Snippet',\n Page: 'Page',\n Site: 'Site',\n}\n\nexport type APIResourceType = typeof APIResourceType[keyof typeof APIResourceType]\n"],"names":[],"mappings":"AAsCO,MAAM,kBAA8E;AAAA,EACzF,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;;"}
package/dist/types.es2.js CHANGED
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { Element, Range, Editor, Text, Path, Transforms, Node, Point } from "slate";
21
21
  import { findBreakpointOverride } from "./state/breakpoints.es.js";
22
- import { bg as BlockType, be as InlineType, ba as createRichTextV2Plugin, bf as RootBlockType, U as useStyle } from "./react-page.es.js";
22
+ import { bi as BlockType, bg as InlineType, ba as createRichTextV2Plugin, bh as RootBlockType, U as useStyle } from "./react-page.es.js";
23
23
  import "./actions.es.js";
24
24
  import { f as Select, u as unstable_IconRadioGroupIcon } from "./typography.es.js";
25
25
  import isHotkey from "is-hotkey";
@@ -630,6 +630,7 @@ function BlockPluginComponent({
630
630
  className: cx(...blockStyles),
631
631
  children
632
632
  }));
633
+ case BlockType.Default:
633
634
  case BlockType.Paragraph:
634
635
  return /* @__PURE__ */ jsx("p", __spreadProps(__spreadValues({}, attributes), {
635
636
  className: cx(...blockStyles),
@@ -690,11 +691,6 @@ function BlockPluginComponent({
690
691
  className: cx(...blockStyles),
691
692
  children
692
693
  }));
693
- case BlockType.Default:
694
- return /* @__PURE__ */ jsx("p", __spreadProps(__spreadValues({}, attributes), {
695
- className: cx(...blockStyles),
696
- children
697
- }));
698
694
  default:
699
695
  return /* @__PURE__ */ jsx(Fragment, {
700
696
  children: renderElement({