@instructure/platform-block-content-editor 3.0.0 → 3.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/dist/editor/sidebar/tray/blockDefinitions.d.ts.map +1 -1
- package/dist/index.js +2649 -2646
- package/dist/registry/blockCatalogue.d.ts +73 -65
- package/dist/registry/blockCatalogue.d.ts.map +1 -1
- package/dist/registry/defineBlock.d.ts.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Every block
|
|
3
|
-
* references, so a renderer can consult it without reaching for a block's
|
|
2
|
+
* Every block this version of the package knows about — strings and metadata only, no
|
|
3
|
+
* component references, so a renderer can consult it without reaching for a block's
|
|
4
|
+
* implementation.
|
|
4
5
|
*
|
|
5
6
|
* Its job is to tell two failure modes apart when a saved document names a block the
|
|
6
7
|
* registry can't resolve: one the host deliberately left out, versus one nothing here has
|
|
@@ -16,80 +17,87 @@ export declare const BlockCategory: {
|
|
|
16
17
|
};
|
|
17
18
|
export type BlockCategory = (typeof BlockCategory)[keyof typeof BlockCategory];
|
|
18
19
|
export interface BlockCatalogueEntry {
|
|
20
|
+
/**
|
|
21
|
+
* **Wire format** — the `component` string in stored `TemplateLayout` — and not always the
|
|
22
|
+
* component's name. `Header` renders `Banner`, `QuoteBlock` renders `Quote`,
|
|
23
|
+
* `KnowledgeCheckBlock` renders `KnowledgeCheck`. Renaming it orphans every document that
|
|
24
|
+
* used it.
|
|
25
|
+
*/
|
|
26
|
+
wireName: string;
|
|
19
27
|
category: BlockCategory;
|
|
20
28
|
acceptsChildren: boolean;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
31
|
+
* The package's block catalogue, one entry per shipped block. **Array position is this
|
|
32
|
+
* package's single canonical display/insertion order** — `blockDefinitions.tsx` derives its
|
|
33
|
+
* per-category tray order straight from this order, so reordering a block here is the only
|
|
34
|
+
* change needed to reorder it everywhere.
|
|
27
35
|
*
|
|
28
36
|
* No labels here: a label is user-facing text, so it arrives already translated when the
|
|
29
37
|
* host registers the block (`create<Name>Block({ label })`). An unresolved block has no
|
|
30
38
|
* label by definition.
|
|
31
39
|
*/
|
|
32
|
-
export declare const BLOCK_CATALOGUE: {
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
readonly
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
readonly
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
readonly
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
readonly
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
readonly
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
readonly
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
readonly
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
readonly
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
readonly
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
readonly
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
readonly
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
readonly
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
40
|
+
export declare const BLOCK_CATALOGUE: readonly [{
|
|
41
|
+
readonly wireName: "LayoutContainer";
|
|
42
|
+
readonly category: "layout";
|
|
43
|
+
readonly acceptsChildren: true;
|
|
44
|
+
}, {
|
|
45
|
+
readonly wireName: "TwoColumn";
|
|
46
|
+
readonly category: "layout";
|
|
47
|
+
readonly acceptsChildren: true;
|
|
48
|
+
}, {
|
|
49
|
+
readonly wireName: "Header";
|
|
50
|
+
readonly category: "activityContent";
|
|
51
|
+
readonly acceptsChildren: false;
|
|
52
|
+
}, {
|
|
53
|
+
readonly wireName: "Text";
|
|
54
|
+
readonly category: "activityContent";
|
|
55
|
+
readonly acceptsChildren: false;
|
|
56
|
+
}, {
|
|
57
|
+
readonly wireName: "QuoteBlock";
|
|
58
|
+
readonly category: "activityContent";
|
|
59
|
+
readonly acceptsChildren: false;
|
|
60
|
+
}, {
|
|
61
|
+
readonly wireName: "CodeBlock";
|
|
62
|
+
readonly category: "activityContent";
|
|
63
|
+
readonly acceptsChildren: false;
|
|
64
|
+
}, {
|
|
65
|
+
readonly wireName: "ImageBlock";
|
|
66
|
+
readonly category: "activityContent";
|
|
67
|
+
readonly acceptsChildren: false;
|
|
68
|
+
}, {
|
|
69
|
+
readonly wireName: "VideoBlock";
|
|
70
|
+
readonly category: "activityContent";
|
|
71
|
+
readonly acceptsChildren: false;
|
|
72
|
+
}, {
|
|
73
|
+
readonly wireName: "Accordion";
|
|
74
|
+
readonly category: "activityContent";
|
|
75
|
+
readonly acceptsChildren: false;
|
|
76
|
+
}, {
|
|
77
|
+
readonly wireName: "TabsBlock";
|
|
78
|
+
readonly category: "activityContent";
|
|
79
|
+
readonly acceptsChildren: false;
|
|
80
|
+
}, {
|
|
81
|
+
readonly wireName: "KnowledgeCheckBlock";
|
|
82
|
+
readonly category: "interactiveContent";
|
|
83
|
+
readonly acceptsChildren: false;
|
|
84
|
+
}, {
|
|
85
|
+
readonly wireName: "FlashCards";
|
|
86
|
+
readonly category: "interactiveContent";
|
|
87
|
+
readonly acceptsChildren: false;
|
|
88
|
+
}, {
|
|
89
|
+
readonly wireName: "MixAndMatch";
|
|
90
|
+
readonly category: "interactiveContent";
|
|
91
|
+
readonly acceptsChildren: false;
|
|
92
|
+
}, {
|
|
93
|
+
readonly wireName: "WidgetBlock";
|
|
94
|
+
readonly category: "widget";
|
|
95
|
+
readonly acceptsChildren: false;
|
|
96
|
+
}];
|
|
90
97
|
/** Wire names of the blocks this package ships. */
|
|
91
|
-
export type BlockName =
|
|
98
|
+
export type BlockName = (typeof BLOCK_CATALOGUE)[number]['wireName'];
|
|
92
99
|
export declare function isKnownBlock(name: string): name is BlockName;
|
|
100
|
+
export declare function getCatalogueEntry(wireName: string): BlockCatalogueEntry | undefined;
|
|
93
101
|
/**
|
|
94
102
|
* Why a renderer could not resolve a node.
|
|
95
103
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockCatalogue.d.ts","sourceRoot":"","sources":["../../src/registry/blockCatalogue.ts"],"names":[],"mappings":"AAkBA
|
|
1
|
+
{"version":3,"file":"blockCatalogue.d.ts","sourceRoot":"","sources":["../../src/registry/blockCatalogue.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;GASG;AAEH,qDAAqD;AACrD,eAAO,MAAM,aAAa;;;;;CAKhB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAE9E,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,aAAa,CAAA;IACvB,eAAe,EAAE,OAAO,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBuB,CAAA;AAEnD,mDAAmD;AACnD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;AAWpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,SAAS,CAI5D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAEnF;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,SAAS,CAAA;AAEhE,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,qBAAqB,CAAA;CAC9B;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,CAEzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineBlock.d.ts","sourceRoot":"","sources":["../../src/registry/defineBlock.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,aAAa,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"defineBlock.d.ts","sourceRoot":"","sources":["../../src/registry/defineBlock.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,aAAa,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAYzD,gEAAgE;AAChE,MAAM,WAAW,eAAe,CAAC,MAAM;IACrC;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,GAAG,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1,5 +1,5 @@
|
|
|
1
1
|
export { type BlockRegistry, type BlockRegistryEntry, COLUMN_STACK_ATTR, defineRegistry, type PropsOf, } from './blockRegistry';
|
|
2
|
-
export { BLOCK_CATALOGUE, BlockCategory, type BlockCatalogueEntry, type BlockName, isKnownBlock, type UnresolvedBlock, type UnresolvedBlockReason, unresolvedReason, } from './blockCatalogue';
|
|
2
|
+
export { BLOCK_CATALOGUE, BlockCategory, type BlockCatalogueEntry, type BlockName, getCatalogueEntry, isKnownBlock, type UnresolvedBlock, type UnresolvedBlockReason, unresolvedReason, } from './blockCatalogue';
|
|
3
3
|
export { type BlockDefinition, type BlockFactoryOptions, defineBlock, type UntranslatedBlockFactoryOptions, } from './defineBlock';
|
|
4
4
|
export { getMergedProps } from './getMergedProps';
|
|
5
5
|
export { resolveBlockEntry } from './resolveBlockEntry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,cAAc,EACd,KAAK,OAAO,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,WAAW,EACX,KAAK,+BAA+B,GACrC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,cAAc,EACd,KAAK,OAAO,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,WAAW,EACX,KAAK,+BAA+B,GACrC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/platform-block-content-editor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.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",
|