@instructure/platform-block-content-editor 4.1.0 → 4.1.1
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/dist/editor/BlockContentEditor.d.ts +4 -0
- package/dist/editor/BlockContentEditor.d.ts.map +1 -1
- package/dist/editor/document/constants.d.ts +0 -15
- package/dist/editor/document/constants.d.ts.map +1 -1
- package/dist/editor/document/utils.d.ts +0 -15
- package/dist/editor/document/utils.d.ts.map +1 -1
- package/dist/editor/validation/templateDataValidator.d.ts +1 -14
- package/dist/editor/validation/templateDataValidator.d.ts.map +1 -1
- package/dist/index.js +2222 -2201
- package/package.json +2 -2
- package/dist/components/blocks/commonViewProps.test.d.ts +0 -2
- package/dist/components/blocks/commonViewProps.test.d.ts.map +0 -1
- package/dist/editor/ai/isBlockEmpty.test.d.ts +0 -2
- package/dist/editor/ai/isBlockEmpty.test.d.ts.map +0 -1
- package/dist/editor/ai/isItemEmpty.test.d.ts +0 -2
- package/dist/editor/ai/isItemEmpty.test.d.ts.map +0 -1
- package/dist/editor/ai/previewDiff.test.d.ts +0 -2
- package/dist/editor/ai/previewDiff.test.d.ts.map +0 -1
- package/dist/editor/document/utils.test.d.ts +0 -2
- package/dist/editor/document/utils.test.d.ts.map +0 -1
- package/dist/editor/history/undoRedoManager.test.d.ts +0 -2
- package/dist/editor/history/undoRedoManager.test.d.ts.map +0 -1
- package/dist/editor/history/useUndoRedo.test.d.ts +0 -2
- package/dist/editor/history/useUndoRedo.test.d.ts.map +0 -1
- package/dist/editor/sidebar/form/formUtils.test.d.ts +0 -2
- package/dist/editor/sidebar/form/formUtils.test.d.ts.map +0 -1
- package/dist/editor/state/applyTemplatePatch.test.d.ts +0 -2
- package/dist/editor/state/applyTemplatePatch.test.d.ts.map +0 -1
- package/dist/editor/state/blockDataStore.test.d.ts +0 -2
- package/dist/editor/state/blockDataStore.test.d.ts.map +0 -1
- package/dist/editor/state/useBlockEditorState.test.d.ts +0 -2
- package/dist/editor/state/useBlockEditorState.test.d.ts.map +0 -1
- package/dist/editor/state/useUndoRedoState.test.d.ts +0 -2
- package/dist/editor/state/useUndoRedoState.test.d.ts.map +0 -1
- package/dist/editor/validation/templateDataValidator.test.d.ts +0 -2
- package/dist/editor/validation/templateDataValidator.test.d.ts.map +0 -1
- package/dist/registry/registryTypes.test.d.ts +0 -1
- package/dist/registry/registryTypes.test.d.ts.map +0 -1
- package/dist/registry/templateLayoutSchema.test.d.ts +0 -2
- package/dist/registry/templateLayoutSchema.test.d.ts.map +0 -1
- package/dist/schema/schemaRegistry.test.d.ts +0 -2
- package/dist/schema/schemaRegistry.test.d.ts.map +0 -1
- package/dist/schema/zodUtils.test.d.ts +0 -2
- package/dist/schema/zodUtils.test.d.ts.map +0 -1
- package/dist/utils/colorVariants/brandColorVariants.test.d.ts +0 -2
- package/dist/utils/colorVariants/brandColorVariants.test.d.ts.map +0 -1
- package/dist/utils/colorVariants/color.test.d.ts +0 -2
- package/dist/utils/colorVariants/color.test.d.ts.map +0 -1
- package/dist/utils/colorVariants/deriveColorVariants.test.d.ts +0 -2
- package/dist/utils/colorVariants/deriveColorVariants.test.d.ts.map +0 -1
- package/dist/utils/safeMediaUrl.test.d.ts +0 -2
- package/dist/utils/safeMediaUrl.test.d.ts.map +0 -1
- package/dist/utils/shuffleCards.test.d.ts +0 -2
- package/dist/utils/shuffleCards.test.d.ts.map +0 -1
|
@@ -7,6 +7,10 @@ import { UseBlockEditorStateReturn } from './state/useBlockEditorState';
|
|
|
7
7
|
/** The trays the package ships. A host appends its own tools (widget tray, AI assistant). */
|
|
8
8
|
export declare const BUILT_IN_TOOL_IDS: readonly ["components", "interactive"];
|
|
9
9
|
export type BuiltInToolId = (typeof BUILT_IN_TOOL_IDS)[number];
|
|
10
|
+
/** Room above a block for the selected-item toolbar and chip that overhang its top edge (the
|
|
11
|
+
* toolbar sits 19px up); matches the canvas surface's `space24` top padding, which clears them
|
|
12
|
+
* on the first row. */
|
|
13
|
+
export declare const SCROLL_TOOLBAR_CLEARANCE_PX = 24;
|
|
10
14
|
export interface BlockContentEditorProps<HostToolId extends string = never> {
|
|
11
15
|
/** The host-owned editor state (from `useBlockEditorState`). The host keeps save / undo /
|
|
12
16
|
* dirty / DB↔package conversion; this component only composes the authoring UI over it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockContentEditor.d.ts","sourceRoot":"","sources":["../../src/editor/BlockContentEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAA;AAMnE,OAAO,EAAkC,KAAK,eAAe,EAAmB,MAAM,WAAW,CAAA;AAIjG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,wCAAyC,CAAA;AACvE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"BlockContentEditor.d.ts","sourceRoot":"","sources":["../../src/editor/BlockContentEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAA;AAMnE,OAAO,EAAkC,KAAK,eAAe,EAAmB,MAAM,WAAW,CAAA;AAIjG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,6FAA6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B,EACpB,WAAmB,EACnB,eAA2C,EAC3C,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,EACN,UAAU,GACX,EAAE,uBAAuB,CAAC,UAAU,CAAC,2CAwJrC"}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
/** Grid layout dimensions. */
|
|
2
2
|
export declare const GRID_COLUMNS = 15;
|
|
3
|
-
export declare const GRID_ROWS = 100;
|
|
4
3
|
/**
|
|
5
4
|
* Grid cell sizing. Fixed values rather than dynamic calculations, because inline
|
|
6
5
|
* CSS works better with explicit pixel values.
|
|
7
6
|
*/
|
|
8
7
|
export declare const CELL_SIZE = 67;
|
|
9
|
-
export declare const GAP_SIZE = 16;
|
|
10
|
-
/** Default page width for the designer canvas (matches the 1280px content width). */
|
|
11
|
-
export declare const DEFAULT_PAGE_WIDTH = 1280;
|
|
12
|
-
/**
|
|
13
|
-
* Height constraint for interactive/activity components, which otherwise default to
|
|
14
|
-
* spanning the full grid.
|
|
15
|
-
*/
|
|
16
|
-
export declare const INTERACTABLE_COMPONENT_HEIGHT: number;
|
|
17
|
-
/** Minimum component dimensions. */
|
|
18
|
-
export declare const MIN_COMPONENT_COLSPAN = 1;
|
|
19
|
-
export declare const MIN_COMPONENT_ROWSPAN = 1;
|
|
20
|
-
/** Default component dimensions for newly added components. */
|
|
21
|
-
export declare const DEFAULT_COMPONENT_COLSPAN = 15;
|
|
22
|
-
export declare const DEFAULT_COMPONENT_ROWSPAN = 5;
|
|
23
8
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/document/constants.ts"],"names":[],"mappings":"AAkBA,8BAA8B;AAC9B,eAAO,MAAM,YAAY,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/document/constants.ts"],"names":[],"mappings":"AAkBA,8BAA8B;AAC9B,eAAO,MAAM,YAAY,KAAK,CAAA;AAE9B;;;GAGG;AACH,eAAO,MAAM,SAAS,KAAK,CAAA"}
|
|
@@ -30,14 +30,6 @@ export declare const MANAGE_LAYER_THRESHOLD = 5;
|
|
|
30
30
|
export declare function parseManageView(view: string): {
|
|
31
31
|
fieldName: string;
|
|
32
32
|
} | null;
|
|
33
|
-
/**
|
|
34
|
-
* Adjust column and row spans to fit within grid boundaries. Handles components that extend
|
|
35
|
-
* beyond grid dimensions, and applies the height constraint for interactive components.
|
|
36
|
-
*/
|
|
37
|
-
export declare function adjustSpan(column: number, row: number, width: number | undefined, height: number | undefined, rowSpan: number): {
|
|
38
|
-
colSpan: number;
|
|
39
|
-
rowSpan: number;
|
|
40
|
-
};
|
|
41
33
|
/**
|
|
42
34
|
* Find the maximum occupied row by examining `gridRow + rowSpan` for all nodes recursively.
|
|
43
35
|
* Used to determine where to place new components.
|
|
@@ -45,8 +37,6 @@ export declare function adjustSpan(column: number, row: number, width: number |
|
|
|
45
37
|
export declare function findMaxOccupiedRow(layout: LayoutNode[]): number;
|
|
46
38
|
/** Get template data for a component by id. */
|
|
47
39
|
export declare function getTemplateDataById(templateData: TemplateData, id: string): object | undefined;
|
|
48
|
-
/** Update template data for a specific component (immutable). */
|
|
49
|
-
export declare function updateTemplateDataById(templateData: TemplateData, id: string, newData: object): TemplateData;
|
|
50
40
|
/** Remove template data for a specific component (immutable). */
|
|
51
41
|
export declare function removeTemplateDataById(templateData: TemplateData, id: string): TemplateData;
|
|
52
42
|
/**
|
|
@@ -135,11 +125,6 @@ export declare function localInsertIndex(columnItems: {
|
|
|
135
125
|
* an empty-cell droppable's own occupancy classification before trusting it.
|
|
136
126
|
*/
|
|
137
127
|
export declare function findBlockAtGridPosition<T extends LayoutNode>(templateLayout: T[], row: number, column: number): T | undefined;
|
|
138
|
-
/**
|
|
139
|
-
* The sorting strategy to use. Always "grid": the custom grid sorting strategy handles both
|
|
140
|
-
* single- and multi-column layouts, including vertical movement.
|
|
141
|
-
*/
|
|
142
|
-
export declare function getSortingStrategy(): 'grid';
|
|
143
128
|
export declare function sortByGridRow<T extends LayoutNode>(layout: T[]): T[];
|
|
144
129
|
export declare function normalizeGridPositions<T extends LayoutNode>(layout: T[]): T[];
|
|
145
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/editor/document/utils.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/editor/document/utils.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEjF;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,KAAK,CAAA;AAE1B;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI3F;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI1E;AAMD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAsB/D;AAMD,+CAA+C;AAC/C,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE9F;AAED,iEAAiE;AACjE,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAG3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAA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,SAAS,CAef;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAMpE;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CA4B7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAE1E;AAMD,uFAAuF;AACvF,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,UAAU;IAC/C,UAAU,EAAE,CAAC,CAAA;IACb,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAsBjF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,YAAY,CAmBd;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,EAClD,cAAc,EAAE,CAAC,EAAE,EACnB,UAAU,EAAE,QAAQ,EACpB,YAAY,EAAE,CAAC,GACd;IAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,QAAQ,CAAA;CAAE,CAuHzC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockRegistry,
|
|
1
|
+
import { BlockRegistry, TemplateData } from '../../registry';
|
|
2
2
|
export interface TemplateDataValidationSuccess<T> {
|
|
3
3
|
success: true;
|
|
4
4
|
data: T;
|
|
@@ -27,19 +27,6 @@ export type TemplateDataValidationResult<T> = TemplateDataValidationSuccess<T> |
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare function validateTemplateDataEntry(componentId: string, componentType: string, props: unknown, registry: BlockRegistry): TemplateDataValidationResult<Record<string, unknown>>;
|
|
30
|
-
/**
|
|
31
|
-
* Validate template data by cross-referencing the layout for each entry's block type, then
|
|
32
|
-
* validating props against that block's schema. Returns validated data or aggregated errors.
|
|
33
|
-
*/
|
|
34
|
-
export declare function validateTemplateData(templateData: TemplateData, templateLayout: LayoutNode[], registry: BlockRegistry): TemplateDataValidationResult<TemplateData>;
|
|
35
|
-
/**
|
|
36
|
-
* Parse template data without throwing, recovering as much valid data as possible and
|
|
37
|
-
* returning warnings for invalid entries (e.g. to show a non-blocking notice).
|
|
38
|
-
*/
|
|
39
|
-
export declare function safeParseTemplateData(templateData: TemplateData, templateLayout: LayoutNode[], registry: BlockRegistry): {
|
|
40
|
-
data: TemplateData;
|
|
41
|
-
warnings: TemplateDataValidationError['errors'];
|
|
42
|
-
};
|
|
43
30
|
/**
|
|
44
31
|
* Create a validated template data entry for a component, validating props against its block's
|
|
45
32
|
* schema before creating the entry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateDataValidator.d.ts","sourceRoot":"","sources":["../../../src/editor/validation/templateDataValidator.ts"],"names":[],"mappings":"AAyBA,OAAO,
|
|
1
|
+
{"version":3,"file":"templateDataValidator.d.ts","sourceRoot":"","sources":["../../../src/editor/validation/templateDataValidator.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,aAAa,EAAqB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEzF,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;CACR;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,KAAK,CAAA;IACd,MAAM,EAAE,KAAK,CAAC;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;KAChB,CAAC,CAAA;CACH;AAED,MAAM,MAAM,4BAA4B,CAAC,CAAC,IACtC,6BAA6B,CAAC,CAAC,CAAC,GAChC,2BAA2B,CAAA;AAE/B;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,GACtB,4BAA4B,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+CvD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,GACtB,4BAA4B,CAAC,YAAY,CAAC,CAW5C"}
|