@blokkli/editor 1.0.3 → 1.0.4
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 +0 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +11 -3
- package/dist/runtime/components/BlokkliField.vue +1 -1
- package/dist/runtime/components/Edit/DraggableList.vue +1 -1
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +1 -0
- package/dist/runtime/types/index.d.ts +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,12 +51,6 @@ implements all features available in the editor. It provides a new edit state
|
|
|
51
51
|
entity that stores the applied mutations and implements a GraphQL schema
|
|
52
52
|
extension to integrate the adapter.
|
|
53
53
|
|
|
54
|
-
## Roadmap
|
|
55
|
-
|
|
56
|
-
blökkli is currently still in beta and therefore subject to change. If you're
|
|
57
|
-
considering integrating it in production sites you should probably wait until
|
|
58
|
-
the first stable release.
|
|
59
|
-
|
|
60
54
|
## Acknowledgments
|
|
61
55
|
|
|
62
56
|
blökkli was developed by [dulnan](https://github.com/dulnan) at
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { createUnplugin } from 'unplugin';
|
|
|
6
6
|
import MagicString from 'magic-string';
|
|
7
7
|
import { walk } from 'estree-walker-ts';
|
|
8
8
|
|
|
9
|
-
const version = "1.0.
|
|
9
|
+
const version = "1.0.4";
|
|
10
10
|
|
|
11
11
|
function sortObjectKeys(obj) {
|
|
12
12
|
const sortedKeys = Object.keys(obj).sort();
|
|
@@ -237,10 +237,14 @@ class BlockExtractor {
|
|
|
237
237
|
acc.push(
|
|
238
238
|
`${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`
|
|
239
239
|
);
|
|
240
|
-
} else {
|
|
240
|
+
} else if ("fieldList" in entry) {
|
|
241
241
|
acc.push(
|
|
242
242
|
`${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`
|
|
243
243
|
);
|
|
244
|
+
} else if ("fieldListType" in entry) {
|
|
245
|
+
acc.push(
|
|
246
|
+
`${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`
|
|
247
|
+
);
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
} else {
|
|
@@ -551,10 +555,14 @@ export function getBlokkliFragmentComponent(name: string): any {
|
|
|
551
555
|
acc.push(
|
|
552
556
|
`block_${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`
|
|
553
557
|
);
|
|
554
|
-
} else {
|
|
558
|
+
} else if ("fieldList" in entry) {
|
|
555
559
|
acc.push(
|
|
556
560
|
`block_${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`
|
|
557
561
|
);
|
|
562
|
+
} else if ("fieldListType" in entry) {
|
|
563
|
+
acc.push(
|
|
564
|
+
`block_${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`
|
|
565
|
+
);
|
|
558
566
|
}
|
|
559
567
|
});
|
|
560
568
|
}
|
|
@@ -258,6 +258,7 @@ const visibleOptions = computed<OptionItem[]>(() => {
|
|
|
258
258
|
parentType: parentType as any,
|
|
259
259
|
props: ctxProps as any,
|
|
260
260
|
entity: context.value,
|
|
261
|
+
fieldListType: block?.hostFieldListType || 'default',
|
|
261
262
|
})
|
|
262
263
|
|
|
263
264
|
return availableOptions.value.filter((v) => visibleKeys.includes(v.property))
|
|
@@ -87,6 +87,7 @@ export type DefineBlokkliContext<T extends BlockDefinitionOptionsInput = BlockDe
|
|
|
87
87
|
type DetermineVisibleOptionsContext<T extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, G extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
88
88
|
options: (T extends BlockDefinitionOptionsInput ? WithOptions<T> : object) & (G extends ValidGlobalConfigKeys ? GlobalOptionsKeyTypes<G> : object);
|
|
89
89
|
parentType: BlockBundleWithNested | undefined;
|
|
90
|
+
fieldListType: ValidFieldListTypes;
|
|
90
91
|
props: Record<string, any>;
|
|
91
92
|
entity: AdapterContext;
|
|
92
93
|
};
|
|
@@ -195,10 +196,16 @@ export type BlokkliDefinitionInputEditor<Options extends BlockDefinitionOptionsI
|
|
|
195
196
|
export type BlockDefinitionRenderForParent = {
|
|
196
197
|
parentBundle: BlockBundleWithNested;
|
|
197
198
|
};
|
|
198
|
-
export type
|
|
199
|
+
export type BlockDefinitionRenderForFieldList = {
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated Use `fieldListType` instead.
|
|
202
|
+
*/
|
|
199
203
|
fieldList: ValidFieldListTypes;
|
|
200
204
|
};
|
|
201
|
-
export type
|
|
205
|
+
export type BlockDefinitionRenderForFieldListType = {
|
|
206
|
+
fieldListType: ValidFieldListTypes;
|
|
207
|
+
};
|
|
208
|
+
export type BlockDefinitionRenderFor = BlockDefinitionRenderForParent | BlockDefinitionRenderForFieldList | BlockDefinitionRenderForFieldListType;
|
|
202
209
|
export type BlockDefinitionInput<Options extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, GlobalOptions extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
203
210
|
/**
|
|
204
211
|
* The bundle ID of the block, e.g. "text" or "section_title".
|