@servicetitan/dte-unlayer 0.68.0 → 0.70.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.
- package/dist/api-core.js.map +1 -1
- package/dist/api-custom-tools.js.map +1 -1
- package/dist/editor-core-source.d.ts +3 -3
- package/dist/editor-core-source.d.ts.map +1 -1
- package/dist/editor-core-source.js +3 -3
- package/dist/editor-core-source.js.map +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +4 -5
- package/dist/editor.js.map +1 -1
- package/dist/loadScript.js.map +1 -1
- package/dist/shared/schema.d.ts.map +1 -1
- package/dist/shared/schema.js.map +1 -1
- package/dist/shared/tools.d.ts +1 -1
- package/dist/shared/tools.d.ts.map +1 -1
- package/dist/shared/tools.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/store.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +2 -2
- package/dist/tools.js.map +1 -1
- package/dist/unlayer-interface.d.ts +1 -0
- package/dist/unlayer-interface.d.ts.map +1 -1
- package/dist/unlayer.d.ts +2 -1
- package/dist/unlayer.d.ts.map +1 -1
- package/dist/unlayer.js +10 -2
- package/dist/unlayer.js.map +1 -1
- package/package.json +1 -1
- package/src/editor-core-source.ts +3 -3
- package/src/editor.tsx +4 -5
- package/src/store.ts +1 -1
- package/src/tools.ts +1 -1
- package/src/unlayer-interface.tsx +1 -0
- package/src/unlayer.tsx +12 -1
package/src/editor.tsx
CHANGED
|
@@ -32,21 +32,20 @@ export interface UnlayerEditorProps {
|
|
|
32
32
|
export const useUnlayerRef = () => useRef<UnlayerRef | null>(null);
|
|
33
33
|
|
|
34
34
|
export const UnlayerEditor = forwardRef<UnlayerRef, UnlayerEditorProps>((props, ref) => {
|
|
35
|
-
const [
|
|
35
|
+
const [isReady, setIsReady] = useState(false);
|
|
36
36
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
37
37
|
const store = useMemo(
|
|
38
38
|
() => new UnlayerStore(props.opts),
|
|
39
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
40
|
[]
|
|
41
41
|
);
|
|
42
|
-
const isReady = status === 2;
|
|
43
42
|
|
|
44
43
|
useEffect(() => {
|
|
45
44
|
if (containerRef.current) {
|
|
46
45
|
store
|
|
47
46
|
.init(containerRef.current)
|
|
48
|
-
.then(() =>
|
|
49
|
-
.catch(() =>
|
|
47
|
+
.then(() => setIsReady(true))
|
|
48
|
+
.catch(() => setIsReady(false));
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
return () => store.destroy();
|
|
@@ -99,7 +98,7 @@ export const UnlayerEditor = forwardRef<UnlayerRef, UnlayerEditorProps>((props,
|
|
|
99
98
|
|
|
100
99
|
return (
|
|
101
100
|
<div style={{ minHeight, display: 'flex' }}>
|
|
102
|
-
{
|
|
101
|
+
{!isReady && <p className="c-red-500">error loading editor</p>}
|
|
103
102
|
<div id={props.id ?? 'editor'} style={style} ref={containerRef} />
|
|
104
103
|
</div>
|
|
105
104
|
);
|
package/src/store.ts
CHANGED
package/src/tools.ts
CHANGED
|
@@ -170,7 +170,7 @@ export const unlayerToolsCustomStat = (
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
if (
|
|
173
|
-
(isUnit && !units?.some(unit => unit.id === isUnit.id))
|
|
173
|
+
(isUnit && !units?.some(unit => unit.id === isUnit.id)) ??
|
|
174
174
|
(!isUnit && !tools?.some(t => t.key === tool.slug))
|
|
175
175
|
) {
|
|
176
176
|
notSupported.add(tool.slug);
|
package/src/unlayer.tsx
CHANGED
|
@@ -61,7 +61,7 @@ export interface EventDesignUpdated {
|
|
|
61
61
|
* to know correct schema version, open unlayer editor and check output design ('schema' property)
|
|
62
62
|
*/
|
|
63
63
|
export const versions = {
|
|
64
|
-
unlayer: '1.9.
|
|
64
|
+
unlayer: '1.9.1',
|
|
65
65
|
schema: 16,
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -85,6 +85,15 @@ export const hideUnlayerContentsControls = () => {
|
|
|
85
85
|
}
|
|
86
86
|
`;
|
|
87
87
|
};
|
|
88
|
+
|
|
89
|
+
export const hideUnlayerBodyMenuItem = () => {
|
|
90
|
+
return `
|
|
91
|
+
.nav-item.tab-body {
|
|
92
|
+
display: none !important;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
};
|
|
96
|
+
|
|
88
97
|
export const hideUnlayerTools = () => {
|
|
89
98
|
return `
|
|
90
99
|
.blockbuilder-content-tools {
|
|
@@ -126,6 +135,7 @@ export const createUnlayerEditor = (
|
|
|
126
135
|
customCSS,
|
|
127
136
|
customJS,
|
|
128
137
|
hideAllTools,
|
|
138
|
+
hideBodyMenuItem,
|
|
129
139
|
hideContentControls,
|
|
130
140
|
latest,
|
|
131
141
|
mergeTags,
|
|
@@ -153,6 +163,7 @@ export const createUnlayerEditor = (
|
|
|
153
163
|
*/
|
|
154
164
|
hideAllTools ? hideUnlayerTools() : '',
|
|
155
165
|
hideContentControls ? hideUnlayerContentsControls() : '',
|
|
166
|
+
hideBodyMenuItem ? hideUnlayerBodyMenuItem() : '',
|
|
156
167
|
].filter(css => !!css?.trim());
|
|
157
168
|
|
|
158
169
|
/**
|