@instructure/platform-block-content-editor 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/components/MediaPlaceholder/MediaPlaceholder.d.ts.map +1 -1
  2. package/dist/components/RichText/RichText.d.ts +20 -0
  3. package/dist/components/RichText/RichText.d.ts.map +1 -0
  4. package/dist/components/RichText/index.d.ts +2 -0
  5. package/dist/components/RichText/index.d.ts.map +1 -0
  6. package/dist/components/blocks/Accordion/Accordion.d.ts.map +1 -1
  7. package/dist/components/blocks/Accordion/accordionTranslations.d.ts +15 -0
  8. package/dist/components/blocks/Accordion/accordionTranslations.d.ts.map +1 -0
  9. package/dist/components/blocks/Accordion/createAccordionBlock.d.ts +22 -0
  10. package/dist/components/blocks/Accordion/createAccordionBlock.d.ts.map +1 -0
  11. package/dist/components/blocks/Accordion/index.d.ts +2 -0
  12. package/dist/components/blocks/Accordion/index.d.ts.map +1 -1
  13. package/dist/components/blocks/Banner/Banner.d.ts.map +1 -1
  14. package/dist/components/blocks/Banner/bannerPropsSchema.d.ts +0 -2
  15. package/dist/components/blocks/Banner/bannerPropsSchema.d.ts.map +1 -1
  16. package/dist/components/blocks/Banner/bannerTranslations.d.ts +13 -0
  17. package/dist/components/blocks/Banner/bannerTranslations.d.ts.map +1 -0
  18. package/dist/components/blocks/Banner/createBannerBlock.d.ts +14 -0
  19. package/dist/components/blocks/Banner/createBannerBlock.d.ts.map +1 -0
  20. package/dist/components/blocks/Banner/getBannerViewProps.d.ts +2 -3
  21. package/dist/components/blocks/Banner/getBannerViewProps.d.ts.map +1 -1
  22. package/dist/components/blocks/Banner/index.d.ts +2 -0
  23. package/dist/components/blocks/Banner/index.d.ts.map +1 -1
  24. package/dist/components/blocks/CodeBlock/CodeBlock.d.ts.map +1 -1
  25. package/dist/components/blocks/CodeBlock/codeBlockPropsSchema.d.ts +2 -2
  26. package/dist/components/blocks/CodeBlock/codeBlockTranslations.d.ts +11 -0
  27. package/dist/components/blocks/CodeBlock/codeBlockTranslations.d.ts.map +1 -0
  28. package/dist/components/blocks/CodeBlock/createCodeBlock.d.ts +12 -0
  29. package/dist/components/blocks/CodeBlock/createCodeBlock.d.ts.map +1 -0
  30. package/dist/components/blocks/CodeBlock/index.d.ts +2 -0
  31. package/dist/components/blocks/CodeBlock/index.d.ts.map +1 -1
  32. package/dist/components/blocks/FlashCards/FlashCard.d.ts +21 -0
  33. package/dist/components/blocks/FlashCards/FlashCard.d.ts.map +1 -0
  34. package/dist/components/blocks/FlashCards/FlashCards.d.ts +4 -0
  35. package/dist/components/blocks/FlashCards/FlashCards.d.ts.map +1 -0
  36. package/dist/components/blocks/FlashCards/createFlashCardsBlock.d.ts +15 -0
  37. package/dist/components/blocks/FlashCards/createFlashCardsBlock.d.ts.map +1 -0
  38. package/dist/components/blocks/FlashCards/flashCardsPropsSchema.d.ts +60 -0
  39. package/dist/components/blocks/FlashCards/flashCardsPropsSchema.d.ts.map +1 -0
  40. package/dist/components/blocks/FlashCards/flashCardsStyles.d.ts +43 -0
  41. package/dist/components/blocks/FlashCards/flashCardsStyles.d.ts.map +1 -0
  42. package/dist/components/blocks/FlashCards/flashCardsTranslations.d.ts +34 -0
  43. package/dist/components/blocks/FlashCards/flashCardsTranslations.d.ts.map +1 -0
  44. package/dist/components/blocks/FlashCards/getFlashCardsViewProps.d.ts +23 -0
  45. package/dist/components/blocks/FlashCards/getFlashCardsViewProps.d.ts.map +1 -0
  46. package/dist/components/blocks/FlashCards/index.d.ts +5 -0
  47. package/dist/components/blocks/FlashCards/index.d.ts.map +1 -0
  48. package/dist/components/blocks/ImageBlock/ImageBlock.d.ts.map +1 -1
  49. package/dist/components/blocks/ImageBlock/createImageBlock.d.ts +15 -0
  50. package/dist/components/blocks/ImageBlock/createImageBlock.d.ts.map +1 -0
  51. package/dist/components/blocks/ImageBlock/getImageBlockViewProps.d.ts +3 -1
  52. package/dist/components/blocks/ImageBlock/getImageBlockViewProps.d.ts.map +1 -1
  53. package/dist/components/blocks/ImageBlock/imageBlockTranslations.d.ts +15 -0
  54. package/dist/components/blocks/ImageBlock/imageBlockTranslations.d.ts.map +1 -0
  55. package/dist/components/blocks/ImageBlock/index.d.ts +2 -0
  56. package/dist/components/blocks/ImageBlock/index.d.ts.map +1 -1
  57. package/dist/components/blocks/KnowledgeCheck/AnswerCard.d.ts +19 -0
  58. package/dist/components/blocks/KnowledgeCheck/AnswerCard.d.ts.map +1 -0
  59. package/dist/components/blocks/KnowledgeCheck/KnowledgeCheck.d.ts +4 -0
  60. package/dist/components/blocks/KnowledgeCheck/KnowledgeCheck.d.ts.map +1 -0
  61. package/dist/components/blocks/KnowledgeCheck/createKnowledgeCheckBlock.d.ts +18 -0
  62. package/dist/components/blocks/KnowledgeCheck/createKnowledgeCheckBlock.d.ts.map +1 -0
  63. package/dist/components/blocks/KnowledgeCheck/getKnowledgeCheckViewProps.d.ts +34 -0
  64. package/dist/components/blocks/KnowledgeCheck/getKnowledgeCheckViewProps.d.ts.map +1 -0
  65. package/dist/components/blocks/KnowledgeCheck/index.d.ts +5 -0
  66. package/dist/components/blocks/KnowledgeCheck/index.d.ts.map +1 -0
  67. package/dist/components/blocks/KnowledgeCheck/knowledgeCheckPropsSchema.d.ts +87 -0
  68. package/dist/components/blocks/KnowledgeCheck/knowledgeCheckPropsSchema.d.ts.map +1 -0
  69. package/dist/components/blocks/KnowledgeCheck/knowledgeCheckTranslations.d.ts +35 -0
  70. package/dist/components/blocks/KnowledgeCheck/knowledgeCheckTranslations.d.ts.map +1 -0
  71. package/dist/components/blocks/LayoutContainer/LayoutContainer.d.ts +3 -0
  72. package/dist/components/blocks/LayoutContainer/LayoutContainer.d.ts.map +1 -0
  73. package/dist/components/blocks/LayoutContainer/createLayoutContainerBlock.d.ts +22 -0
  74. package/dist/components/blocks/LayoutContainer/createLayoutContainerBlock.d.ts.map +1 -0
  75. package/dist/components/blocks/LayoutContainer/getLayoutContainerViewProps.d.ts +32 -0
  76. package/dist/components/blocks/LayoutContainer/getLayoutContainerViewProps.d.ts.map +1 -0
  77. package/dist/components/blocks/LayoutContainer/index.d.ts +5 -0
  78. package/dist/components/blocks/LayoutContainer/index.d.ts.map +1 -0
  79. package/dist/components/blocks/LayoutContainer/layoutContainerPropsSchema.d.ts +118 -0
  80. package/dist/components/blocks/LayoutContainer/layoutContainerPropsSchema.d.ts.map +1 -0
  81. package/dist/components/blocks/MixAndMatch/MatchCard.d.ts +21 -0
  82. package/dist/components/blocks/MixAndMatch/MatchCard.d.ts.map +1 -0
  83. package/dist/components/blocks/MixAndMatch/MixAndMatch.d.ts +4 -0
  84. package/dist/components/blocks/MixAndMatch/MixAndMatch.d.ts.map +1 -0
  85. package/dist/components/blocks/MixAndMatch/createMixAndMatchBlock.d.ts +15 -0
  86. package/dist/components/blocks/MixAndMatch/createMixAndMatchBlock.d.ts.map +1 -0
  87. package/dist/components/blocks/MixAndMatch/getMixAndMatchViewProps.d.ts +43 -0
  88. package/dist/components/blocks/MixAndMatch/getMixAndMatchViewProps.d.ts.map +1 -0
  89. package/dist/components/blocks/MixAndMatch/index.d.ts +5 -0
  90. package/dist/components/blocks/MixAndMatch/index.d.ts.map +1 -0
  91. package/dist/components/blocks/MixAndMatch/mixAndMatchPropsSchema.d.ts +74 -0
  92. package/dist/components/blocks/MixAndMatch/mixAndMatchPropsSchema.d.ts.map +1 -0
  93. package/dist/components/blocks/MixAndMatch/mixAndMatchStyles.d.ts +21 -0
  94. package/dist/components/blocks/MixAndMatch/mixAndMatchStyles.d.ts.map +1 -0
  95. package/dist/components/blocks/MixAndMatch/mixAndMatchTranslations.d.ts +37 -0
  96. package/dist/components/blocks/MixAndMatch/mixAndMatchTranslations.d.ts.map +1 -0
  97. package/dist/components/blocks/Quote/Quote.d.ts.map +1 -1
  98. package/dist/components/blocks/Quote/createQuoteBlock.d.ts +12 -0
  99. package/dist/components/blocks/Quote/createQuoteBlock.d.ts.map +1 -0
  100. package/dist/components/blocks/Quote/index.d.ts +2 -0
  101. package/dist/components/blocks/Quote/index.d.ts.map +1 -1
  102. package/dist/components/blocks/Quote/quoteTranslations.d.ts +13 -0
  103. package/dist/components/blocks/Quote/quoteTranslations.d.ts.map +1 -0
  104. package/dist/components/blocks/TabsBlock/TabsBlock.d.ts +4 -0
  105. package/dist/components/blocks/TabsBlock/TabsBlock.d.ts.map +1 -0
  106. package/dist/components/blocks/TabsBlock/createTabsBlock.d.ts +25 -0
  107. package/dist/components/blocks/TabsBlock/createTabsBlock.d.ts.map +1 -0
  108. package/dist/components/blocks/TabsBlock/getTabsBlockViewProps.d.ts +55 -0
  109. package/dist/components/blocks/TabsBlock/getTabsBlockViewProps.d.ts.map +1 -0
  110. package/dist/components/blocks/TabsBlock/index.d.ts +6 -0
  111. package/dist/components/blocks/TabsBlock/index.d.ts.map +1 -0
  112. package/dist/components/blocks/TabsBlock/tabsBlockPropsSchema.d.ts +127 -0
  113. package/dist/components/blocks/TabsBlock/tabsBlockPropsSchema.d.ts.map +1 -0
  114. package/dist/components/blocks/TabsBlock/tabsBlockTranslations.d.ts +13 -0
  115. package/dist/components/blocks/TabsBlock/tabsBlockTranslations.d.ts.map +1 -0
  116. package/dist/components/blocks/TabsBlock/useRovingTabIndex.d.ts +20 -0
  117. package/dist/components/blocks/TabsBlock/useRovingTabIndex.d.ts.map +1 -0
  118. package/dist/components/blocks/Text/Text.d.ts.map +1 -1
  119. package/dist/components/blocks/Text/createTextBlock.d.ts +12 -0
  120. package/dist/components/blocks/Text/createTextBlock.d.ts.map +1 -0
  121. package/dist/components/blocks/Text/index.d.ts +2 -0
  122. package/dist/components/blocks/Text/index.d.ts.map +1 -1
  123. package/dist/components/blocks/Text/textPropsSchema.d.ts +3 -3
  124. package/dist/components/blocks/Text/textTranslations.d.ts +11 -0
  125. package/dist/components/blocks/Text/textTranslations.d.ts.map +1 -0
  126. package/dist/components/blocks/TwoColumn/TwoColumn.d.ts +3 -0
  127. package/dist/components/blocks/TwoColumn/TwoColumn.d.ts.map +1 -0
  128. package/dist/components/blocks/TwoColumn/createTwoColumnBlock.d.ts +14 -0
  129. package/dist/components/blocks/TwoColumn/createTwoColumnBlock.d.ts.map +1 -0
  130. package/dist/components/blocks/TwoColumn/getTwoColumnViewProps.d.ts +17 -0
  131. package/dist/components/blocks/TwoColumn/getTwoColumnViewProps.d.ts.map +1 -0
  132. package/dist/components/blocks/TwoColumn/index.d.ts +5 -0
  133. package/dist/components/blocks/TwoColumn/index.d.ts.map +1 -0
  134. package/dist/components/blocks/TwoColumn/twoColumnPropsSchema.d.ts +60 -0
  135. package/dist/components/blocks/TwoColumn/twoColumnPropsSchema.d.ts.map +1 -0
  136. package/dist/components/blocks/TwoColumn/twoColumnStyles.d.ts +13 -0
  137. package/dist/components/blocks/TwoColumn/twoColumnStyles.d.ts.map +1 -0
  138. package/dist/components/blocks/VideoBlock/VideoBlock.d.ts.map +1 -1
  139. package/dist/components/blocks/VideoBlock/createVideoBlock.d.ts +15 -0
  140. package/dist/components/blocks/VideoBlock/createVideoBlock.d.ts.map +1 -0
  141. package/dist/components/blocks/VideoBlock/index.d.ts +3 -1
  142. package/dist/components/blocks/VideoBlock/index.d.ts.map +1 -1
  143. package/dist/components/blocks/VideoBlock/videoBlockTranslations.d.ts +23 -0
  144. package/dist/components/blocks/VideoBlock/videoBlockTranslations.d.ts.map +1 -0
  145. package/dist/components/blocks/WidgetBlock/WidgetBlock.d.ts +8 -0
  146. package/dist/components/blocks/WidgetBlock/WidgetBlock.d.ts.map +1 -0
  147. package/dist/components/blocks/WidgetBlock/WidgetErrorBoundary.d.ts +36 -0
  148. package/dist/components/blocks/WidgetBlock/WidgetErrorBoundary.d.ts.map +1 -0
  149. package/dist/components/blocks/WidgetBlock/createWidgetBlock.d.ts +14 -0
  150. package/dist/components/blocks/WidgetBlock/createWidgetBlock.d.ts.map +1 -0
  151. package/dist/components/blocks/WidgetBlock/index.d.ts +5 -0
  152. package/dist/components/blocks/WidgetBlock/index.d.ts.map +1 -0
  153. package/dist/components/blocks/WidgetBlock/widgetBlockPropsSchema.d.ts +26 -0
  154. package/dist/components/blocks/WidgetBlock/widgetBlockPropsSchema.d.ts.map +1 -0
  155. package/dist/components/blocks/WidgetBlock/widgetBlockTranslations.d.ts +18 -0
  156. package/dist/components/blocks/WidgetBlock/widgetBlockTranslations.d.ts.map +1 -0
  157. package/dist/components/blocks/commonSchemas.d.ts +13 -0
  158. package/dist/components/blocks/commonSchemas.d.ts.map +1 -1
  159. package/dist/components/blocks/commonViewProps.d.ts +23 -1
  160. package/dist/components/blocks/commonViewProps.d.ts.map +1 -1
  161. package/dist/components/blocks/richTextTableStyles.d.ts +10 -0
  162. package/dist/components/blocks/richTextTableStyles.d.ts.map +1 -0
  163. package/dist/contexts/BlockEditorApiContext.d.ts +61 -4
  164. package/dist/contexts/BlockEditorApiContext.d.ts.map +1 -1
  165. package/dist/contexts/BlockTranslationsContext.d.ts +47 -0
  166. package/dist/contexts/BlockTranslationsContext.d.ts.map +1 -0
  167. package/dist/contexts/RichTextRendererContext.d.ts +21 -0
  168. package/dist/contexts/RichTextRendererContext.d.ts.map +1 -0
  169. package/dist/index.d.ts +13 -2
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +3139 -758
  172. package/dist/registry/blockCatalogue.d.ts +108 -0
  173. package/dist/registry/blockCatalogue.d.ts.map +1 -0
  174. package/dist/registry/blockRegistry.d.ts +67 -0
  175. package/dist/registry/blockRegistry.d.ts.map +1 -0
  176. package/dist/registry/defineBlock.d.ts +55 -0
  177. package/dist/registry/defineBlock.d.ts.map +1 -0
  178. package/dist/registry/getMergedProps.d.ts +18 -0
  179. package/dist/registry/getMergedProps.d.ts.map +1 -0
  180. package/dist/registry/index.d.ts +7 -0
  181. package/dist/registry/index.d.ts.map +1 -0
  182. package/dist/registry/registryTypes.test.d.ts +1 -0
  183. package/dist/registry/registryTypes.test.d.ts.map +1 -0
  184. package/dist/registry/resolveBlockEntry.d.ts +16 -0
  185. package/dist/registry/resolveBlockEntry.d.ts.map +1 -0
  186. package/dist/registry/templateTypes.d.ts +61 -0
  187. package/dist/registry/templateTypes.d.ts.map +1 -0
  188. package/dist/schema/zodExtensions.d.ts +15 -0
  189. package/dist/schema/zodExtensions.d.ts.map +1 -1
  190. package/dist/utils/shuffleCards.d.ts +6 -0
  191. package/dist/utils/shuffleCards.d.ts.map +1 -0
  192. package/dist/utils/useMotionEnabled.d.ts +11 -0
  193. package/dist/utils/useMotionEnabled.d.ts.map +1 -0
  194. package/dist/viewer/Viewer.d.ts +27 -0
  195. package/dist/viewer/Viewer.d.ts.map +1 -0
  196. package/dist/viewer/index.d.ts +2 -0
  197. package/dist/viewer/index.d.ts.map +1 -0
  198. package/locales/en.json +44 -1
  199. package/package.json +39 -24
  200. package/dist/contexts/TranslationsContext.d.ts +0 -70
  201. package/dist/contexts/TranslationsContext.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTwoColumnViewProps.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/getTwoColumnViewProps.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,UAAU,EAGhB,MAAM,wBAAwB,CAAA;AA6B/B;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACnC,yFAAyF;IACzF,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,MAAM,GAClB,kBAAkB,CAkCpB"}
