@ixo/editor 7.12.0 → 7.13.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.
@@ -1,4 +1,4 @@
1
- import { a6 as FlowNodeAuthzExtension, a7 as FlowNode, a8 as EvaluationStatus, F as FlowRuntimeStateManager, G as UcanService, g as InvocationStore, U as UcanCapability, a9 as IxoEditorType, aa as PendingInvocation, ab as ActionServices, ac as ActionHandlers, ad as RunEventAppender, ae as TopicExecutionContext, af as TopicActionBridge, ag as DesignPodRuntimeAuthorityV1, ah as ActionResult, ai as TopicActionWriteBackResult, aj as FlowNodeRuntimeState, z as UcanDelegationStore, v as StoredDelegation, ak as ActionDefinition, al as DesignPodMethodId } from './types-DObm_Y95.js';
1
+ import { a6 as FlowNodeAuthzExtension, a7 as FlowNode, a8 as EvaluationStatus, F as FlowRuntimeStateManager, G as UcanService, g as InvocationStore, U as UcanCapability, a9 as IxoEditorType, aa as PendingInvocation, ab as ActionServices, ac as ActionHandlers, ad as RunEventAppender, ae as TopicExecutionContext, af as TopicActionBridge, ag as DesignPodRuntimeAuthorityV1, ah as ActionResult, ai as TopicActionWriteBackResult, aj as FlowNodeRuntimeState, z as UcanDelegationStore, v as StoredDelegation, ak as ActionDefinition, al as DesignPodMethodId } from './types-D-PiyyFv.js';
2
2
  import * as Y from 'yjs';
3
3
  import { Doc, Map } from 'yjs';
4
4
  import { MatrixClient } from 'matrix-js-sdk';
@@ -3736,6 +3736,7 @@ function validPageBlock(value, schema, ids = /* @__PURE__ */ new Set(), depth =
3736
3736
  // src/core/lib/pageSerializer/index.ts
3737
3737
  var PAGE_FILE_SCHEMA_VERSION = 1;
3738
3738
  var IXO_BLOCK_FENCE = "ixo-block";
3739
+ var STRING_META_KEYS = ["title", "id", "author", "createdAt", "exportedAt", "icon", "cover"];
3739
3740
  var yamlValue = (value) => JSON.stringify(value);
3740
3741
  function frontmatter(meta) {
3741
3742
  const lines = Object.entries(meta).filter(([, value]) => value !== void 0 && value !== null && value !== "").map(([key, value]) => `${key}: ${yamlValue(value)}`);
@@ -3908,7 +3909,7 @@ async function pageMarkdownToBlocks(converter, markdown) {
3908
3909
  const { meta, body } = parseFrontmatter(markdown.replace(/\r\n?/g, "\n"));
3909
3910
  const schemaVersion = typeof meta.schemaVersion === "number" ? meta.schemaVersion : PAGE_FILE_SCHEMA_VERSION;
3910
3911
  const supportedVersion = meta.schemaVersion === void 0 || meta.schemaVersion === PAGE_FILE_SCHEMA_VERSION;
3911
- const validMeta = ["title", "id", "author", "createdAt", "exportedAt"].every((key) => meta[key] === void 0 || typeof meta[key] === "string");
3912
+ const validMeta = STRING_META_KEYS.every((key) => meta[key] === void 0 || typeof meta[key] === "string") && (meta.coverPosition === void 0 || typeof meta.coverPosition === "number");
3912
3913
  const diagnostics = supportedVersion ? [] : [{ code: "unsupported-schema-version" }];
3913
3914
  if (!validMeta) diagnostics.push({ code: "invalid-metadata" });
3914
3915
  const [{ unified }, { default: remarkParse }, { default: remarkGfm }] = await Promise.all([import("unified"), import("remark-parse"), import("remark-gfm")]);
@@ -3976,9 +3977,10 @@ async function pageMarkdownToBlocks(converter, markdown) {
3976
3977
  }
3977
3978
  await parseRun(body.slice(cursor));
3978
3979
  const { schemaVersion: _ignored, ...rest } = meta;
3979
- for (const key of ["title", "id", "author", "createdAt", "exportedAt"]) {
3980
+ for (const key of STRING_META_KEYS) {
3980
3981
  if (meta[key] !== void 0 && typeof meta[key] !== "string") delete rest[key];
3981
3982
  }
3983
+ if (meta.coverPosition !== void 0 && typeof meta.coverPosition !== "number") delete rest.coverPosition;
3982
3984
  return { meta: { ...rest, schemaVersion }, blocks, diagnostics };
3983
3985
  }
3984
3986
  async function pageContentHash(markdown) {