@superdoc-dev/react 2.0.0-next.2 → 2.0.0-next.4
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/README.md +21 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +96 -87
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -92,7 +92,8 @@ All [SuperDoc config options](https://docs.superdoc.dev) are available as props,
|
|
|
92
92
|
|------|------|-------------|
|
|
93
93
|
| `id` | `string` | Custom container ID (auto-generated if not provided) |
|
|
94
94
|
| `renderLoading` | `() => ReactNode` | Loading UI |
|
|
95
|
-
| `hideToolbar` | `boolean` | Hide toolbar (default: false) |
|
|
95
|
+
| `hideToolbar` | `boolean` | Hide toolbar (default: false). Older spelling of `ui.toolbar: false`; still wins when set |
|
|
96
|
+
| `contained` | `boolean` | Scroll inside a fixed-height parent (default: false) |
|
|
96
97
|
| `className` | `string` | Wrapper CSS class |
|
|
97
98
|
| `style` | `CSSProperties` | Wrapper inline styles |
|
|
98
99
|
|
|
@@ -104,8 +105,11 @@ These props cause the SuperDoc instance to be destroyed and recreated when chang
|
|
|
104
105
|
- `user` - Current user identity
|
|
105
106
|
- `users` - List of users
|
|
106
107
|
- `modules` - Module configuration (collaboration, comments, etc.)
|
|
108
|
+
- `ui` - Built-in UI configuration (see below)
|
|
107
109
|
- `role` - User permission level
|
|
108
110
|
- `hideToolbar` - Toolbar visibility
|
|
111
|
+
- `contained` - Fixed-height container mode
|
|
112
|
+
- `id` - Editor and toolbar container identity
|
|
109
113
|
|
|
110
114
|
### Props Handled Efficiently
|
|
111
115
|
|
|
@@ -121,6 +125,22 @@ Other SuperDoc options (`rulers`, `pagination`, etc.) are applied only on initia
|
|
|
121
125
|
ref.current?.getInstance()?.toggleRuler();
|
|
122
126
|
```
|
|
123
127
|
|
|
128
|
+
### Built-in UI
|
|
129
|
+
|
|
130
|
+
`ui` controls which built-in surfaces SuperDoc renders. Omit it and everything behaves as it always has.
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
<SuperDocEditor document={file} ui={{ toolbar: false }} />
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- `ui={false}` renders no built-in UI at all: no toolbar, comments, or context menu. It does not disable editing, the Document API, or `superdoc.ui`, so it is the setting to reach for when the application draws its own interface.
|
|
137
|
+
- `ui={{ toolbar: false }}` turns off one surface and leaves the rest alone. Every key works this way, so a partial `ui` object stays additive.
|
|
138
|
+
- `ui={{ toolbar: { container: '#my-toolbar' } }}` mounts the built-in toolbar into an element you own. React then skips its own toolbar host rather than rendering an empty one.
|
|
139
|
+
|
|
140
|
+
`hideToolbar` predates this and still wins when set, so existing components keep working. Prefer `ui.toolbar: false` in new code: it says the same thing in the core configuration and applies across every framework.
|
|
141
|
+
|
|
142
|
+
Changing `ui` rebuilds the instance, as the list above notes. Pass a stable object (a module constant, or one wrapped in `useMemo`) rather than an inline literal, or every render will tear the editor down and recreate it.
|
|
143
|
+
|
|
124
144
|
### Common Props
|
|
125
145
|
|
|
126
146
|
```tsx
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`react/jsx-runtime`);function u(){let e=c.useRef(null);return e.current===null&&(e.current=`-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),e.current}var d=c.useId;const f=typeof d==`function`?d:u;function p(e){let t=c.useRef(e),n=c.useRef(e);return t.current!==e&&(m(n.current,e)||(n.current=e),t.current=e),n.current}function m(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function h(e,t){let[n,r]=(0,c.useState)(!1),{id:i,renderLoading:a,hideToolbar:o=!1,contained:s=!1,className:u,style:d,onReady:m,onEditorCreate:h,onEditorDestroy:g,onEditorUpdate:_,onTransaction:v,onContentError:y,onException:b,onZoomChange:x,onViewportChange:S,document:C,user:w,users:T,modules:E,...
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`react/jsx-runtime`);function u(){let e=c.useRef(null);return e.current===null&&(e.current=`-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),e.current}var d=c.useId;const f=typeof d==`function`?d:u;function p(e){let t=c.useRef(e),n=c.useRef(e);return t.current!==e&&(m(n.current,e)||(n.current=e),t.current=e),n.current}function m(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function h(e,t){let[n,r]=(0,c.useState)(!1),{id:i,renderLoading:a,hideToolbar:o=!1,contained:s=!1,className:u,style:d,onReady:m,onEditorCreate:h,onEditorDestroy:g,onEditorUpdate:_,onTransaction:v,onContentError:y,onException:b,onZoomChange:x,onViewportChange:S,document:C,user:w,users:T,modules:E,ui:D,...O}=e,k=e.documentMode??`editing`,A=e.role??`editor`,j=D===!1?!1:D?.toolbar,M=typeof j==`object`&&!!j&&j.container!==void 0,N=!o&&j!==!1&&!M,P=(()=>{if(D===!1||D===void 0||!o)return D;let{toolbar:e,...t}=D;return{...t,toolbar:!1}})(),F=p(w),I=p(T),L=(0,c.useRef)(null),R=(0,c.useRef)(null),z=f(),B=i??`superdoc${z}`,V=B,H=`${B}-toolbar`,[U,W]=(0,c.useState)(!0),G=(0,c.useRef)({onReady:m,onEditorCreate:h,onEditorDestroy:g,onEditorUpdate:_,onTransaction:v,onContentError:y,onException:b,onZoomChange:x,onViewportChange:S});(0,c.useEffect)(()=>{G.current={onReady:m,onEditorCreate:h,onEditorDestroy:g,onEditorUpdate:_,onTransaction:v,onContentError:y,onException:b,onZoomChange:x,onViewportChange:S}},[m,h,g,_,v,y,b,x,S]);let K=(0,c.useRef)(null),q=(0,c.useRef)(!1),J=(0,c.useRef)(k);(0,c.useEffect)(()=>{J.current!==k&&(L.current?L.current.setDocumentMode(k):q.current&&(K.current=k)),J.current=k},[k]),(0,c.useImperativeHandle)(t,()=>({getInstance:()=>L.current}),[]),(0,c.useEffect)(()=>{W(!0),r(!1),q.current=!0;let e=!1,t=null;return(async()=>{try{let n=(await import(`superdoc`)).SuperDoc;if(e)return;t=new n({...O,selector:`#${CSS.escape(V)}`,...N&&R.current?{toolbar:`#${CSS.escape(H)}`}:{},documentMode:k,role:A,contained:s,...C==null?{}:{document:C},...F?{user:F}:{},...I?{users:I}:{},...E?{modules:E}:{},...P===void 0?{}:{ui:P},onReady:t=>{e||(W(!1),q.current=!1,K.current&&K.current!==k&&(t.superdoc.setDocumentMode(K.current),K.current=null),G.current.onReady?.(t))},onEditorCreate:t=>{e||G.current.onEditorCreate?.(t)},onEditorDestroy:()=>{e||G.current.onEditorDestroy?.()},onEditorUpdate:t=>{e||G.current.onEditorUpdate?.(t)},onTransaction:t=>{e||G.current.onTransaction?.(t)},onContentError:t=>{e||G.current.onContentError?.(t)},onException:t=>{e||G.current.onException?.(t)},onZoomChange:t=>{e||G.current.onZoomChange?.(t)},onViewportChange:t=>{e||G.current.onViewportChange?.(t)}}),L.current=t}catch(t){e||(q.current=!1,W(!1),r(!0),console.error(`[SuperDocEditor] Failed to initialize SuperDoc:`,t),G.current.onException?.({error:t}))}})(),()=>{q.current=!1,K.current=null,t&&(t.destroy(),L.current=null),e=!0}},[C,F,I,E,D,A,o,s,V,H]);let Y=[`superdoc-wrapper`,u].filter(Boolean).join(` `),X=U?{display:`none`}:void 0;return(0,l.jsxs)(`div`,{className:Y,style:{...d,...s&&{display:`flex`,flexDirection:`column`}},children:[N&&(0,l.jsx)(`div`,{ref:R,id:H,className:`superdoc-toolbar-container`,style:X}),(0,l.jsx)(`div`,{id:V,className:`superdoc-editor-container`,style:{...X,...s&&{flex:1,minHeight:0}}}),U&&!n&&a&&(0,l.jsx)(`div`,{className:`superdoc-loading-container`,children:a()}),n&&(0,l.jsx)(`div`,{className:`superdoc-error-container`,children:`Failed to load editor. Check console for details.`})]})}const g=(0,c.forwardRef)(h);g.displayName=`SuperDocEditor`;var _=g;exports.SuperDocEditor=g,exports.default=_;
|
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,16 @@ declare interface ReactProps {
|
|
|
62
62
|
id?: string;
|
|
63
63
|
/** Render function for loading state */
|
|
64
64
|
renderLoading?: () => ReactNode;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Hide the toolbar container. When true, no toolbar is rendered.
|
|
67
|
+
*
|
|
68
|
+
* Prefer `ui.toolbar: false`, which says this in the core configuration and
|
|
69
|
+
* applies to every framework. `ui: false` also hides the toolbar, but it
|
|
70
|
+
* turns off every built-in surface — comments, context menu, and the rest —
|
|
71
|
+
* so reach for it only when the application owns the whole interface.
|
|
72
|
+
*
|
|
73
|
+
* This prop is the older spelling and still wins when set. @default false
|
|
74
|
+
*/
|
|
66
75
|
hideToolbar?: boolean;
|
|
67
76
|
/** Enable contained mode for fixed-height container embedding. When true, SuperDoc
|
|
68
77
|
* fits within its parent's height and scrolls internally. @default false */
|
|
@@ -104,7 +113,7 @@ export declare type SuperDocContentErrorEvent = Parameters<NonNullable<SuperDocC
|
|
|
104
113
|
/**
|
|
105
114
|
* SuperDocEditor component with forwardRef - Initializes SuperDoc instance and handles cleanup.
|
|
106
115
|
*/
|
|
107
|
-
declare const SuperDocEditor: ForwardRefExoticComponent<SuperDocEditorProps & RefAttributes<SuperDocRef>>;
|
|
116
|
+
declare const SuperDocEditor: ForwardRefExoticComponent<Omit<SuperDocEditorProps, "ref"> & RefAttributes<SuperDocRef>>;
|
|
108
117
|
export { SuperDocEditor }
|
|
109
118
|
export default SuperDocEditor;
|
|
110
119
|
|
package/dist/index.js
CHANGED
|
@@ -2,49 +2,57 @@ import * as React from "react";
|
|
|
2
2
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
function useIdPolyfill() {
|
|
5
|
-
let
|
|
6
|
-
return
|
|
5
|
+
let o = React.useRef(null);
|
|
6
|
+
return o.current === null && (o.current = `-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`), o.current;
|
|
7
7
|
}
|
|
8
8
|
var reactUseId = React.useId;
|
|
9
9
|
const useStableId = typeof reactUseId == "function" ? reactUseId : useIdPolyfill;
|
|
10
|
-
function useMemoByValue(
|
|
11
|
-
let
|
|
12
|
-
return
|
|
10
|
+
function useMemoByValue(o) {
|
|
11
|
+
let s = React.useRef(o), c = React.useRef(o);
|
|
12
|
+
return s.current !== o && (shallowJsonEqual(c.current, o) || (c.current = o), s.current = o), c.current;
|
|
13
13
|
}
|
|
14
|
-
function shallowJsonEqual(e,
|
|
15
|
-
if (e ===
|
|
16
|
-
if (e == null ||
|
|
14
|
+
function shallowJsonEqual(e, o) {
|
|
15
|
+
if (e === o) return !0;
|
|
16
|
+
if (e == null || o == null) return e === o;
|
|
17
17
|
try {
|
|
18
|
-
return JSON.stringify(e) === JSON.stringify(
|
|
18
|
+
return JSON.stringify(e) === JSON.stringify(o);
|
|
19
19
|
} catch {
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function SuperDocEditorInner(e,
|
|
24
|
-
let [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
function SuperDocEditorInner(e, o) {
|
|
24
|
+
let [l, u] = useState(!1), { id: d, renderLoading: f, hideToolbar: p = !1, contained: m = !1, className: h, style: g, onReady: _, onEditorCreate: v, onEditorDestroy: y, onEditorUpdate: b, onTransaction: x, onContentError: S, onException: C, onZoomChange: w, onViewportChange: T, document: E, user: D, users: O, modules: k, ui: A, ...j } = e, M = e.documentMode ?? "editing", N = e.role ?? "editor", P = A === !1 ? !1 : A?.toolbar, F = typeof P == "object" && !!P && P.container !== void 0, I = !p && P !== !1 && !F, L = (() => {
|
|
25
|
+
if (A === !1 || A === void 0 || !p) return A;
|
|
26
|
+
let { toolbar: e, ...o } = A;
|
|
27
|
+
return {
|
|
28
|
+
...o,
|
|
29
|
+
toolbar: !1
|
|
30
|
+
};
|
|
31
|
+
})(), R = useMemoByValue(D), z = useMemoByValue(O), B = useRef(null), V = useRef(null), H = useStableId(), U = d ?? `superdoc${H}`, W = U, G = `${U}-toolbar`, [K, q] = useState(!0), J = useRef({
|
|
32
|
+
onReady: _,
|
|
33
|
+
onEditorCreate: v,
|
|
34
|
+
onEditorDestroy: y,
|
|
35
|
+
onEditorUpdate: b,
|
|
36
|
+
onTransaction: x,
|
|
37
|
+
onContentError: S,
|
|
38
|
+
onException: C,
|
|
39
|
+
onZoomChange: w,
|
|
40
|
+
onViewportChange: T
|
|
34
41
|
});
|
|
35
42
|
useEffect(() => {
|
|
36
|
-
|
|
37
|
-
onReady:
|
|
38
|
-
onEditorCreate:
|
|
39
|
-
onEditorDestroy:
|
|
40
|
-
onEditorUpdate:
|
|
41
|
-
onTransaction:
|
|
42
|
-
onContentError:
|
|
43
|
-
onException:
|
|
44
|
-
onZoomChange:
|
|
45
|
-
onViewportChange:
|
|
43
|
+
J.current = {
|
|
44
|
+
onReady: _,
|
|
45
|
+
onEditorCreate: v,
|
|
46
|
+
onEditorDestroy: y,
|
|
47
|
+
onEditorUpdate: b,
|
|
48
|
+
onTransaction: x,
|
|
49
|
+
onContentError: S,
|
|
50
|
+
onException: C,
|
|
51
|
+
onZoomChange: w,
|
|
52
|
+
onViewportChange: T
|
|
46
53
|
};
|
|
47
54
|
}, [
|
|
55
|
+
_,
|
|
48
56
|
v,
|
|
49
57
|
y,
|
|
50
58
|
b,
|
|
@@ -52,108 +60,109 @@ function SuperDocEditorInner(e, s) {
|
|
|
52
60
|
S,
|
|
53
61
|
C,
|
|
54
62
|
w,
|
|
55
|
-
T
|
|
56
|
-
E
|
|
63
|
+
T
|
|
57
64
|
]);
|
|
58
|
-
let
|
|
65
|
+
let Y = useRef(null), X = useRef(!1), Z = useRef(M);
|
|
59
66
|
useEffect(() => {
|
|
60
|
-
|
|
61
|
-
}, [M]), useImperativeHandle(
|
|
62
|
-
|
|
63
|
-
let e = !1,
|
|
67
|
+
Z.current !== M && (B.current ? B.current.setDocumentMode(M) : X.current && (Y.current = M)), Z.current = M;
|
|
68
|
+
}, [M]), useImperativeHandle(o, () => ({ getInstance: () => B.current }), []), useEffect(() => {
|
|
69
|
+
q(!0), u(!1), X.current = !0;
|
|
70
|
+
let e = !1, o = null;
|
|
64
71
|
return (async () => {
|
|
65
72
|
try {
|
|
66
|
-
let
|
|
73
|
+
let s = (await import("superdoc")).SuperDoc;
|
|
67
74
|
if (e) return;
|
|
68
|
-
|
|
75
|
+
o = new s({
|
|
69
76
|
...j,
|
|
70
|
-
selector: `#${CSS.escape(
|
|
71
|
-
|
|
77
|
+
selector: `#${CSS.escape(W)}`,
|
|
78
|
+
...I && V.current ? { toolbar: `#${CSS.escape(G)}` } : {},
|
|
72
79
|
documentMode: M,
|
|
73
80
|
role: N,
|
|
74
|
-
contained:
|
|
75
|
-
...
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
-
...
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
contained: m,
|
|
82
|
+
...E == null ? {} : { document: E },
|
|
83
|
+
...R ? { user: R } : {},
|
|
84
|
+
...z ? { users: z } : {},
|
|
85
|
+
...k ? { modules: k } : {},
|
|
86
|
+
...L === void 0 ? {} : { ui: L },
|
|
87
|
+
onReady: (o) => {
|
|
88
|
+
e || (q(!1), X.current = !1, Y.current && Y.current !== M && (o.superdoc.setDocumentMode(Y.current), Y.current = null), J.current.onReady?.(o));
|
|
81
89
|
},
|
|
82
|
-
onEditorCreate: (
|
|
83
|
-
e ||
|
|
90
|
+
onEditorCreate: (o) => {
|
|
91
|
+
e || J.current.onEditorCreate?.(o);
|
|
84
92
|
},
|
|
85
93
|
onEditorDestroy: () => {
|
|
86
|
-
e ||
|
|
94
|
+
e || J.current.onEditorDestroy?.();
|
|
87
95
|
},
|
|
88
|
-
onEditorUpdate: (
|
|
89
|
-
e ||
|
|
96
|
+
onEditorUpdate: (o) => {
|
|
97
|
+
e || J.current.onEditorUpdate?.(o);
|
|
90
98
|
},
|
|
91
|
-
onTransaction: (
|
|
92
|
-
e ||
|
|
99
|
+
onTransaction: (o) => {
|
|
100
|
+
e || J.current.onTransaction?.(o);
|
|
93
101
|
},
|
|
94
|
-
onContentError: (
|
|
95
|
-
e ||
|
|
102
|
+
onContentError: (o) => {
|
|
103
|
+
e || J.current.onContentError?.(o);
|
|
96
104
|
},
|
|
97
|
-
onException: (
|
|
98
|
-
e ||
|
|
105
|
+
onException: (o) => {
|
|
106
|
+
e || J.current.onException?.(o);
|
|
99
107
|
},
|
|
100
|
-
onZoomChange: (
|
|
101
|
-
e ||
|
|
108
|
+
onZoomChange: (o) => {
|
|
109
|
+
e || J.current.onZoomChange?.(o);
|
|
102
110
|
},
|
|
103
|
-
onViewportChange: (
|
|
104
|
-
e ||
|
|
111
|
+
onViewportChange: (o) => {
|
|
112
|
+
e || J.current.onViewportChange?.(o);
|
|
105
113
|
}
|
|
106
|
-
}),
|
|
107
|
-
} catch (
|
|
108
|
-
e || (
|
|
114
|
+
}), B.current = o;
|
|
115
|
+
} catch (o) {
|
|
116
|
+
e || (X.current = !1, q(!1), u(!0), console.error("[SuperDocEditor] Failed to initialize SuperDoc:", o), J.current.onException?.({ error: o }));
|
|
109
117
|
}
|
|
110
118
|
})(), () => {
|
|
111
|
-
|
|
119
|
+
X.current = !1, Y.current = null, o && (o.destroy(), B.current = null), e = !0;
|
|
112
120
|
};
|
|
113
121
|
}, [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
E,
|
|
123
|
+
R,
|
|
124
|
+
z,
|
|
125
|
+
k,
|
|
117
126
|
A,
|
|
118
127
|
N,
|
|
128
|
+
p,
|
|
119
129
|
m,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
V
|
|
130
|
+
W,
|
|
131
|
+
G
|
|
123
132
|
]);
|
|
124
|
-
let
|
|
133
|
+
let Q = ["superdoc-wrapper", h].filter(Boolean).join(" "), $ = K ? { display: "none" } : void 0;
|
|
125
134
|
return /* @__PURE__ */ jsxs("div", {
|
|
126
|
-
className:
|
|
135
|
+
className: Q,
|
|
127
136
|
style: {
|
|
128
|
-
...
|
|
129
|
-
...
|
|
137
|
+
...g,
|
|
138
|
+
...m && {
|
|
130
139
|
display: "flex",
|
|
131
140
|
flexDirection: "column"
|
|
132
141
|
}
|
|
133
142
|
},
|
|
134
143
|
children: [
|
|
135
|
-
|
|
136
|
-
ref:
|
|
137
|
-
id:
|
|
144
|
+
I && /* @__PURE__ */ jsx("div", {
|
|
145
|
+
ref: V,
|
|
146
|
+
id: G,
|
|
138
147
|
className: "superdoc-toolbar-container",
|
|
139
|
-
style:
|
|
148
|
+
style: $
|
|
140
149
|
}),
|
|
141
150
|
/* @__PURE__ */ jsx("div", {
|
|
142
|
-
id:
|
|
151
|
+
id: W,
|
|
143
152
|
className: "superdoc-editor-container",
|
|
144
153
|
style: {
|
|
145
|
-
|
|
146
|
-
...
|
|
154
|
+
...$,
|
|
155
|
+
...m && {
|
|
147
156
|
flex: 1,
|
|
148
157
|
minHeight: 0
|
|
149
158
|
}
|
|
150
159
|
}
|
|
151
160
|
}),
|
|
152
|
-
|
|
161
|
+
K && !l && f && /* @__PURE__ */ jsx("div", {
|
|
153
162
|
className: "superdoc-loading-container",
|
|
154
|
-
children:
|
|
163
|
+
children: f()
|
|
155
164
|
}),
|
|
156
|
-
|
|
165
|
+
l && /* @__PURE__ */ jsx("div", {
|
|
157
166
|
className: "superdoc-error-container",
|
|
158
167
|
children: "Failed to load editor. Check console for details."
|
|
159
168
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/react",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.4",
|
|
4
4
|
"description": "Official React wrapper for the SuperDoc document editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "AGPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"superdoc": "2.
|
|
30
|
+
"superdoc": "2.4.0-next.6"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
|
34
34
|
"react-dom": ">=16.8.0",
|
|
35
|
-
"superdoc": "2.
|
|
35
|
+
"superdoc": "2.4.0-next.6"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@testing-library/react": "^16.3.0",
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
},
|
|
62
62
|
"repository": {
|
|
63
63
|
"type": "git",
|
|
64
|
-
"url": "git+https://github.com/superdoc-
|
|
64
|
+
"url": "git+https://github.com/superdoc/docx-editor.git",
|
|
65
65
|
"directory": "packages/react"
|
|
66
66
|
},
|
|
67
67
|
"bugs": {
|
|
68
|
-
"url": "https://github.com/superdoc-
|
|
68
|
+
"url": "https://github.com/superdoc/docx-editor/issues"
|
|
69
69
|
},
|
|
70
|
-
"homepage": "https://github.com/superdoc-
|
|
70
|
+
"homepage": "https://github.com/superdoc/docx-editor/tree/main/packages/react#readme",
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "vite build",
|
|
73
73
|
"dev": "vite build --watch",
|