@openpresentation/opf-editor 0.12.1 → 0.15.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.
Files changed (103) hide show
  1. package/README.md +122 -80
  2. package/dist/annotations.d.ts +16 -16
  3. package/dist/annotations.js +71 -79
  4. package/dist/assets.d.ts +7 -7
  5. package/dist/assets.js +16 -16
  6. package/dist/background-options.d.ts +12 -5
  7. package/dist/background-options.js +44 -19
  8. package/dist/block-controls.js +7 -7
  9. package/dist/block-convert.d.ts +7 -7
  10. package/dist/block-convert.js +22 -21
  11. package/dist/blocks.d.ts +8 -8
  12. package/dist/blocks.js +41 -40
  13. package/dist/canvas-fields.js +35 -12
  14. package/dist/canvas.d.ts +30 -31
  15. package/dist/canvas.js +64 -68
  16. package/dist/catalogs.d.ts +48 -0
  17. package/dist/catalogs.js +217 -0
  18. package/dist/chart-data.d.ts +10 -10
  19. package/dist/chart-data.js +21 -21
  20. package/dist/chart-options-panel.d.ts +2 -2
  21. package/dist/chart-options-panel.js +82 -8
  22. package/dist/chart-options.d.ts +35 -9
  23. package/dist/chart-options.js +133 -40
  24. package/dist/checks.js +23 -0
  25. package/dist/color-authoring.js +1 -1
  26. package/dist/content-actions.d.ts +17 -17
  27. package/dist/content-actions.js +74 -73
  28. package/dist/content-controls.js +21 -21
  29. package/dist/data-grid.js +7 -8
  30. package/dist/data.d.ts +4 -4
  31. package/dist/data.js +5 -5
  32. package/dist/dataset-refs.d.ts +2 -2
  33. package/dist/dataset-refs.js +5 -5
  34. package/dist/design-controls.d.ts +12 -5
  35. package/dist/design-controls.js +312 -111
  36. package/dist/design-options.d.ts +20 -18
  37. package/dist/design-options.js +91 -99
  38. package/dist/edit-helpers.js +8 -7
  39. package/dist/exact-source.js +5 -5
  40. package/dist/export.d.ts +7 -7
  41. package/dist/export.js +48 -17
  42. package/dist/find-panel.js +5 -5
  43. package/dist/find-replace.d.ts +3 -3
  44. package/dist/find-replace.js +23 -20
  45. package/dist/font-gate.js +49 -58
  46. package/dist/galleries.js +50 -101
  47. package/dist/grid-model.d.ts +25 -27
  48. package/dist/grid-model.js +92 -102
  49. package/dist/image-crop.d.ts +4 -4
  50. package/dist/image-crop.js +28 -29
  51. package/dist/image-cropper.js +3 -3
  52. package/dist/image-options.d.ts +45 -0
  53. package/dist/image-options.js +195 -0
  54. package/dist/index.d.ts +48 -31
  55. package/dist/index.js +154 -126
  56. package/dist/json-editor.js +2 -2
  57. package/dist/json-menu.js +2 -2
  58. package/dist/json-options.d.ts +3 -3
  59. package/dist/json-options.js +44 -54
  60. package/dist/layout-handles.js +5 -5
  61. package/dist/layout-placeholders.js +4 -4
  62. package/dist/layout.d.ts +2 -2
  63. package/dist/layout.js +8 -7
  64. package/dist/numbering-panel.js +3 -5
  65. package/dist/numbering.d.ts +3 -5
  66. package/dist/numbering.js +14 -26
  67. package/dist/outline-view.js +24 -24
  68. package/dist/outline.d.ts +12 -12
  69. package/dist/outline.js +52 -50
  70. package/dist/persistence.d.ts +1 -1
  71. package/dist/persistence.js +19 -18
  72. package/dist/presentation-ids.js +2 -2
  73. package/dist/react.js +3 -3
  74. package/dist/review-panel.d.ts +30 -13
  75. package/dist/review-panel.js +160 -53
  76. package/dist/review.d.ts +36 -43
  77. package/dist/review.js +92 -53
  78. package/dist/rich-text-input.js +4 -3
  79. package/dist/rich-text-toolbar.js +5 -3
  80. package/dist/rich-text.js +5 -2
  81. package/dist/schema-inspector.d.ts +2 -2
  82. package/dist/schema-inspector.js +16 -11
  83. package/dist/schema.d.ts +1 -1
  84. package/dist/schema.js +26 -6
  85. package/dist/slide-manager.d.ts +2 -2
  86. package/dist/slide-manager.js +19 -19
  87. package/dist/slides.d.ts +21 -21
  88. package/dist/slides.js +104 -101
  89. package/dist/svelte.js +2 -3
  90. package/dist/switches.d.ts +37 -22
  91. package/dist/switches.js +282 -171
  92. package/dist/table-options.d.ts +8 -8
  93. package/dist/table-options.js +28 -27
  94. package/dist/table-structure.d.ts +10 -10
  95. package/dist/table-structure.js +21 -21
  96. package/dist/template-panel.d.ts +3 -3
  97. package/dist/template-panel.js +37 -13
  98. package/dist/templates.d.ts +22 -11
  99. package/dist/templates.js +48 -55
  100. package/dist/transfer.d.ts +15 -4
  101. package/dist/transfer.js +107 -161
  102. package/package.json +12 -6
  103. package/dist/font-defaults.js +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpresentation/opf-editor",
