@openpresentation/opf-editor 0.19.0 → 0.20.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.
@@ -38,7 +38,7 @@ export function layoutFromGrid({ id, name, summary, cells, regions, columns, row
38
38
  if (typeof name !== "string" || !name.trim()) throw fail("layout-name", "Name the custom layout.");
39
39
  if (!Array.isArray(cells) || cells.length < 1 || cells.length > 12 || !cells.every((row) => Array.isArray(row) && row.length === cells[0].length && row.length >= 1 && row.length <= 12))
40
40
  throw fail("layout-grid", "Draw a rectangular grid of at most 12 by 12 cells.");
41
- const areas = cells.map((row) => row.join(" "));
41
+ const areas = cells.map((row) => [...row]);
42
42
  const names = new Set(cells.flat().filter((cell) => cell !== "."));
43
43
  for (const area of names) if (!NAME.test(area) || (RESERVED.has(area) && area !== "title" && area !== "subtitle")) throw fail("layout-area", `Invalid area name: ${area}.`);
44
44
  if (names.has("subtitle") && !names.has("title")) throw fail("layout-area", "A subtitle area needs a title area.");
@@ -523,9 +523,9 @@ export function createSlideManager(container, options) {
523
523
  template.append(el("img", { src: choice.record.preview, alt: `${choice.label} template preview` }));
524
524
  } else if (Array.isArray(choice?.record?.areas)) {
525
525
  const diagram = el("div", { class: "opf-layout-diagram" });
526
- diagram.style.gridTemplateAreas = choice.record.areas.map((row) => `"${row}"`).join(" ");
527
- diagram.style.gridTemplateColumns = `repeat(${choice.record.areas[0]?.trim().split(/\s+/).length ?? 1}, 1fr)`;
528
- const areas = [...new Set(choice.record.areas.flatMap((row) => row.trim().split(/\s+/)))].filter((area) => area !== ".");
526
+ diagram.style.gridTemplateAreas = choice.record.areas.map((row) => `"${row.join(" ")}"`).join(" ");
527
+ diagram.style.gridTemplateColumns = `repeat(${choice.record.areas[0]?.length ?? 1}, 1fr)`;
528
+ const areas = [...new Set(choice.record.areas.flat())].filter((area) => area !== ".");
529
529
  for (const area of areas) { const part = el("span", { text: area }); part.style.gridArea = area; diagram.append(part); }
530
530
  template.append(diagram);
531
531
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpresentation/opf-editor",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Embeddable local OPF editor primitives built on the deterministic renderer.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -266,11 +266,11 @@
266
266
  "@codemirror/state": "6.7.6",
267
267
  "@codemirror/view": "6.43.13",
268
268
  "@lezer/highlight": "1.2.5",
269
- "@openpresentation/opf": "^0.19.0",
269
+ "@openpresentation/opf": "^0.20.1",
270
270
  "jsonc-parser": "3.3.1"
271
271
  },
272
272
  "peerDependencies": {
273
- "@openpresentation/opf-render": "^0.19.1"
273
+ "@openpresentation/opf-render": "^0.20.0"
274
274
  },
275
275
  "peerDependenciesMeta": {
276
276
  "@openpresentation/opf-render": {
@@ -278,7 +278,7 @@
278
278
  }
279
279
  },
280
280
  "devDependencies": {
281
- "@openpresentation/gallery": "^2.0.0",
281
+ "@openpresentation/gallery": "^3.0.0",
282
282
  "@expo-google-fonts/arimo": "0.4.3",
283
283
  "@expo-google-fonts/caladea": "0.4.2",
284
284
  "@expo-google-fonts/cousine": "0.4.3",
@@ -323,8 +323,8 @@
323
323
  "@expo-google-fonts/roboto-mono": "0.4.2",
324
324
  "@expo-google-fonts/stix-two-math": "0.4.0",
325
325
  "@expo-google-fonts/tinos": "0.4.2",
326
- "@openpresentation/opf-pptx": "^0.19.0",
327
- "@openpresentation/opf-render": "^0.19.1",
326
+ "@openpresentation/opf-pptx": "^0.20.0",
327
+ "@openpresentation/opf-render": "^0.20.0",
328
328
  "@resvg/resvg-js": "2.6.2",
329
329
  "axe-core": "4.14.0",
330
330
  "esbuild": "0.28.2",