eddev 2.0.0-beta.84 → 2.0.0-beta.85

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.
@@ -44,7 +44,7 @@ export declare const editorConfigStore: {
44
44
  currentBlocksConfig: EditorConfigItem;
45
45
  };
46
46
  export declare function configureEditorBlocks(config: EditorConfigItem): void;
47
- export declare function transformTemplateToBlocks(template: BlockTemplate, locked?: boolean): any;
47
+ export declare function transformTemplateToBlocks(template: BlockTemplate, locked?: boolean, isFromTemplate?: boolean): any;
48
48
  type PostInfo = {
49
49
  template: TemplateName | "default";
50
50
  type: PostTypeName;
@@ -31,7 +31,7 @@ export function configureEditorBlocks(config) {
31
31
  let header = config.headerTemplate ? syncBlocks(transformTemplateToBlocks(config.headerTemplate)) : [];
32
32
  let footer = config.footerTemplate ? syncBlocks(transformTemplateToBlocks(config.footerTemplate)) : [];
33
33
  if (!blocks.length && config.defaultBlocks) {
34
- blocks = transformTemplateToBlocks(config.defaultBlocks, false);
34
+ blocks = transformTemplateToBlocks(config.defaultBlocks, false, false);
35
35
  }
36
36
  let newBlocks = [...header, ...blocks, ...footer];
37
37
  wp.data.dispatch("core/block-editor").resetBlocks(newBlocks);
@@ -47,12 +47,12 @@ export function configureEditorBlocks(config) {
47
47
  });
48
48
  }
49
49
  }
50
- export function transformTemplateToBlocks(template, locked = true) {
50
+ export function transformTemplateToBlocks(template, locked = true, isFromTemplate = true) {
51
51
  return template.map(([name, props, children]) => {
52
52
  const attributes = {
53
53
  data: {},
54
54
  inline: {},
55
- isFromTemplate: true,
55
+ isFromTemplate: isFromTemplate,
56
56
  lock: undefined,
57
57
  };
58
58
  if (props.locked === false) {
@@ -69,7 +69,7 @@ export function transformTemplateToBlocks(template, locked = true) {
69
69
  clientId: "block-" + Math.random().toString(36),
70
70
  name: resolveAcfBlockName(name),
71
71
  attributes: attributes,
72
- innerBlocks: children ? transformTemplateToBlocks(children, false) : [],
72
+ innerBlocks: children ? transformTemplateToBlocks(children, false, isFromTemplate) : [],
73
73
  isValid: true,
74
74
  validationIssues: [],
75
75
  };
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.84";
1
+ export declare const VERSION = "2.0.0-beta.85";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.84";
1
+ export const VERSION = "2.0.0-beta.85";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.84",
3
+ "version": "2.0.0-beta.85",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",