oasis-editor 0.0.115 → 0.0.117

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 (50) hide show
  1. package/dist/{OasisEditorApp-C1dyjJoH.js → OasisEditorApp-DijR5F-O.js} +2183 -907
  2. package/dist/adapters/react.d.ts +11 -0
  3. package/dist/adapters/ui.d.ts +2 -0
  4. package/dist/adapters/vue.d.ts +23 -0
  5. package/dist/assets/{importDocxWorker-D0F0jbcF.js → importDocxWorker-nIS-zjkj.js} +1 -1
  6. package/dist/core/html/inlineImageParser.d.ts +7 -0
  7. package/dist/core/layoutConstants.d.ts +18 -0
  8. package/dist/{index-Cq3YFYX2.js → index-Comlrue1.js} +779 -738
  9. package/dist/layoutProjection/blocksPaginationTypes.d.ts +2 -0
  10. package/dist/layoutProjection/constants.d.ts +7 -1
  11. package/dist/layoutProjection/footnotePagination.d.ts +0 -1
  12. package/dist/layoutProjection/headerFooterLayoutContext.d.ts +2 -0
  13. package/dist/layoutProjection/paginationTrack.d.ts +2 -0
  14. package/dist/layoutProjection/paragraphPagination.d.ts +8 -3
  15. package/dist/layoutProjection/sectionPagination.d.ts +3 -0
  16. package/dist/layoutProjection/tableRowSlicing.d.ts +2 -1
  17. package/dist/oasis-editor.css +1 -1
  18. package/dist/oasis-editor.js +55 -55
  19. package/dist/oasis-editor.umd.cjs +4 -4
  20. package/dist/react.d.ts +7 -8
  21. package/dist/react.js +18 -22
  22. package/dist/ui/canvas/table/prepareCells.d.ts +1 -1
  23. package/dist/ui/canvas/table/resolveRowHeights.d.ts +1 -1
  24. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +2 -99
  25. package/dist/ui/components/Dialogs/font-dialog/FontTab.d.ts +2 -1
  26. package/dist/ui/components/Dialogs/table-properties/AltTextTabPanel.d.ts +3 -0
  27. package/dist/ui/components/Dialogs/table-properties/CellTabPanel.d.ts +3 -0
  28. package/dist/ui/components/Dialogs/table-properties/ColumnTabPanel.d.ts +3 -0
  29. package/dist/ui/components/Dialogs/table-properties/RowTabPanel.d.ts +3 -0
  30. package/dist/ui/components/Dialogs/table-properties/TablePropertiesController.d.ts +12 -0
  31. package/dist/ui/components/Dialogs/table-properties/TablePropertiesTypes.d.ts +160 -0
  32. package/dist/ui/components/Dialogs/table-properties/TableTabPanel.d.ts +6 -0
  33. package/dist/ui/components/Dialogs/table-properties/fields.d.ts +9 -0
  34. package/dist/ui/components/Dialogs/table-properties/useTablePropertiesController.d.ts +4 -0
  35. package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +1 -2
  36. package/dist/ui/components/Menubar/Menubar.d.ts +1 -2
  37. package/dist/ui/components/PageBreak.d.ts +1 -1
  38. package/dist/ui/components/Toolbar/primitives/useSurfaceRect.d.ts +20 -0
  39. package/dist/ui/public/FieldRow.d.ts +13 -0
  40. package/dist/ui/public/NumberField.d.ts +13 -0
  41. package/dist/ui/public/Radio.d.ts +38 -0
  42. package/dist/ui/public/ToggleChip.d.ts +14 -0
  43. package/dist/ui/public/index.d.ts +8 -0
  44. package/dist/ui.d.ts +2 -42
  45. package/dist/ui.js +19 -18
  46. package/dist/utils/performanceMetrics.d.ts +0 -6
  47. package/dist/utils/round.d.ts +7 -0
  48. package/dist/vue.d.ts +22 -8
  49. package/dist/vue.js +18 -24
  50. package/package.json +9 -6
