morphic-blocks 0.3.0 → 0.5.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 +26 -21
- package/definitions.schema.json +147 -14
- package/dist/cli.js +6 -17
- package/dist/copy-media-CllRyMqQ.js +21 -0
- package/dist/copy-media.d.ts +8 -0
- package/dist/esbuild.d.ts +3 -0
- package/dist/esbuild.js +10 -0
- package/dist/index.d.ts +4 -1
- package/dist/morphic/MorphicBlocks.d.ts +141 -66
- package/dist/morphic/asset-urls.d.ts +9 -0
- package/dist/morphic/block-sets.d.ts +12 -0
- package/dist/morphic/block-view.d.ts +72 -4
- package/dist/morphic/check-definitions.d.ts +31 -0
- package/dist/morphic/code-editor.d.ts +22 -3
- package/dist/morphic/constants.d.ts +6 -0
- package/dist/morphic/dropdown-fields.d.ts +72 -0
- package/dist/morphic/element-types.d.ts +1 -1
- package/dist/morphic/operators.d.ts +73 -0
- package/dist/morphic/parent-field.d.ts +7 -0
- package/dist/morphic/repeat-slots.d.ts +31 -0
- package/dist/morphic/resize.d.ts +7 -2
- package/dist/morphic/strict-slots.d.ts +10 -0
- package/dist/morphic/styles.d.ts +5 -0
- package/dist/morphic/template-codegen.d.ts +16 -0
- package/dist/morphic/template.d.ts +42 -1
- package/dist/morphic/text-to-blocks.d.ts +34 -0
- package/dist/morphic/toolbar.d.ts +8 -11
- package/dist/morphic/toolbox-canvas.d.ts +34 -11
- package/dist/morphic/types.d.ts +350 -67
- package/dist/morphic/validate-definitions.d.ts +4 -1
- package/dist/morphic/value-type.d.ts +13 -0
- package/dist/morphic/view-resolver.d.ts +5 -0
- package/dist/morphic-blocks.js +4432 -2511
- package/dist/morphic-blocks.umd.cjs +43 -23
- package/dist/plugin-h3QH8ods.js +19 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/rollup.d.ts +3 -0
- package/dist/rollup.js +10 -0
- package/dist/rspack.d.ts +3 -0
- package/dist/rspack.js +10 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +10 -0
- package/dist/webpack.d.ts +3 -0
- package/dist/webpack.js +10 -0
- package/package.json +24 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MorphicBehaviorMap, MorphicBlockDefinition, MorphicCodeElementConfig, MorphicElementTypeEntry, MorphicModeDefinition, MorphicPresetDefinition, MorphicToolboxCategory } from "./types";
|
|
1
|
+
import type { MorphicBehaviorMap, MorphicBlockSet, MorphicBlockDefinition, MorphicCodeElementConfig, MorphicElementTypeEntry, MorphicModeDefinition, MorphicPresetDefinition, MorphicToolboxCategory } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Inputs for a definitions validation pass. Everything is optional except the
|
|
4
4
|
* definitions + elementTypes (available at construction); the cross-reference
|
|
@@ -12,6 +12,9 @@ export interface ValidateDefinitionsArgs {
|
|
|
12
12
|
presets?: MorphicPresetDefinition[];
|
|
13
13
|
code?: Record<string, MorphicCodeElementConfig>;
|
|
14
14
|
categories?: MorphicToolboxCategory[];
|
|
15
|
+
/** Names of the views the developer declared (not the defaults). */
|
|
16
|
+
views?: string[];
|
|
17
|
+
blockSets?: Record<string, MorphicBlockSet>;
|
|
15
18
|
}
|
|
16
19
|
export interface DefinitionValidationResult {
|
|
17
20
|
/** Structural problems that guarantee wrong output — the caller should throw. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Blockly from "blockly";
|
|
2
|
+
import type { MorphicElementTypeEntry, MorphicInputSlotDefinition } from "./types";
|
|
3
|
+
/** Name prefix of the label a `%1:type` token becomes, followed by the slot number. */
|
|
4
|
+
export declare const VALUE_TYPE_FIELD = "MORPHIC_TYPE_";
|
|
5
|
+
/** Whether a field is the label of a `%1:type` token, not one of the block's own fields. */
|
|
6
|
+
export declare const isValueTypeLabel: (field: Blockly.Field) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The name `%1:type` writes for the value in `slot`: the element's
|
|
9
|
+
* `code.types` entry for the value's type (its block's output check, or the
|
|
10
|
+
* slot's own check while the slot is empty and accepts one type), else
|
|
11
|
+
* `default`, else nothing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function valueTypeName(block: Blockly.Block, slot: MorphicInputSlotDefinition | undefined, elementEntry: MorphicElementTypeEntry | undefined): string;
|
|
@@ -15,3 +15,8 @@ export declare function resolveModeSourceElement(mode: MorphicModeDefinition, el
|
|
|
15
15
|
* 4. First element in the block definition
|
|
16
16
|
*/
|
|
17
17
|
export declare function resolveBlockView(definition: MorphicBlockDefinition, mode: MorphicModeName, elementTypes?: Record<string, MorphicElementTypeEntry>, modeDefs?: MorphicModeDefinition[]): MorphicResolvedView;
|
|
18
|
+
/**
|
|
19
|
+
* The workspace template for a block in a view that shows `element`: the
|
|
20
|
+
* block's own content for it, else the fallbacks of `resolveBlockView`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveElementView(definition: MorphicBlockDefinition, element: string, elementTypes?: Record<string, MorphicElementTypeEntry>): MorphicResolvedView;
|