3
- "version": "0.12.1",
3
+ "version": "0.15.0",
4
4
  "description": "Embeddable local OPF editor primitives built on the deterministic renderer.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -118,6 +118,10 @@
118
118
  "types": "./dist/background-options.d.ts",
119
119
  "default": "./dist/background-options.js"
120
120
  },
121
+ "./image-options": {
122
+ "types": "./dist/image-options.d.ts",
123
+ "default": "./dist/image-options.js"
124
+ },
121
125
  "./review": {
122
126
  "types": "./dist/review.d.ts",
123
127
  "default": "./dist/review.js"
@@ -218,7 +222,7 @@
218
222
  "check:font-hotlinks": "node --test scripts/check-font-hotlinks.test.mjs && node scripts/check-font-hotlinks.mjs",
219
223
  "check:font-hotlinks:built": "node scripts/check-font-hotlinks.mjs --built dist artifacts/playground",
220
224
  "build:playground": "node scripts/build-playground.mjs",
221
- "test:playground": "npm run build:playground && npm run check:font-hotlinks:built && node test/playground-pptx.mjs && node test/playground-script-fonts.mjs artifacts/playground-script-fonts && node test/playground-lazy-fonts.mjs artifacts/playground-lazy-fonts && node test/playground-base-fonts.mjs artifacts/playground-base-fonts && node test/playground-source.mjs && node test/design-controls-browser.mjs && node test/design-gaps-browser.mjs && node test/chart-options-browser.mjs && node test/persistence-browser.mjs && node test/slides-browser.mjs && node test/template-panel-browser.mjs && node test/numbering-panel-browser.mjs && node test/playground-ensure-fonts.mjs artifacts/playground-ensure-fonts && node test/canvas-fonts-browser.mjs artifacts/canvas-fonts && node test/find-replace-browser.mjs && node test/image-crop-browser.mjs && node test/mobile-browser.mjs && node test/review-panel-browser.mjs && node test/playground-download.mjs artifacts/playground-download",
225
+ "test:playground": "npm run build:playground && npm run check:font-hotlinks:built && node test/playground-pptx.mjs && node test/playground-script-fonts.mjs artifacts/playground-script-fonts && node test/playground-lazy-fonts.mjs artifacts/playground-lazy-fonts && node test/playground-base-fonts.mjs artifacts/playground-base-fonts && node test/playground-source.mjs && node test/design-controls-browser.mjs && node test/design-gaps-browser.mjs && node test/chart-options-browser.mjs && node test/persistence-browser.mjs && node test/slides-browser.mjs && node test/template-panel-browser.mjs && node test/numbering-panel-browser.mjs && node test/playground-ensure-fonts.mjs artifacts/playground-ensure-fonts && node test/canvas-fonts-browser.mjs artifacts/canvas-fonts && node test/find-replace-browser.mjs && node test/image-crop-browser.mjs && node test/mobile-browser.mjs && node test/review-panel-browser.mjs && node test/review-hook-browser.mjs && node test/playground-download.mjs artifacts/playground-download",
222
226
  "test:code-browser": "node test/code-browser.mjs",
223
227
  "test:selection-browser": "node test/selection-browser.mjs",
224
228
  "test:click-entry-browser": "node test/click-entry-browser.mjs",
@@ -238,6 +242,8 @@
238
242
  "test:crop-browser": "node test/image-crop-browser.mjs",
239
243
  "test:mobile-browser": "node test/mobile-browser.mjs",
240
244
  "test:review-panel-browser": "node test/review-panel-browser.mjs",
245
+ "test:review-hook-browser": "node test/review-hook-browser.mjs",
246
+ "test:export-license-browser": "node test/export-license-browser.mjs",
241
247
  "test:chart-options-browser": "node test/chart-options-browser.mjs",
242
248
  "test:numbering-panel-browser": "node test/numbering-panel-browser.mjs"
243
249
  },
