@instructure/platform-block-content-editor 1.1.0 → 2.1.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.
- package/README.md +17 -5
- package/dist/components/blocks/Banner/Banner.d.ts +5 -2
- package/dist/components/blocks/Banner/Banner.d.ts.map +1 -1
- package/dist/components/blocks/Banner/bannerPropsSchema.d.ts +41 -4
- package/dist/components/blocks/Banner/bannerPropsSchema.d.ts.map +1 -1
- package/dist/components/blocks/Banner/bannerTranslations.d.ts +4 -0
- package/dist/components/blocks/Banner/bannerTranslations.d.ts.map +1 -1
- package/dist/components/blocks/Banner/createBannerBlock.d.ts +8 -1
- package/dist/components/blocks/Banner/createBannerBlock.d.ts.map +1 -1
- package/dist/components/blocks/Banner/getBannerViewProps.d.ts +48 -2
- package/dist/components/blocks/Banner/getBannerViewProps.d.ts.map +1 -1
- package/dist/components/blocks/KnowledgeCheck/createKnowledgeCheckBlock.d.ts +1 -1
- package/dist/components/blocks/KnowledgeCheck/knowledgeCheckPropsSchema.d.ts +3 -3
- package/dist/components/blocks/LayoutContainer/LayoutContainer.d.ts.map +1 -1
- package/dist/components/blocks/Text/getTextViewProps.d.ts.map +1 -1
- package/dist/components/blocks/commonViewProps.d.ts +12 -0
- package/dist/components/blocks/commonViewProps.d.ts.map +1 -1
- package/dist/editor/BlockContentEditor.d.ts +5 -2
- package/dist/editor/BlockContentEditor.d.ts.map +1 -1
- package/dist/editor/preview/PreviewArea.d.ts +10 -13
- package/dist/editor/preview/PreviewArea.d.ts.map +1 -1
- package/dist/editor/preview/index.d.ts +0 -1
- package/dist/editor/preview/index.d.ts.map +1 -1
- package/dist/editor/preview/previewStyles.d.ts +7 -8
- package/dist/editor/preview/previewStyles.d.ts.map +1 -1
- package/dist/editor/sidebar/panel/DesignerSideBar.d.ts +3 -1
- package/dist/editor/sidebar/panel/DesignerSideBar.d.ts.map +1 -1
- package/dist/editor/sidebar/panel/types.d.ts +3 -0
- package/dist/editor/sidebar/panel/types.d.ts.map +1 -1
- package/dist/editor/sidebar/tray/BlockTray.d.ts.map +1 -1
- package/dist/editor/sidebar/tray/TemplatesPanel.d.ts.map +1 -1
- package/dist/index.js +5587 -5420
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/schemaRegistry.d.ts +173 -0
- package/dist/schema/schemaRegistry.d.ts.map +1 -0
- package/dist/schema/schemaRegistry.test.d.ts +2 -0
- package/dist/schema/schemaRegistry.test.d.ts.map +1 -0
- package/dist/schema/zodUtils.d.ts +2 -1
- package/dist/schema/zodUtils.d.ts.map +1 -1
- package/dist/viewer/Viewer.d.ts +3 -1
- package/dist/viewer/Viewer.d.ts.map +1 -1
- package/dist/viewer/viewerStyles.d.ts +12 -0
- package/dist/viewer/viewerStyles.d.ts.map +1 -0
- package/locales/en.json +2 -3
- package/package.json +3 -2
- package/dist/editor/preview/previewTranslations.d.ts +0 -18
- package/dist/editor/preview/previewTranslations.d.ts.map +0 -1
package/dist/schema/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { parseDescription, type ZodFormMetadata, type ZodRangeConfig, type ZodHi
|
|
|
2
2
|
export { validateComponentSchema, type ValidationError, type ValidationIssue, type ValidationResult, } from './schemaValidator';
|
|
3
3
|
export { registerComponentSchema, type RegisteredComponentSchema, } from './registeredSchema';
|
|
4
4
|
export { FormFieldType, type FormFieldMetadata, extractFieldMetadata, extractFormMetadata, } from './zodUtils';
|
|
5
|
+
export { getBlockSchema, mapFieldsWithMetadata, type BlockSchema, type MetadataKey, } from './schemaRegistry';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAmBA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAA;AAK3B,OAAO,EACL,aAAa,EACb,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAmBA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAA;AAK3B,OAAO,EACL,aAAa,EACb,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { BlockName } from '../registry/blockCatalogue';
|
|
2
|
+
import { RegisteredComponentSchema } from './registeredSchema';
|
|
3
|
+
declare const BLOCK_SCHEMAS: {
|
|
4
|
+
Accordion: RegisteredComponentSchema<{
|
|
5
|
+
items: {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}[];
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
variant?: "h2" | "h3" | "h4" | undefined;
|
|
12
|
+
supportingText?: string | undefined;
|
|
13
|
+
accordionStyle?: "outline" | "solid" | undefined;
|
|
14
|
+
colorTheme?: "light" | "dark" | "neutral" | undefined;
|
|
15
|
+
connection?: "connected" | "separated" | undefined;
|
|
16
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
17
|
+
dropdownPlacement?: "left" | "right" | undefined;
|
|
18
|
+
dropdownDirection?: "center" | "down" | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
Header: RegisteredComponentSchema<{
|
|
21
|
+
title: string;
|
|
22
|
+
variant: "h2" | "h3" | "h4";
|
|
23
|
+
content?: string | undefined;
|
|
24
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
25
|
+
alt?: string | undefined;
|
|
26
|
+
style?: "image" | "none" | "outline" | "solid" | undefined;
|
|
27
|
+
color?: "light" | "dark" | "neutral" | undefined;
|
|
28
|
+
align?: "left" | "center" | "right" | undefined;
|
|
29
|
+
subtitle?: string | undefined;
|
|
30
|
+
eyebrowStyle?: "all-caps" | "sentence-case" | "capitalized" | undefined;
|
|
31
|
+
imagePlacement?: "background" | "above" | "below" | undefined;
|
|
32
|
+
asset_id?: string | undefined;
|
|
33
|
+
isDecorative?: boolean | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
CodeBlock: RegisteredComponentSchema<{
|
|
36
|
+
code: string;
|
|
37
|
+
language: "html" | "text" | "javascript" | "json" | "css" | "bash" | "yaml";
|
|
38
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
39
|
+
header?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
FlashCards: RegisteredComponentSchema<{
|
|
42
|
+
cards: {
|
|
43
|
+
front: string;
|
|
44
|
+
back: string;
|
|
45
|
+
}[];
|
|
46
|
+
colorTheme?: "light" | "dark" | "neutral" | undefined;
|
|
47
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
48
|
+
randomize?: boolean | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
ImageBlock: RegisteredComponentSchema<{
|
|
51
|
+
alt: string;
|
|
52
|
+
size: number;
|
|
53
|
+
align: "left" | "center" | "right";
|
|
54
|
+
asset_id: string;
|
|
55
|
+
isDecorative: boolean;
|
|
56
|
+
ratio: "square" | "circle" | "landscape" | "portrait";
|
|
57
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
KnowledgeCheckBlock: RegisteredComponentSchema<{
|
|
60
|
+
answers: {
|
|
61
|
+
id: string;
|
|
62
|
+
label: string;
|
|
63
|
+
isCorrect: boolean;
|
|
64
|
+
}[];
|
|
65
|
+
question: string;
|
|
66
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
67
|
+
questionType?: "Multiple choice" | "True or false" | undefined;
|
|
68
|
+
answerOrder?: "set" | "random" | undefined;
|
|
69
|
+
headerStyle?: "light" | "dark" | "none" | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
LayoutContainer: RegisteredComponentSchema<{
|
|
72
|
+
children?: any;
|
|
73
|
+
rowSpan?: number | undefined;
|
|
74
|
+
margin?: {
|
|
75
|
+
left?: "small" | "none" | "medium" | "large" | "xsmall" | "xlarge" | "xxlarge" | undefined;
|
|
76
|
+
right?: "small" | "none" | "medium" | "large" | "xsmall" | "xlarge" | "xxlarge" | undefined;
|
|
77
|
+
bottom?: "small" | "none" | "medium" | "large" | "xsmall" | "xlarge" | "xxlarge" | undefined;
|
|
78
|
+
top?: "small" | "none" | "medium" | "large" | "xsmall" | "xlarge" | "xxlarge" | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
order?: number | undefined;
|
|
81
|
+
columnSpan?: number | undefined;
|
|
82
|
+
gridColumn?: number | undefined;
|
|
83
|
+
gridRow?: number | undefined;
|
|
84
|
+
horizontalPosition?: "left" | "center" | "right" | undefined;
|
|
85
|
+
verticalPosition?: "normal" | "middle" | "bottom" | "top" | undefined;
|
|
86
|
+
backgroundStyle?: "none" | "primary" | "secondary" | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
MixAndMatch: RegisteredComponentSchema<{
|
|
89
|
+
pairs: {
|
|
90
|
+
definition: string;
|
|
91
|
+
term: string;
|
|
92
|
+
}[];
|
|
93
|
+
colorTheme?: "light" | "dark" | "neutral" | undefined;
|
|
94
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
95
|
+
randomizeCards?: "off" | "on" | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
QuoteBlock: RegisteredComponentSchema<{
|
|
98
|
+
content: string;
|
|
99
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
100
|
+
author?: string | undefined;
|
|
101
|
+
decorationStyle?: "none" | "background-secondary" | "background-grey" | "border-primary" | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
TabsBlock: RegisteredComponentSchema<{
|
|
104
|
+
tabs: {
|
|
105
|
+
id: string;
|
|
106
|
+
content: string;
|
|
107
|
+
label: string;
|
|
108
|
+
}[];
|
|
109
|
+
outline?: "none" | "outline" | undefined;
|
|
110
|
+
title?: string | undefined;
|
|
111
|
+
variant?: "h2" | "h3" | "h4" | undefined;
|
|
112
|
+
supportingText?: string | undefined;
|
|
113
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
114
|
+
style?: "simple" | "folder" | "segments" | undefined;
|
|
115
|
+
color?: "light" | "dark" | "neutral" | undefined;
|
|
116
|
+
tabsRowBackground?: "none" | "filled" | undefined;
|
|
117
|
+
tabsWidth?: "relative" | "full-width" | undefined;
|
|
118
|
+
alignment?: "left" | "center" | undefined;
|
|
119
|
+
selectedTabStyle?: "outline" | "filled" | undefined;
|
|
120
|
+
selectedTabCorners?: "rounded" | "square" | "pill" | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
Text: RegisteredComponentSchema<{
|
|
123
|
+
content: string;
|
|
124
|
+
colorTheme?: "light" | "dark" | "neutral" | undefined;
|
|
125
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
126
|
+
textStyle?: "fill" | "none" | "outline" | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
TwoColumn: RegisteredComponentSchema<{
|
|
129
|
+
children?: any;
|
|
130
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
131
|
+
leftColumnWidth?: number | undefined;
|
|
132
|
+
mobileStackingOrder?: "left-first" | "right-first" | undefined;
|
|
133
|
+
gapSpacing?: "small" | "none" | "medium" | "large" | undefined;
|
|
134
|
+
containerStyle?: "none" | "outline" | "solid" | undefined;
|
|
135
|
+
backgroundColor?: "light" | "dark" | "neutral" | "none" | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
VideoBlock: RegisteredComponentSchema<{
|
|
138
|
+
alt: string;
|
|
139
|
+
size: number;
|
|
140
|
+
source: "link" | "file";
|
|
141
|
+
align: "left" | "center" | "right";
|
|
142
|
+
asset_id: string;
|
|
143
|
+
cornerStyle?: "rounded" | "square" | undefined;
|
|
144
|
+
video_url?: string | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
WidgetBlock: RegisteredComponentSchema<{
|
|
147
|
+
widgetType: string;
|
|
148
|
+
}>;
|
|
149
|
+
};
|
|
150
|
+
export type BlockSchema = (typeof BLOCK_SCHEMAS)[BlockName];
|
|
151
|
+
export declare function getBlockSchema(blockName: BlockName): BlockSchema | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* The name of a boolean marker a prop's metadata can carry (e.g. `richtext`
|
|
154
|
+
* boolean marker from `.zodRichText()`).
|
|
155
|
+
*/
|
|
156
|
+
export type MetadataKey = 'richtext' | 'attachmentIdField';
|
|
157
|
+
/**
|
|
158
|
+
* Apply `fn` to every value whose field metadata has `metadataKey` set in a block's props (nested
|
|
159
|
+
* fields included), and return a cloned, transformed props object (the input is not mutated). `fn`
|
|
160
|
+
* receives `{ key, value }` for each matching field and returns the new value.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* // sanitize every rich-text field's HTML in a stored block's props
|
|
164
|
+
* const clean = mapFieldsWithMetadata(schema, props, 'richtext', ({ value }) =>
|
|
165
|
+
* typeof value === 'string' ? sanitizeHtml(value) : value,
|
|
166
|
+
* )
|
|
167
|
+
*/
|
|
168
|
+
export declare function mapFieldsWithMetadata<T extends object>(schema: BlockSchema, props: T, metadataKey: MetadataKey, fn: (field: {
|
|
169
|
+
key: string;
|
|
170
|
+
value: unknown;
|
|
171
|
+
}) => unknown): T;
|
|
172
|
+
export {};
|
|
173
|
+
//# sourceMappingURL=schemaRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaRegistry.d.ts","sourceRoot":"","sources":["../../src/schema/schemaRegistry.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,4BAA4B,CAAA;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAGnE,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe8C,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAA;AAE3D,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAE5E;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,mBAAmB,CAAA;AAoD1D;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,CAAC,EACR,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,CAAC,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,GACtD,CAAC,CAMH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaRegistry.test.d.ts","sourceRoot":"","sources":["../../src/schema/schemaRegistry.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { RegisteredComponentSchema } from './registeredSchema';
|
|
2
3
|
import { ZodFormMetadata } from './zodExtensions';
|
|
3
4
|
/**
|
|
4
5
|
* Unwraps ZodOptional, ZodDefault, ZodNullable wrappers to get the inner type
|
|
@@ -86,5 +87,5 @@ export declare function extractFieldMetadata(name: string, zodType: z.ZodTypeAny
|
|
|
86
87
|
* This is the main function for generating forms from Zod schemas.
|
|
87
88
|
* It returns metadata for each field that can be used to render form inputs.
|
|
88
89
|
*/
|
|
89
|
-
export declare function extractFormMetadata(schema: z.ZodObject<z.ZodRawShape>): Record<string, FormFieldMetadata>;
|
|
90
|
+
export declare function extractFormMetadata(schema: z.ZodObject<z.ZodRawShape> | RegisteredComponentSchema<unknown>): Record<string, FormFieldMetadata>;
|
|
90
91
|
//# sourceMappingURL=zodUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zodUtils.d.ts","sourceRoot":"","sources":["../../src/schema/zodUtils.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAExE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAajE;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UA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AE;QACX,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,qFAAqF;QACrF,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,qFAAqF;QACrF,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,GAAG,CAAC,EAAE,OAAO,CAAA;KACd,CAAA;IACD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAA;IACzB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAClD,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CAC/C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,GAAG,aAAa,CAyEpE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAsD7F;AA+FD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,GAAG,iBAAiB,CAmD3F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,yBAAyB,CAAC,OAAO,CAAC,GACtE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAWnC"}
|
package/dist/viewer/Viewer.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ export interface ViewerProps {
|
|
|
21
21
|
* Emits no wrapper of its own — the blocks are direct layout children of whatever the
|
|
22
22
|
* host puts them in, so the host's own container keeps full control of layout, and any
|
|
23
23
|
* host-specific typography (Canvas, for one, needs rules to beat its own element-level
|
|
24
|
-
* heading styles) belongs on that container rather than in here.
|
|
24
|
+
* heading styles) belongs on that container rather than in here. It does mount one global
|
|
25
|
+
* stylesheet for inter-block spacing (see `viewerStyles`) — that gap is the package's own
|
|
26
|
+
* concern, not the host's, since it is what the designer canvas already shows an author.
|
|
25
27
|
*/
|
|
26
28
|
export declare function Viewer({ templateLayout, templateData, componentRegistry, onUnresolvedBlock, }: ViewerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
29
|
//# sourceMappingURL=Viewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Viewer.d.ts","sourceRoot":"","sources":["../../src/viewer/Viewer.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,4BAA4B,CAAA;AAGnF,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"Viewer.d.ts","sourceRoot":"","sources":["../../src/viewer/Viewer.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,4BAA4B,CAAA;AAGnF,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGzE,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,kEAAkE;IAClE,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,sDAAsD;IACtD,iBAAiB,EAAE,aAAa,CAAA;IAChC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CACrD;AAmID;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,EACrB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,EAAE,WAAW,kDAoCb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inter-block spacing for the read path, where `Viewer` emits no wrapper to hang a `gap` on
|
|
3
|
+
* (a block is a direct layout child of whatever holds it — see `Viewer`'s docstring). An
|
|
4
|
+
* adjacent-sibling margin on the `.bce-block` class every block already carries reaches root
|
|
5
|
+
* siblings and nested ones the same way, since it matches on the class, not on depth — and
|
|
6
|
+
* naturally skips the first block in any list, sibling or not.
|
|
7
|
+
*
|
|
8
|
+
* A container that already gaps its own children (`LayoutContainer`'s `inner`) opts out via
|
|
9
|
+
* `data-bce-block-gap="self"`, so its flex/grid gap and this margin never stack.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ViewerSpacingStyles(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=viewerStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewerStyles.d.ts","sourceRoot":"","sources":["../../src/viewer/viewerStyles.tsx"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,4CAUlC"}
|
package/locales/en.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"placeholderContent": "Your content here...",
|
|
3
3
|
"bannerPlaceholderTitle": "Your banner",
|
|
4
4
|
"bannerPlaceholderSubtitle": "Your optional eyebrow text",
|
|
5
|
+
"bannerImageLoading": "Loading image...",
|
|
6
|
+
"bannerImageError": "Failed to load image",
|
|
5
7
|
"quotePlaceholderContent": "Your quote here",
|
|
6
8
|
"quotePlaceholderAuthor": "Author",
|
|
7
9
|
"codeBlockPlaceholder": "// Your code here",
|
|
@@ -145,9 +147,6 @@
|
|
|
145
147
|
"interactiveBlocksIntro": "Engage learners with interactive non-scored activities.",
|
|
146
148
|
"addBlock": "Add %{name}",
|
|
147
149
|
"skipToSelectedComponent": "Skip to selected component",
|
|
148
|
-
"desktop": "Desktop",
|
|
149
|
-
"mobile": "Mobile",
|
|
150
|
-
"viewportLabel": "Preview viewport",
|
|
151
150
|
"aiAssistFor": "AI assist for %{componentType}",
|
|
152
151
|
"aiActions": "AI Actions",
|
|
153
152
|
"backToMenu": "Back to menu",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/platform-block-content-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Host-agnostic block content editor for Canvas activities — the blocks, the read-path viewer, and the write-path editor, all on native InstUI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js"
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.js"
|
|
13
14
|
},
|
|
14
15
|
"./locales/en.json": "./locales/en.json"
|
|
15
16
|
},
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strings the package owns for the student preview chrome — the viewport switch that is not
|
|
3
|
-
* part of any one block. Consumed via `useBlockTranslations(DesignerPreviewEnglish)`, the same
|
|
4
|
-
* mechanism blocks use; there is deliberately no second translation context. The host overrides
|
|
5
|
-
* by placing a `BlockTranslationsProvider` above the preview; anything it omits falls back to
|
|
6
|
-
* the English below.
|
|
7
|
-
*/
|
|
8
|
-
export interface DesignerPreviewTranslations {
|
|
9
|
-
/** Label for the desktop option of the viewport switch. */
|
|
10
|
-
desktop: string;
|
|
11
|
-
/** Label for the mobile option of the viewport switch. */
|
|
12
|
-
mobile: string;
|
|
13
|
-
/** Accessible group label for the desktop/mobile viewport switch. */
|
|
14
|
-
viewportLabel: string;
|
|
15
|
-
}
|
|
16
|
-
/** English bundled with this package — also the source for `locales/en.json`. */
|
|
17
|
-
export declare const DesignerPreviewEnglish: DesignerPreviewTranslations;
|
|
18
|
-
//# sourceMappingURL=previewTranslations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"previewTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/preview/previewTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAA;IACf,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,EAAE,2BAIpC,CAAA"}
|