@@ -0,0 +1,5 @@
1
+ export { TwoColumn } from './TwoColumn';
2
+ export { RegisteredTwoColumnPropsSchema, TwoColumnDefaultProps } from './twoColumnPropsSchema';
3
+ export type { TwoColumnProps } from './twoColumnPropsSchema';
4
+ export { createTwoColumnBlock } from './createTwoColumnBlock';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAI9F,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { ReactNode } from 'react';
2
+ import { z } from 'zod';
3
+ export declare const MIN_LEFT_COLUMN_WIDTH = 20;
4
+ export declare const MAX_LEFT_COLUMN_WIDTH = 80;
5
+ export declare const DEFAULT_LEFT_COLUMN_WIDTH = 50;
6
+ export declare const GapSpacingSchema: z.ZodEnum<["none", "small", "medium", "large"]>;
7
+ export type GapSpacing = z.infer<typeof GapSpacingSchema>;
8
+ export declare const MobileStackingOrderSchema: z.ZodEnum<["left-first", "right-first"]>;
9
+ export type MobileStackingOrder = z.infer<typeof MobileStackingOrderSchema>;
10
+ export declare const ContainerStyleSchema: z.ZodEnum<["none", "outline", "solid"]>;
11
+ export type ContainerStyle = z.infer<typeof ContainerStyleSchema>;
12
+ /**
13
+ * The same three tones as `ColorThemeSchema` plus a transparent `none`, but only this
14
+ * block uses the set, so it stays local rather than moving to `commonSchemas`.
15
+ */
16
+ export declare const BackgroundColorSchema: z.ZodEnum<["none", "light", "dark", "neutral"]>;
17
+ export type BackgroundColor = z.infer<typeof BackgroundColorSchema>;
18
+ export declare const TwoColumnPropsSchema: z.ZodObject<{
19
+ children: z.ZodAny;
20
+ leftColumnWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
21
+ mobileStackingOrder: z.ZodOptional<z.ZodDefault<z.ZodEnum<["left-first", "right-first"]>>>;
22
+ gapSpacing: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "small", "medium", "large"]>>>;
23
+ containerStyle: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "outline", "solid"]>>>;
24
+ cornerStyle: z.ZodOptional<z.ZodDefault<z.ZodEnum<["rounded", "square"]>>>;
25
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "light", "dark", "neutral"]>>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ children?: any;
28
+ cornerStyle?: "rounded" | "square" | undefined;
29
+ leftColumnWidth?: number | undefined;
30
+ mobileStackingOrder?: "left-first" | "right-first" | undefined;
31
+ gapSpacing?: "small" | "none" | "medium" | "large" | undefined;
32
+ containerStyle?: "none" | "outline" | "solid" | undefined;
33
+ backgroundColor?: "light" | "dark" | "neutral" | "none" | undefined;
34
+ }, {
35
+ children?: any;
36
+ cornerStyle?: "rounded" | "square" | undefined;
37
+ leftColumnWidth?: number | undefined;
38
+ mobileStackingOrder?: "left-first" | "right-first" | undefined;
39
+ gapSpacing?: "small" | "none" | "medium" | "large" | undefined;
40
+ containerStyle?: "none" | "outline" | "solid" | undefined;
41
+ backgroundColor?: "light" | "dark" | "neutral" | "none" | undefined;
42
+ }>;
43
+ /**
44
+ * `children` is retyped off the schema's `z.any()`: the host passes React nodes, and the
45
+ * declaration emitter needs a public name for the resulting intersection.
46
+ */
47
+ export type TwoColumnProps = Omit<z.infer<typeof TwoColumnPropsSchema>, 'children'> & {
48
+ children?: ReactNode;
49
+ };
50
+ export declare const TwoColumnDefaultProps: Omit<TwoColumnProps, 'children'>;
51
+ export declare const RegisteredTwoColumnPropsSchema: import('../../..').RegisteredComponentSchema<{
52
+ children?: any;
53
+ cornerStyle?: "rounded" | "square" | undefined;
54
+ leftColumnWidth?: number | undefined;
55
+ mobileStackingOrder?: "left-first" | "right-first" | undefined;
56
+ gapSpacing?: "small" | "none" | "medium" | "large" | undefined;
57
+ containerStyle?: "none" | "outline" | "solid" | undefined;
58
+ backgroundColor?: "light" | "dark" | "neutral" | "none" | undefined;
59
+ }>;
60
+ //# sourceMappingURL=twoColumnPropsSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twoColumnPropsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/twoColumnPropsSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAE3C,eAAO,MAAM,gBAAgB,iDAA+C,CAAA;AAC5E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,yBAAyB,0CAAwC,CAAA;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,oBAAoB,yCAAuC,CAAA;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,iDAA+C,CAAA;AACjF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;EAiD/B,CAAA;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAOlE,CAAA;AAID,eAAO,MAAM,8BAA8B;;;;;;;;EAG1C,CAAA"}
@@ -0,0 +1,13 @@
1
+ export declare const TWO_COLUMN_CLASS: {
2
+ /**
3
+ * The outermost element. It carries `container-type`, so it is also the ancestor the
4
+ * `@container` rule resolves against — which is why the grid has to be a separate
5
+ * element inside it rather than this one.
6
+ */
7
+ readonly root: "bce-block-twocolumn";
8
+ readonly grid: "bce-twocolumn-grid";
9
+ readonly gridReverse: "bce-twocolumn-grid-reverse";
10
+ };
11
+ /** Injects the block's CSS. Rendered by the block; emotion inserts it once. */
12
+ export declare function TwoColumnStyles(): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=twoColumnStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twoColumnStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/twoColumnStyles.tsx"],"names":[],"mappings":"AAiCA,eAAO,MAAM,gBAAgB;IAC3B;;;;OAIG;;;;CAIK,CAAA;AAqDV,+EAA+E;AAC/E,wBAAgB,eAAe,4CAE9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"VideoBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/VideoBlock.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAY9D,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAe,EACf,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAU,EACV,KAAgB,EAChB,WAAuB,GACxB,EAAE,eAAe,2CAoHjB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAU,EACV,KAAgB,EAChB,WAAuB,GACxB,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC,CAAC,2CA4BlE"}
1
+ {"version":3,"file":"VideoBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/VideoBlock.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAY9D,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAe,EACf,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAU,EACV,KAAgB,EAChB,WAAuB,GACxB,EAAE,eAAe,2CAoHjB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAU,EACV,KAAgB,EAChB,WAAuB,GACxB,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC,CAAC,2CA4BlE"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registry entry factory for VideoBlock, registered under the wire name `VideoBlock` — that string is
3
+ * what stored documents contain, and renaming it orphans them. It owns strings, so the host supplies its
4
+ * `VideoBlockTranslations` here; anything omitted falls back to bundled English.
5
+ */
6
+ export declare const createVideoBlock: (options: import('../../..').BlockFactoryOptions<import('./videoBlockTranslations').VideoBlockTranslations>) => import('../../..').BlockRegistryEntry<{
7
+ alt: string;
8
+ size: number;
9
+ source: "link" | "file";
10
+ align: "left" | "center" | "right";
11
+ asset_id: string;
12
+ cornerStyle?: "rounded" | "square" | undefined;
13
+ video_url?: string | undefined;
14
+ }>;
15
+ //# sourceMappingURL=createVideoBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createVideoBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/createVideoBlock.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;EAO3B,CAAA"}
@@ -1,3 +1,5 @@
1
1
  export { VideoBlock, VideoBlockDragPreview } from './VideoBlock';
2
- export { RegisteredVideoBlockPropsSchema, VideoBlockDefaultProps } from './videoBlockPropsSchema';
2
+ export { RegisteredVideoBlockPropsSchema, VideoBlockDefaultProps, type VideoSource, VideoSourceSchema, } from './videoBlockPropsSchema';
3
+ export { createVideoBlock } from './createVideoBlock';
4
+ export { VideoBlockEnglish, type VideoBlockTranslations } from './videoBlockTranslations';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,WAAW,EAChB,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Strings owned by the VideoBlock block. The host supplies these when it registers the
3
+ * block; anything it omits falls back to the English below.
4
+ */
5
+ export interface VideoBlockTranslations {
6
+ /** Placeholder shown when a VideoBlock has no video (designer / empty link). */
7
+ videoBlockPlaceholder: string;
8
+ /** Announced while a VideoBlock's file is loading. */
9
+ videoBlockLoading: string;
10
+ /** Shown when a VideoBlock's video fails to load. */
11
+ videoBlockError: string;
12
+ /** Shown when a VideoBlock's link is not a supported provider. */
13
+ videoBlockUnsupportedProvider: string;
14
+ /** Heading shown while a VideoBlock's media is still processing. */
15
+ videoBlockProcessing: string;
16
+ /** Sub-message shown while a VideoBlock's media is still processing. */
17
+ videoBlockProcessingSubtitle: string;
18
+ /** Fallback iframe title when a VideoBlock has no alt text. */
19
+ videoBlockTitle: string;
20
+ }
21
+ /** English bundled with this package — also the source for `locales/en.json`. */
22
+ export declare const VideoBlockEnglish: VideoBlockTranslations;
23
+ //# sourceMappingURL=videoBlockTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"videoBlockTranslations.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/VideoBlock/videoBlockTranslations.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,qBAAqB,EAAE,MAAM,CAAA;IAC7B,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAA;IACzB,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAA;IACvB,kEAAkE;IAClE,6BAA6B,EAAE,MAAM,CAAA;IACrC,oEAAoE;IACpE,oBAAoB,EAAE,MAAM,CAAA;IAC5B,wEAAwE;IACxE,4BAA4B,EAAE,MAAM,CAAA;IACpC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,sBAS/B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { WidgetBlockProps } from './widgetBlockPropsSchema';
2
+ /**
3
+ * Slot for a host-supplied widget. The block stores only an opaque `widgetType`
4
+ * and renders whatever the host's `useWidget` resolves it to — the widgets
5
+ * themselves, and the vocabulary naming them, stay with the host.
6
+ */
7
+ export declare function WidgetBlock({ widgetType }: WidgetBlockProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=WidgetBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WidgetBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/WidgetBlock.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAyChE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,UAAe,EAAE,EAAE,gBAAgB,2CAkBhE"}
@@ -0,0 +1,36 @@
1
+ import { Component, ReactNode } from 'react';
2
+ interface WidgetErrorBoundaryProps {
3
+ /** Rendered in place of the widget once it has thrown. */
4
+ fallback: ReactNode;
5
+ children: ReactNode;
6
+ }
7
+ interface WidgetErrorBoundaryState {
8
+ hasError: boolean;
9
+ }
10
+ /**
11
+ * Contains the host's failures to the block they happen in — the widget's own render,
12
+ * and the `useWidget` that resolves it, since the caller keeps both below this
13
+ * boundary. A throwing component unmounts every ancestor up to the nearest boundary,
14
+ * so without one here a single broken widget or resolver blanks the whole editor or
15
+ * learner page.
16
+ *
17
+ * It is a page-saving guard, not error reporting: it catches nothing outside that
18
+ * subtree and reports nowhere, so a host that wants widget failures in its telemetry
19
+ * keeps its own boundary above the provider. Recovery is by remount — the caller keys this on
20
+ * `widgetType` — because a boundary cannot tell whether the thing that threw has
21
+ * since been fixed.
22
+ *
23
+ * Scope is React's: render, lifecycle and effect failures. A throw from an event
24
+ * handler or a rejected promise reaches no boundary — and unmounts nothing either,
25
+ * so it is not the failure this guards against.
26
+ *
27
+ * The only class component in the package: `getDerivedStateFromError` has no hook
28
+ * equivalent.
29
+ */
30
+ export declare class WidgetErrorBoundary extends Component<WidgetErrorBoundaryProps, WidgetErrorBoundaryState> {
31
+ state: WidgetErrorBoundaryState;
32
+ static getDerivedStateFromError(): WidgetErrorBoundaryState;
33
+ render(): ReactNode;
34
+ }
35
+ export {};
36
+ //# sourceMappingURL=WidgetErrorBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WidgetErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/WidgetErrorBoundary.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjD,UAAU,wBAAwB;IAChC,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,wBAAwB;IAChC,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,mBAAoB,SAAQ,SAAS,CAChD,wBAAwB,EACxB,wBAAwB,CACzB;IACC,KAAK,EAAE,wBAAwB,CAAsB;IAErD,MAAM,CAAC,wBAAwB,IAAI,wBAAwB;IAI3D,MAAM,IAAI,SAAS;CAGpB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Registry entry factory for WidgetBlock, registered under the wire name `WidgetBlock` — that
3
+ * string is what stored documents contain, and renaming it orphans them. It owns strings, so the
4
+ * host supplies its `WidgetBlockTranslations` here; anything omitted falls back to bundled English.
5
+ *
6
+ * This entry carries the package's open `widgetType`. A host that narrows it to its own widget
7
+ * names (see `index.ts`) also owns the entry's schema and defaults, so it builds its entry from
8
+ * `defineBlock` directly rather than calling this — passing `WidgetBlockEnglish` as `english`,
9
+ * which keeps the strings side identical.
10
+ */
11
+ export declare const createWidgetBlock: (options: import('../../..').BlockFactoryOptions<import('./widgetBlockTranslations').WidgetBlockTranslations>) => import('../../..').BlockRegistryEntry<{
12
+ widgetType: string;
13
+ }>;
14
+ //# sourceMappingURL=createWidgetBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createWidgetBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/createWidgetBlock.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;EAM5B,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { WidgetBlock } from './WidgetBlock';
2
+ export { RegisteredWidgetBlockPropsSchema, WidgetBlockDefaultProps, WidgetBlockPropsSchema, } from './widgetBlockPropsSchema';
3
+ export { createWidgetBlock } from './createWidgetBlock';
4
+ export { WidgetBlockEnglish, type WidgetBlockTranslations } from './widgetBlockTranslations';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/index.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const WidgetBlockPropsSchema: z.ZodObject<{
3
+ /**
4
+ * Opaque host widget identifier, resolved to a component via `useWidget`. Kept a
5
+ * free string on purpose: the widgets on offer belong to the host product, so a
6
+ * closed enum here would bind this package to one host's vocabulary. A host that
7
+ * wants its own set validated narrows this schema itself — see the block's
8
+ * `index.ts`. `''` means "not configured yet", as an empty `asset_id` does.
9
+ */
10
+ widgetType: z.ZodDefault<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ widgetType: string;
13
+ }, {
14
+ widgetType?: string | undefined;
15
+ }>;
16
+ export type WidgetBlockProps = z.infer<typeof WidgetBlockPropsSchema>;
17
+ /**
18
+ * Defaults for an unconfigured block. A host that narrows `widgetType` to its own
19
+ * enum declares its own defaults instead: `''` is by construction not a member of
20
+ * that enum, so these would fail its stricter gate.
21
+ */
22
+ export declare const WidgetBlockDefaultProps: WidgetBlockProps;
23
+ export declare const RegisteredWidgetBlockPropsSchema: import('../../..').RegisteredComponentSchema<{
24
+ widgetType: string;
25
+ }>;
26
+ //# sourceMappingURL=widgetBlockPropsSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgetBlockPropsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/widgetBlockPropsSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,+BAA+B,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,sBAAsB;IACjC;;;;;;OAMG;;;;;;EAEH,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAErC,CAAA;AAED,eAAO,MAAM,gCAAgC;;EAG5C,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Strings owned by the WidgetBlock block. The host supplies these when it registers the
3
+ * block; anything it omits falls back to the English below.
4
+ *
5
+ * None of them name a widget: the vocabulary belongs to the host, so these describe the
6
+ * slot's state only.
7
+ */
8
+ export interface WidgetBlockTranslations {
9
+ /** Placeholder shown in the designer when a WidgetBlock has no widget chosen. */
10
+ widgetBlockPlaceholder: string;
11
+ /** Shown while the host is resolving a WidgetBlock's widget. */
12
+ widgetBlockLoading: string;
13
+ /** Shown when the host cannot supply the requested widget. */
14
+ widgetBlockError: string;
15
+ }
16
+ /** English bundled with this package — also the source for `locales/en.json`. */
17
+ export declare const WidgetBlockEnglish: WidgetBlockTranslations;
18
+ //# sourceMappingURL=widgetBlockTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgetBlockTranslations.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/WidgetBlock/widgetBlockTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,sBAAsB,EAAE,MAAM,CAAA;IAC9B,gEAAgE;IAChE,kBAAkB,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,EAAE,uBAIhC,CAAA"}
@@ -14,4 +14,17 @@ export type ColorTheme = z.infer<typeof ColorThemeSchema>;
14
14
  /** Semantic heading level for a block's heading region. Used by Banner and Accordion. */
15
15
  export declare const HeadingLevelSchema: z.ZodEnum<["h2", "h3", "h4"]>;
16
16
  export type HeadingLevel = z.infer<typeof HeadingLevelSchema>;
17
+ /**
18
+ * Emphasis a block's *heading region* is filled with — the whole surface for Banner,
19
+ * the question band for KnowledgeCheck. Distinct from `ColorThemeSchema`: `none` is
20
+ * a transparent surface, and there is no un-branded `neutral` option.
21
+ */
22
+ export declare const HeaderStyleSchema: z.ZodEnum<["none", "light", "dark"]>;
23
+ export type HeaderStyle = z.infer<typeof HeaderStyleSchema>;
24
+ /**
25
+ * Ships with the schema rather than being retyped per block: two copies of one sentence
26
+ * about one resolver (`getHeaderStyleStyling`) is how help text drifts from what the
27
+ * option actually renders. `light` is a brand-color fill, not a tint.
28
+ */
29
+ export declare const HEADER_STYLE_HELP = "None: transparent; Light: brand color; Dark: dark surface \u2014 both with contrasting text";
17
30
  //# sourceMappingURL=commonSchemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonSchemas.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/commonSchemas.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,kCAAgC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,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AC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gGAC4D,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import { View } from '@instructure/ui-view';
2
2
  import { ComponentProps } from 'react';
3
- import { Align } from './commonSchemas';
3
+ import { Styling } from './brandTheming';
4
+ import { Align, ColorTheme, HeaderStyle } from './commonSchemas';
4
5
  type ViewProps = ComponentProps<typeof View>;
5
6
  /** Horizontal alignment as a `View` `textAlign` token. */
6
7
  export declare const ALIGN_TEXT: Record<Align, NonNullable<ViewProps['textAlign']>>;
@@ -15,5 +16,26 @@ export interface MediaBlockViewProps {
15
16
  aspectRatio: string;
16
17
  borderRadius: NonNullable<ViewProps['borderRadius']>;
17
18
  }
19
+ /**
20
+ * Styling for a block's heading region. `light`/`dark` are branded fills matching the
21
+ * requested tone; `none` is transparent, so it takes no brand color and leaves the
22
+ * text on whatever surface sits behind it.
23
+ */
24
+ export declare function getHeaderStyleStyling(headerStyle: HeaderStyle, brandColor?: string): Styling;
25
+ export interface ThemedContainer {
26
+ styling: Styling;
27
+ /**
28
+ * Whether the resolved surface is dark. InstUI derives a control's own colors from
29
+ * the theme, not from whatever it happens to be sitting on, so anything that has to
30
+ * contrast with *this* surface — a focus ring, a progress meter — needs telling.
31
+ */
32
+ isDarkSurface: boolean;
33
+ }
34
+ /**
35
+ * Container styling for a `colorTheme`, branded wherever the host supplies a color.
36
+ * `neutral` is deliberately un-branded, and a brand fill keeps the hairline that
37
+ * `brandFillStyling` would otherwise drop.
38
+ */
39
+ export declare function getThemedContainerStyling(colorTheme: ColorTheme, brandColor?: string): ThemedContainer;
18
40
  export {};
19
41
  //# sourceMappingURL=commonViewProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonViewProps.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/commonViewProps.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,C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;IACnB,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;CACrD;AAwBD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAK5F;AAmBD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAiBjB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Class name for containers that render sanitized RCE HTML. Blocks that opt
3
+ * in to table cell styling add this class to their `dangerouslySetInnerHTML`
4
+ * container. Currently used by Text; other rich-text blocks (Accordion,
5
+ * TabsBlock) can adopt it when table support is needed there.
6
+ */
7
+ export declare const RICH_TEXT_CLASS = "bce-rich-text";
8
+ /** Injects table cell styles for `.bce-rich-text` containers. Rendered per block that uses it. */
9
+ export declare function RichTextTableStyles(): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=richTextTableStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"richTextTableStyles.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/richTextTableStyles.tsx"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kBAAkB,CAAA;AA+B9C,kGAAkG;AAClG,wBAAgB,mBAAmB,4CAElC"}
@@ -1,3 +1,4 @@
1
+ import { ComponentType } from 'react';
1
2
  /**
2
3
  * A resolved image asset. `url` is the direct, displayable file URL (rendered
3
4
  * in `<img>`); `undefined` while loading or on error.
@@ -25,8 +26,49 @@ export interface ResolvedVideo {
25
26
  isProcessing?: boolean;
26
27
  isError: boolean;
27
28
  }
29
+ /** The props `WidgetBlock` renders a host widget with. */
30
+ export interface WidgetComponentProps {
31
+ /**
32
+ * The identifier the block stored, handed back so one parameterised host component
33
+ * can serve several widget names. Without it such a host would have to wrap the
34
+ * component per name, and the natural wrapper is the fresh arrow the stability rule
35
+ * below forbids. Optional so a host whose widgets take no props stays assignable;
36
+ * the block always passes it. A *change* of name remounts the widget rather than
37
+ * updating it in place — a different name is a different widget — so such a
38
+ * component reads this once and never has to transition between widgets.
39
+ */
40
+ widgetType?: string;
41
+ }
42
+ /**
43
+ * A resolved widget. `Component` is the host's own component for the requested
44
+ * widget; `undefined` while loading or when the host does not recognise the
45
+ * identifier.
46
+ *
47
+ * `Component` must be a **stable reference** for a given `widgetType` — resolve it
48
+ * from a module-level map, not an arrow function built inside the hook. React
49
+ * remounts on component identity, so a fresh reference each render throws away
50
+ * whatever state the widget holds, on every render of the block.
51
+ *
52
+ * A widget that throws while rendering — or a `useWidget` that throws, which runs inside
53
+ * the same boundary — is contained to its own block, which shows the error placeholder
54
+ * in its place. That guard exists because the alternative is the
55
+ * whole page unmounting, not because the package can handle the failure: it catches
56
+ * only the widget and reports nowhere, so a host that wants widget failures in its
57
+ * telemetry keeps its own error boundary above the provider.
58
+ */
59
+ export interface ResolvedWidget {
60
+ Component?: ComponentType<WidgetComponentProps>;
61
+ isLoading: boolean;
62
+ isError: boolean;
63
+ }
28
64
  export type UseImageUrl = (assetId: string) => ResolvedImage;
29
65
  export type UseVideoUrl = (assetId: string) => ResolvedVideo;
66
+ /**
67
+ * `widgetType` is an opaque host identifier, like an `assetId`: the package never
68
+ * owns the vocabulary of widget names, so an unrecognised one is an error result,
69
+ * not an invalid value.
70
+ */
71
+ export type UseWidget = (widgetType: string) => ResolvedWidget;
30
72
  /**
31
73
  * The host-injected data hooks the blocks call to resolve an opaque `asset_id`
32
74
  * to the URL they render. The host owns the fetch (e.g. Canvas Files API via
@@ -44,15 +86,28 @@ export type UseVideoUrl = (assetId: string) => ResolvedVideo;
44
86
  * stable value).
45
87
  *
46
88
  * Calling unconditionally also means an unconfigured block passes an empty
47
- * `assetId`, so a hook must treat `''` as "nothing to resolve": don't fetch, and
48
- * report neither loading nor error (`{isLoading: false, isError: false}` with no
49
- * `url` — with react-query, `enabled: !!assetId`). The block ignores that result:
50
- * an unconfigured block renders the authoring placeholder inside the editor canvas
89
+ * identifier — `assetId`, or `widgetType` for `useWidget` so a hook must treat
90
+ * `''` as "nothing to resolve": don't fetch, and report neither loading nor error
91
+ * (`{isLoading: false, isError: false}` with no `url`/`Component` with
92
+ * react-query, `enabled: !!assetId`). The block ignores that result: an
93
+ * unconfigured block renders the authoring placeholder inside the editor canvas
51
94
  * and nothing outside it, so a hook that fetches for `''` only wastes a request.
95
+ *
96
+ * For any other identifier, though, a result that reports neither loading nor
97
+ * anything resolved reads as a failure: the blocks show the error placeholder. A hook
98
+ * that can sit idle for a real identifier (a query not yet enabled, say) must report
99
+ * `isLoading: true` until it settles, or the block flashes an error it will replace.
100
+ *
101
+ * A hook **reports** failure rather than raising it: `isError`, never a throw and never
102
+ * a suspend. `WidgetBlock` happens to run its hook inside its own error boundary, so a
103
+ * throw there degrades to the error placeholder instead of the page, but the other
104
+ * blocks have no such guard, and nothing here provides the `Suspense` a suspending hook
105
+ * needs (a react-query resolver wants `throwOnError: false` and a plain `useQuery`).
52
106
  */
53
107
  export interface BlockEditorApi {
54
108
  useImageUrl?: UseImageUrl;
55
109
  useVideoUrl?: UseVideoUrl;
110
+ useWidget?: UseWidget;
56
111
  }
57
112
  export declare const BlockEditorApiContext: import('react').Context<BlockEditorApi>;
58
113
  export declare const BlockEditorApiProvider: import('react').Provider<BlockEditorApi>;
@@ -60,4 +115,6 @@ export declare const BlockEditorApiProvider: import('react').Provider<BlockEdito
60
115
  export declare const useImageUrl: (assetId: string) => ResolvedImage;
61
116
  /** Resolve a video asset id via the host-provided `useVideoUrl` hook. */
62
117
  export declare const useVideoUrl: (assetId: string) => ResolvedVideo;
118
+ /** Resolve a widget identifier to the host's component via the `useWidget` hook. */
119
+ export declare const useWidget: (widgetType: string) => ResolvedWidget;
63
120
  //# sourceMappingURL=BlockEditorApiContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockEditorApiContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockEditorApiContext.tsx"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAAA;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAAA;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAMD,eAAO,MAAM,qBAAqB,yCAAoC,CAAA;AAEtE,eAAO,MAAM,sBAAsB,0CAAiC,CAAA;AAEpE,0EAA0E;AAC1E,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,aAG7C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,aAG7C,CAAA"}
1
+ {"version":3,"file":"BlockEditorApiContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockEditorApiContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,aAAa,EAA6B,MAAM,OAAO,CAAA;AAErE;;;GAGG;AAC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AG7C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,aAG7C,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,SAAS,GAAI,YAAY,MAAM,KAAG,cAG9C,CAAA"}
@@ -0,0 +1,47 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Strings for one block, supplied by the host when it registers that block
4
+ * (`create<Name>Block({ translations })`). Scoping them this way is what lets a host
5
+ * translate only the blocks it actually uses — an unregistered block never asks for
6
+ * anything.
7
+ */
8
+ export type BlockTranslationValues = Record<string, string>;
9
+ export interface BlockTranslationsProviderProps<T> {
10
+ value: T;
11
+ children: ReactNode;
12
+ }
13
+ /**
14
+ * Wraps a single block. Placed by `create<Name>Block`, not by the renderer, so every
15
+ * consumer — this package's viewer, a host's designer, or a bare `<Text />` — behaves the
16
+ * same.
17
+ */
18
+ export declare function BlockTranslationsProvider<T extends AllStringValues<T>>({ value, children, }: BlockTranslationsProviderProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * "Every property is a string", expressed so that an `interface` satisfies it.
21
+ * `Record<string, string>` would not: an interface gets no implicit index signature, so
22
+ * every block's `<Name>Translations` — and every host block's — would be rejected.
23
+ */
24
+ export type AllStringValues<T> = {
25
+ [K in keyof T]: string;
26
+ };
27
+ export interface BlockTranslations<T> {
28
+ /** Fully resolved strings — every key present, whatever the host supplied. */
29
+ translations: T;
30
+ /** Resolve a key and substitute its `%{…}` placeholders. */
31
+ translate: (key: keyof T & string, vars?: Record<string, unknown>) => string;
32
+ }
33
+ /**
34
+ * Resolves a block's strings: the English bundled with this package, overridden by
35
+ * whatever a `BlockTranslationsProvider` above supplies — which in practice is what the
36
+ * host passed to `create<Name>Block({ translations })`.
37
+ *
38
+ * The English fallback means a bare `<Text />` renders with no provider at all, so tests,
39
+ * stories and direct use need no setup, and a host that forgets a key degrades to English
40
+ * rather than showing a raw key.
41
+ *
42
+ * Nothing else is needed for strings the *package* owns outside any block (designer
43
+ * chrome, say): give them their own slice and call this hook with it. There is
44
+ * deliberately no separate "base translations" provider — this one already generalises.
45
+ */
46
+ export declare function useBlockTranslations<T extends AllStringValues<T>>(fallback: T): BlockTranslations<T>;
47
+ //# sourceMappingURL=BlockTranslationsContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTranslationsContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockTranslationsContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAI3D,MAAM,WAAW,8BAA8B,CAAC,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,EACtE,KAAK,EACL,QAAQ,GACT,EAAE,8BAA8B,CAAC,CAAC,CAAC,2CAMnC;AAcD;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAAE,CAAA;AAE3D,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,8EAA8E;IAC9E,YAAY,EAAE,CAAC,CAAA;IACf,4DAA4D;IAC5D,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAA;CAC7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAC/D,QAAQ,EAAE,CAAC,GACV,iBAAiB,CAAC,CAAC,CAAC,CAoBtB"}
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Renders a rich-text HTML string into React nodes. A host injects one to run
4
+ * RCE-authored content through its own pipeline (e.g. Canvas file-link
5
+ * rewriting, inline file previews, media enhancement, MathJax) instead of the
6
+ * blocks' plain sanitized-HTML fallback.
7
+ *
8
+ * SECURITY: the renderer receives the **raw, unsanitized** HTML — the blocks do
9
+ * not sanitize on this path. A host that injects a renderer owns sanitization
10
+ * and MUST sanitize the html itself, or it opens an XSS hole.
11
+ */
12
+ export type RichTextRenderer = (html: string) => ReactNode;
13
+ /**
14
+ * The host's rich-text renderer, or `undefined` when none is provided — in which
15
+ * case the blocks fall back to `sanitizeHtml` + `dangerouslySetInnerHTML`. The
16
+ * host (e.g. a learner page) provides the value; consumers that don't need a
17
+ * custom pipeline (storybook, the designer, a bare render) leave it `undefined`.
18
+ */
19
+ export declare const RichTextRendererContext: import('react').Context<RichTextRenderer | undefined>;
20
+ export declare const useRichTextRenderer: () => RichTextRenderer | undefined;
21
+ //# sourceMappingURL=RichTextRendererContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextRendererContext.d.ts","sourceRoot":"","sources":["../../src/contexts/RichTextRendererContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,uDAAyD,CAAA;AAE7F,eAAO,MAAM,mBAAmB,QAAO,gBAAgB,GAAG,SACrB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -5,9 +5,20 @@ export * from './components/blocks/Quote';
5
5
  export * from './components/blocks/CodeBlock';
6
6
  export * from './components/blocks/ImageBlock';
7
7
  export * from './components/blocks/VideoBlock';
8
- export { BlockEditorApiContext, BlockEditorApiProvider, useImageUrl, useVideoUrl, type BlockEditorApi, type ResolvedImage, type ResolvedVideo, type UseImageUrl, type UseVideoUrl, } from './contexts/BlockEditorApiContext';
8
+ export * from './components/blocks/TabsBlock';
9
+ export * from './components/blocks/FlashCards';
10
+ export * from './components/blocks/MixAndMatch';
11
+ export * from './components/blocks/KnowledgeCheck';
12
+ export * from './components/blocks/LayoutContainer';
13
+ export * from './components/blocks/TwoColumn';
14
+ export * from './components/blocks/WidgetBlock';
15
+ export { HeaderStyleSchema, type HeaderStyle } from './components/blocks/commonSchemas';
16
+ export * from './registry';
17
+ export * from './viewer';
18
+ export { BlockTranslationsProvider, useBlockTranslations, type AllStringValues, type BlockTranslations, type BlockTranslationValues, } from './contexts/BlockTranslationsContext';
19
+ export { BlockEditorApiContext, BlockEditorApiProvider, useImageUrl, useVideoUrl, useWidget, type BlockEditorApi, type ResolvedImage, type ResolvedVideo, type ResolvedWidget, type UseImageUrl, type UseVideoUrl, type UseWidget, type WidgetComponentProps, } from './contexts/BlockEditorApiContext';
9
20
  export { BrandColorContext, useBrandColor } from './contexts/BrandColorContext';
10
21
  export { DesignerModeContext, useDesignerMode } from './contexts/DesignerModeContext';
11
- export { TranslationsProvider, useTranslations, type BlockContentEditorTranslations, type BlockContentEditorTranslationsContext, type TranslateFunction, type TranslationsProviderProps, } from './contexts/TranslationsContext';
22
+ export { RichTextRendererContext, useRichTextRenderer, type RichTextRenderer, } from './contexts/RichTextRendererContext';
12
23
  export * from './schema';
13
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAG9C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,WA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