@@ -251,11 +257,11 @@
251
257
  "@codemirror/state": "6.7.6",
252
258
  "@codemirror/view": "6.43.13",
253
259
  "@lezer/highlight": "1.2.4",
254
- "@openpresentation/opf": "^0.13.0",
260
+ "@openpresentation/opf": "^0.15.1",
255
261
  "jsonc-parser": "3.3.1"
256
262
  },
257
263
  "peerDependencies": {
258
- "@openpresentation/opf-render": "^0.13.1"
264
+ "@openpresentation/opf-render": "^0.15.0"
259
265
  },
260
266
  "peerDependenciesMeta": {
261
267
  "@openpresentation/opf-render": {
@@ -297,8 +303,8 @@
297
303
  "@expo-google-fonts/noto-sans-thai": "0.4.2",
298
304
  "@expo-google-fonts/noto-serif-hebrew": "0.4.2",
299
305
  "@expo-google-fonts/noto-serif-tibetan": "0.4.2",
300
- "@openpresentation/opf-pptx": "^0.13.2",
301
- "@openpresentation/opf-render": "^0.13.1",
306
+ "@openpresentation/opf-pptx": "^0.15.0",
307
+ "@openpresentation/opf-render": "^0.15.0",
302
308
  "axe-core": "4.13.0",
303
309
  "esbuild": "0.28.2",
304
310
  "jszip": "3.10.2",
@@ -1,25 +0,0 @@
1
- /**
2
- * Last-resort font scheme id, shared with core pagination, opf-render and opf-pptx
3
- * (`DEFAULT_FONT_SCHEME` in `@openpresentation/opf`). It applies only when neither the
4
- * slide, the deck nor the resolved theme names a font scheme, so the editor measures and
5
- * freezes the same fonts that preview and PowerPoint export use.
6
- * Kept local until the published core exports the constant; a test asserts they agree.
7
- */
8
- export const DEFAULT_FONT_SCHEME = "aptos";
9
-
10
- /**
11
- * Resolve a font-scheme reference by the shared rule (`resolveFontSchemeReference` in
12
- * `@openpresentation/opf`). An id that matches no record yields one
13
- * `unresolved-font-scheme` diagnostic and uses the DEFAULT_FONT_SCHEME record as the base,
14
- * with sibling overrides on top. Kept local until a published core exports the function;
15
- * a test compares both whenever the installed core has it.
16
- */
17
- export function resolveFontSchemeReference(reference, lookup, path = "design.fontScheme") {
18
- const overrides = reference && typeof reference === "object" && !Array.isArray(reference) ? reference : undefined;
19
- const id = typeof reference === "string" ? reference : typeof overrides?.id === "string" ? overrides.id : undefined;
20
- const found = id === undefined ? undefined : lookup(id);
21
- const base = found ?? lookup(DEFAULT_FONT_SCHEME) ?? {};
22
- const scheme = overrides ? { ...base, ...overrides } : { ...base };
23
- if (id === undefined || found !== undefined) return { scheme };
24
- return { scheme, diagnostic: { code: "unresolved-font-scheme", path, id, fallback: DEFAULT_FONT_SCHEME, message: `Font scheme '${id}' is not in the inline or bundled catalogs; using the default font scheme '${DEFAULT_FONT_SCHEME}'.` } };
25
- }