@@ -1,9 +1,3 @@
1
- /**
2
- * Performance metrics infrastructure for oasis-editor.
3
- *
4
- * Captures longtasks, marks input-to-layout latency, and exposes
5
- * a global report via `window.__OASIS_PERF_REPORT()`.
6
- */
7
1
  interface PerfMark {
8
2
  name: string;
9
3
  duration: number;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Rounds `value` to `decimals` fractional digits. Equivalent to the
3
+ * `Math.round(value * 10 ** decimals) / 10 ** decimals` idiom that was repeated
4
+ * across the import, UI and metrics layers (audit #27); results are
5
+ * byte-identical to those inline expressions.
6
+ */
7
+ export declare function roundTo(value: number, decimals: number): number;
package/dist/vue.d.ts CHANGED
@@ -1,9 +1,23 @@
1
- import type { DefineComponent } from "vue";
2
- import type { OasisEditorAppProps, OasisEditorClient } from "oasis-editor";
1
+ import { OasisEditorAppProps, OasisEditorClient } from '../index.ts';
3
2
 
4
- export declare const OasisEditor: DefineComponent<{
5
- config?: OasisEditorAppProps;
6
- class?: string;
7
- style?: string | Record<string, unknown>;
8
- onClient?: (client: OasisEditorClient) => void;
9
- }>;
3
+ export declare const OasisEditor: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ config: {
5
+ type: () => OasisEditorAppProps;
6
+ default: () => {};
7
+ };
8
+ class: StringConstructor;
9
+ style: () => string | Record<string, unknown>;
10
+ onClient: () => (client: OasisEditorClient) => void;
11
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
+ [key: string]: any;
13
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
14
+ config: {
15
+ type: () => OasisEditorAppProps;
16
+ default: () => {};
17
+ };
18
+ class: StringConstructor;
19
+ style: () => string | Record<string, unknown>;
20
+ onClient: () => (client: OasisEditorClient) => void;
21
+ }>> & Readonly<{}>, {
22
+ config: OasisEditorAppProps;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
package/dist/vue.js CHANGED
@@ -1,33 +1,27 @@
1
- import { defineComponent, onBeforeUnmount, onMounted, ref, h } from "vue";
2
- import { mount } from "oasis-editor";
3
-
4
- export const OasisEditor = defineComponent({
1
+ import { defineComponent as l, ref as i, onMounted as u, onBeforeUnmount as f, h as c } from "vue";
2
+ import { mount as m } from "oasis-editor";
3
+ const a = l({
5
4
  name: "OasisEditor",
6
5
  props: {
7
6
  config: {
8
7
  type: Object,
9
- default: () => ({}),
8
+ default: () => ({})
10
9
  },
11
10
  class: String,
12
11
  style: [String, Object],
13
- onClient: Function,
14
- },
15
- setup(props) {
16
- const root = ref(null);
17
- let instance = null;
18
-
19
- onMounted(() => {
20
- if (root.value) {
21
- instance = mount(root.value, props.config);
22
- props.onClient?.(instance);
23
- }
24
- });
25
-
26
- onBeforeUnmount(() => {
27
- instance?.unmount();
28
- instance = null;
29
- });
30
-
31
- return () => h("div", { ref: root, class: props.class, style: props.style });
12
+ onClient: Function
32
13
  },
14
+ setup(t) {
15
+ const e = i(null);
16
+ let n = null;
17
+ return u(() => {
18
+ var o;
19
+ e.value && (n = m(e.value, t.config), (o = t.onClient) == null || o.call(t, n));
20
+ }), f(() => {
21
+ n == null || n.unmount(), n = null;
22
+ }), () => c("div", { ref: e, class: t.class, style: t.style });
23
+ }
33
24
  });
25
+ export {
26
+ a as OasisEditor
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.115",
3
+ "version": "0.0.117",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  }
31
31
  },
32
32
  "peerDependencies": {
33
- "react": ">=18",
33
+ "react": ">=17",
34
34
  "vue": ">=3"
35
35
  },
36
36
  "peerDependenciesMeta": {
@@ -47,7 +47,7 @@
47
47
  "scripts": {
48
48
  "brand:generate": "node ./scripts/generate-brand-assets.mjs",
49
49
  "dev": "vite",
50
- "build:lib": "vite build --mode lib && node ./scripts/build-adapters.mjs",
50
+ "build:lib": "vite build --mode lib && vite build --config vite.adapters.config.js",
51
51
  "build:app": "vite build",
52
52
  "build": "npm run build:lib && npm run build:app",
53
53
  "prepack": "npm run build:lib",
@@ -59,13 +59,15 @@
59
59
  "test": "vitest run",
60
60
  "test:word-parity": "vitest run --config vitest.word-parity.config.js",
61
61
  "check:imports": "node ./scripts/check-import-graph.mjs",
62
- "lint": "eslint src --ext .ts",
63
- "format": "prettier --write \"src/**/*.ts\""
62
+ "typecheck": "tsc --noEmit",
63
+ "lint": "eslint src --ext .ts,.tsx",
64
+ "format": "prettier --write \"src/**/*.{ts,tsx}\""
64
65
  },
65
66
  "devDependencies": {
66
67
  "@playwright/test": "^1.59.1",
67
68
  "@types/jszip": "^3.4.0",
68
69
  "@types/node": "^20.0.0",
70
+ "@types/react": "^19.2.17",
69
71
  "@types/web": "^0.0.115",
70
72
  "@typescript-eslint/eslint-plugin": "^7.0.0",
71
73
  "@typescript-eslint/parser": "^7.0.0",
@@ -82,7 +84,8 @@
82
84
  "vite": "^5.4.19",
83
85
  "vite-plugin-dts": "^3.7.3",
84
86
  "vite-plugin-solid": "^2.11.12",
85
- "vitest": "^1.3.1"
87
+ "vitest": "^1.3.1",
88
+ "vue": "^3.5.39"
86
89
  },
87
90
  "dependencies": {
88
91
  "@xmldom/xmldom": "^0.9.10",