oasis-editor 0.0.115 → 0.0.116

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.
package/dist/react.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- import type React from "react";
2
- import type { OasisEditorAppProps, OasisEditorClient } from "oasis-editor";
1
+ import { default as React } from 'react';
2
+ import { OasisEditorAppProps, OasisEditorClient } from '../index.ts';
3
3
 
4
4
  export type ReactOasisEditorProps = OasisEditorAppProps & {
5
- /**
6
- * Receives the mounted Oasis client. Props are mount-only for this adapter;
7
- * remount the component to apply a new editor configuration.
8
- */
9
- onClient?: (client: OasisEditorClient) => void;
5
+ /**
6
+ * Receives the mounted Oasis client. Props are mount-only for this adapter;
7
+ * remount the component to apply a new editor configuration.
8
+ */
9
+ onClient?: (client: OasisEditorClient) => void;
10
10
  };
11
-
12
11
  export declare const OasisEditor: React.FC<ReactOasisEditorProps>;
package/dist/react.js CHANGED
@@ -1,24 +1,20 @@
1
- import React, { useEffect, useRef } from "react";
2
- import { mount } from "oasis-editor";
3
-
4
- export function OasisEditor(props) {
5
- const containerRef = useRef(null);
6
- const instanceRef = useRef(null);
7
-
8
- useEffect(() => {
9
- if (containerRef.current) {
10
- instanceRef.current = mount(containerRef.current, props);
11
- props.onClient?.(instanceRef.current);
12
- }
13
- return () => {
14
- instanceRef.current?.unmount();
15
- instanceRef.current = null;
1
+ import f, { useRef as i, useEffect as a } from "react";
2
+ import { mount as m } from "oasis-editor";
3
+ const R = (e) => {
4
+ var r, u;
5
+ const n = i(null), t = i(null);
6
+ return a(() => {
7
+ var c;
8
+ return n.current && (t.current = m(n.current, e), (c = e.onClient) == null || c.call(e, t.current)), () => {
9
+ var l;
10
+ (l = t.current) == null || l.unmount(), t.current = null;
16
11
  };
17
- }, []);
18
-
19
- return React.createElement("div", {
20
- ref: containerRef,
21
- className: props.ui?.class,
22
- style: props.ui?.style,
12
+ }, []), f.createElement("div", {
13
+ ref: n,
14
+ className: (r = e.ui) == null ? void 0 : r.class,
15
+ style: (u = e.ui) == null ? void 0 : u.style
23
16
  });
24
- }
17
+ };
18
+ export {
19
+ R as OasisEditor
20
+ };
@@ -44,7 +44,7 @@ export declare function prepareCells(options: {
44
44
  columnOffsets: number[];
45
45
  cellSpacingPx: number;
46
46
  visualColumnCount: number;
47
- effectiveRowStyles: (EditorTableNode["rows"][number]["style"])[];
47
+ effectiveRowStyles: EditorTableNode["rows"][number]["style"][];
48
48
  state: EditorState;
49
49
  pageIndex: number;
50
50
  }): {
@@ -4,6 +4,6 @@ import { PreparedCell } from './prepareCells.js';
4
4
  export declare function resolveRowHeights(options: {
5
5
  prepared: PreparedCell[];
6
6
  table: EditorTableNode;
7
- effectiveRowStyles: (EditorTableNode["rows"][number]["style"])[];
7
+ effectiveRowStyles: EditorTableNode["rows"][number]["style"][];
8
8
  estimatedHeight: number;
9
9
  }): number[];
@@ -1,7 +1,6 @@
1
- import { JSX } from 'solid-js';
2
1
  import { UseEditorFindReplaceResult } from '../../../app/controllers/useEditorFindReplace.js';
3
2
 
4
3
  export interface FindReplaceDialogProps {
5
4
  fr: UseEditorFindReplaceResult;
6
5
  }
7
- export declare function FindReplaceDialog(props: FindReplaceDialogProps): JSX.Element;
6
+ export declare function FindReplaceDialog(props: FindReplaceDialogProps): import("solid-js").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { JSX } from 'solid-js';
2
1
  import { MenuRegistry, MenubarHost } from './menuRegistry.js';
3
2
 
4
3
  export interface MenubarProps {
5
4
  host: () => MenubarHost;
6
5
  registry: MenuRegistry;
7
6
  }
8
- export declare function Menubar(props: MenubarProps): JSX.Element;
7
+ export declare function Menubar(props: MenubarProps): import("solid-js").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export interface PageBreakProps {
2
2
  pageIndex: number;
3
3
  }
4
- export declare function PageBreak(props: PageBreakProps): import("solid-js").JSX.Element;
4
+ export declare function PageBreak(_props: PageBreakProps): import("solid-js").JSX.Element;
package/dist/ui.d.ts CHANGED
@@ -1,42 +1,2 @@
1
- export {
2
- Button,
3
- Checkbox,
4
- ColorPicker,
5
- Dialog,
6
- DialogFooter,
7
- GridPicker,
8
- IconButton,
9
- Menu,
10
- Popover,
11
- Select,
12
- SelectField,
13
- Separator,
14
- SplitButton,
15
- Tabs,
16
- TextField,
17
- ToolbarButton,
18
- ToolbarColorPicker,
19
- } from "oasis-editor";
20
-
21
- export type {
22
- ButtonProps,
23
- CheckboxProps,
24
- ColorPickerKind,
25
- ColorPickerProps,
26
- DialogFooterProps,
27
- DialogProps,
28
- GridPickerProps,
29
- IconButtonProps,
30
- MenuProps,
31
- PopoverProps,
32
- PopoverTriggerApi,
33
- SelectFieldOption,
34
- SelectFieldProps,
35
- SeparatorProps,
36
- SplitButtonProps,
37
- TabsItem,
38
- TabsProps,
39
- TextFieldProps,
40
- ToolbarButtonProps,
41
- ToolbarSelectProps,
42
- } from "oasis-editor";
1
+ export { Button, Checkbox, ColorPicker, ColorPicker as ToolbarColorPicker, Dialog, DialogFooter, GridPicker, IconButton, Menu, Popover, Select, SelectField, Separator, SplitButton, Tabs, TextField, ToolbarButton, } from '../index.ts';
2
+ export type { ButtonProps, CheckboxProps, ColorPickerKind, ColorPickerProps, DialogFooterProps, DialogProps, GridPickerProps, IconButtonProps, MenuProps, PopoverProps, PopoverTriggerApi, SelectFieldOption, SelectFieldProps, SeparatorProps, SplitButtonProps, TabsItem, TabsProps, TextFieldProps, ToolbarButtonProps, ToolbarSelectProps, } from '../index.ts';
package/dist/ui.js CHANGED
@@ -1,19 +1,20 @@
1
+ import { Button as r, Checkbox as t, ColorPicker as l, Dialog as i, DialogFooter as a, GridPicker as c, IconButton as n, Menu as k, Popover as u, Select as P, SelectField as b, Separator as p, SplitButton as B, Tabs as C, TextField as S, ToolbarButton as T, ColorPicker as d } from "oasis-editor";
1
2
  export {
2
- Button,
3
- Checkbox,
4
- ColorPicker,
5
- ColorPicker as ToolbarColorPicker,
6
- Dialog,
7
- DialogFooter,
8
- GridPicker,
9
- IconButton,
10
- Menu,
11
- Popover,
12
- Select,
13
- SelectField,
14
- Separator,
15
- SplitButton,
16
- Tabs,
17
- TextField,
18
- ToolbarButton,
19
- } from "oasis-editor";
3
+ r as Button,
4
+ t as Checkbox,
5
+ l as ColorPicker,
6
+ i as Dialog,
7
+ a as DialogFooter,
8
+ c as GridPicker,
9
+ n as IconButton,
10
+ k as Menu,
11
+ u as Popover,
12
+ P as Select,
13
+ b as SelectField,
14
+ p as Separator,
15
+ B as SplitButton,
16
+ C as Tabs,
17
+ S as TextField,
18
+ T as ToolbarButton,
19
+ d as ToolbarColorPicker
20
+ };
@@ -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.116",
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",