@servicetitan/dte-unlayer 0.89.0 → 0.90.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 +29 -22
- package/dist/api-core.js.map +1 -1
- package/dist/api-custom-tools.js +35 -42
- 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 +4 -4
- package/dist/editor-core-source.js.map +1 -1
- package/dist/editor-core.js +2 -2
- package/dist/editor-core.js.map +1 -1
- package/dist/editor.js +73 -34
- package/dist/editor.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/loadScript.d.ts.map +1 -1
- package/dist/loadScript.js +7 -6
- package/dist/loadScript.js.map +1 -1
- package/dist/shared/const.js +2 -1
- package/dist/shared/const.js.map +1 -1
- package/dist/shared/edit-icon.js +1 -0
- package/dist/shared/edit-icon.js.map +1 -1
- package/dist/shared/fonts.js +24 -17
- package/dist/shared/fonts.js.map +1 -1
- package/dist/shared/schema.d.ts.map +1 -1
- package/dist/shared/schema.js +91 -49
- package/dist/shared/schema.js.map +1 -1
- package/dist/shared/tools.d.ts.map +1 -1
- package/dist/shared/tools.js +13 -6
- package/dist/shared/tools.js.map +1 -1
- package/dist/store.d.ts +5 -5
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +235 -315
- package/dist/store.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +120 -112
- package/dist/tools.js.map +1 -1
- package/dist/unlayer-interface.js +2 -1
- package/dist/unlayer-interface.js.map +1 -1
- package/dist/unlayer.d.ts +1 -0
- package/dist/unlayer.d.ts.map +1 -1
- package/dist/unlayer.js +115 -70
- package/dist/unlayer.js.map +1 -1
- package/package.json +1 -1
- package/src/editor-core-source.ts +3 -3
- package/src/unlayer.tsx +11 -1
package/dist/editor-core.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* so when we build tools packages, we generate ./editor-core-source.ts file and include all tools bundles as strings
|
|
5
5
|
* then this code is passed to unlayer initializer
|
|
6
6
|
* (note that custom tools are imported differently as urls)
|
|
7
|
-
*/
|
|
8
|
-
|
|
7
|
+
*/ export { editorCoreScript, editorCoreTools, editorCoreStyles } from './editor-core-source';
|
|
8
|
+
|
|
9
9
|
//# sourceMappingURL=editor-core.js.map
|
package/dist/editor-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/editor-core.ts"],"sourcesContent":["/**\n * we need to pass code to unlayer and we have to pass it as source code (not as url to static file)\n * because it is loaded from unlayer domain, so it has to pass authorization\n * so when we build tools packages, we generate ./editor-core-source.ts file and include all tools bundles as strings\n * then this code is passed to unlayer initializer\n * (note that custom tools are imported differently as urls)\n */\nexport { editorCoreScript, editorCoreTools, editorCoreStyles } from './editor-core-source';\n"],"names":["editorCoreScript","editorCoreTools","editorCoreStyles"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,uBAAuB"}
|
package/dist/editor.js
CHANGED
|
@@ -1,55 +1,94 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { UnlayerStore } from './store';
|
|
4
|
-
export const useUnlayerRef = ()
|
|
5
|
-
export const UnlayerEditor = forwardRef((props, ref)
|
|
6
|
-
var _a;
|
|
4
|
+
export const useUnlayerRef = ()=>useRef(null);
|
|
5
|
+
export const UnlayerEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
7
6
|
const [isReady, setIsReady] = useState(false);
|
|
8
7
|
const containerRef = useRef(null);
|
|
9
|
-
const store = useMemo(()
|
|
10
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8
|
+
const store = useMemo(()=>new UnlayerStore(props.opts), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
9
|
[]);
|
|
12
|
-
useEffect(()
|
|
10
|
+
useEffect(()=>{
|
|
13
11
|
if (containerRef.current) {
|
|
14
|
-
store
|
|
15
|
-
.init(containerRef.current)
|
|
16
|
-
.then(() => setIsReady(true))
|
|
17
|
-
.catch(() => setIsReady(false));
|
|
12
|
+
store.init(containerRef.current).then(()=>setIsReady(true)).catch(()=>setIsReady(false));
|
|
18
13
|
}
|
|
19
|
-
return ()
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
return ()=>store.destroy();
|
|
15
|
+
}, [
|
|
16
|
+
store
|
|
17
|
+
]);
|
|
18
|
+
useImperativeHandle(ref, ()=>store.unlayerRef, [
|
|
19
|
+
store
|
|
20
|
+
]);
|
|
21
|
+
useEffect(()=>{
|
|
23
22
|
if (isReady) {
|
|
24
23
|
store.setDesign(props.design);
|
|
25
24
|
}
|
|
26
|
-
}, [
|
|
27
|
-
|
|
25
|
+
}, [
|
|
26
|
+
isReady,
|
|
27
|
+
props.design,
|
|
28
|
+
store
|
|
29
|
+
]);
|
|
30
|
+
useEffect(()=>{
|
|
28
31
|
store.setOnChange(props.onChange);
|
|
29
|
-
return ()
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
+
return ()=>store.setOnChange();
|
|
33
|
+
}, [
|
|
34
|
+
props.onChange,
|
|
35
|
+
store
|
|
36
|
+
]);
|
|
37
|
+
useEffect(()=>{
|
|
32
38
|
store.setOnSnapshotSave(props.onSnapshotSave);
|
|
33
|
-
return ()
|
|
34
|
-
}, [
|
|
35
|
-
|
|
39
|
+
return ()=>store.setOnSnapshotSave();
|
|
40
|
+
}, [
|
|
41
|
+
props.onSnapshotSave,
|
|
42
|
+
store
|
|
43
|
+
]);
|
|
44
|
+
useEffect(()=>{
|
|
36
45
|
if (props.opts.newSnapshot) {
|
|
37
46
|
store.addTwin(props.opts.newSnapshot);
|
|
38
47
|
}
|
|
39
|
-
}, [
|
|
40
|
-
|
|
48
|
+
}, [
|
|
49
|
+
props.opts.newSnapshot,
|
|
50
|
+
store
|
|
51
|
+
]);
|
|
52
|
+
useEffect(()=>{
|
|
41
53
|
store.setOnReady(props.onReady);
|
|
42
|
-
return ()
|
|
43
|
-
}, [
|
|
44
|
-
|
|
54
|
+
return ()=>store.setOnReady();
|
|
55
|
+
}, [
|
|
56
|
+
props.onReady,
|
|
57
|
+
store
|
|
58
|
+
]);
|
|
59
|
+
useEffect(()=>{
|
|
45
60
|
store.setOnImage(props.onImage);
|
|
46
|
-
return ()
|
|
47
|
-
}, [
|
|
48
|
-
|
|
61
|
+
return ()=>store.setOnImage();
|
|
62
|
+
}, [
|
|
63
|
+
props.onImage,
|
|
64
|
+
store
|
|
65
|
+
]);
|
|
66
|
+
useEffect(()=>{
|
|
49
67
|
store.setOnMessage(props.onMessage);
|
|
50
|
-
return ()
|
|
51
|
-
}, [
|
|
68
|
+
return ()=>store.setOnMessage();
|
|
69
|
+
}, [
|
|
70
|
+
props.onMessage,
|
|
71
|
+
store
|
|
72
|
+
]);
|
|
52
73
|
const { minHeight = 800, style = {} } = props;
|
|
53
|
-
|
|
74
|
+
var _props_id;
|
|
75
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
76
|
+
style: {
|
|
77
|
+
minHeight,
|
|
78
|
+
display: 'flex'
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
!isReady && /*#__PURE__*/ _jsx("p", {
|
|
82
|
+
className: "c-red-500",
|
|
83
|
+
children: "error loading editor"
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx("div", {
|
|
86
|
+
id: (_props_id = props.id) !== null && _props_id !== void 0 ? _props_id : 'editor',
|
|
87
|
+
style: style,
|
|
88
|
+
ref: containerRef
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
54
92
|
});
|
|
93
|
+
|
|
55
94
|
//# sourceMappingURL=editor.js.map
|
package/dist/editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/editor.tsx"],"sourcesContent":["import {\n CSSProperties,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { UnlayerEditorTwin } from './shared/const';\nimport { UnlayerStore, UnlayerDesignChangeInfo } from './store';\nimport { UnlayerRef, CreateUnlayerEditorProps } from './unlayer-interface';\n\nexport interface UnlayerEditorProps {\n id?: string;\n design?: any;\n opts: CreateUnlayerEditorProps;\n minHeight?: number;\n style?: CSSProperties;\n\n onReady?(): void;\n\n onChange?(info: UnlayerDesignChangeInfo): void;\n\n onSnapshotSave?(tool: UnlayerEditorTwin): void;\n\n onImage?(file: File): Promise<{ url: string }>;\n\n onMessage?(type: string, data: any): void;\n}\n\nexport const useUnlayerRef = () => useRef<UnlayerRef | null>(null);\n\nexport const UnlayerEditor = forwardRef<UnlayerRef, UnlayerEditorProps>((props, ref) => {\n const [isReady, setIsReady] = useState(false);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const store = useMemo(\n () => new UnlayerStore(props.opts),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n useEffect(() => {\n if (containerRef.current) {\n store\n .init(containerRef.current)\n .then(() => setIsReady(true))\n .catch(() => setIsReady(false));\n }\n\n return () => store.destroy();\n }, [store]);\n useImperativeHandle(ref, () => store.unlayerRef, [store]);\n\n useEffect(() => {\n if (isReady) {\n store.setDesign(props.design);\n }\n }, [isReady, props.design, store]);\n\n useEffect(() => {\n store.setOnChange(props.onChange);\n\n return () => store.setOnChange();\n }, [props.onChange, store]);\n\n useEffect(() => {\n store.setOnSnapshotSave(props.onSnapshotSave);\n\n return () => store.setOnSnapshotSave();\n }, [props.onSnapshotSave, store]);\n\n useEffect(() => {\n if (props.opts.newSnapshot) {\n store.addTwin(props.opts.newSnapshot);\n }\n }, [props.opts.newSnapshot, store]);\n\n useEffect(() => {\n store.setOnReady(props.onReady);\n\n return () => store.setOnReady();\n }, [props.onReady, store]);\n\n useEffect(() => {\n store.setOnImage(props.onImage);\n\n return () => store.setOnImage();\n }, [props.onImage, store]);\n\n useEffect(() => {\n store.setOnMessage(props.onMessage);\n\n return () => store.setOnMessage();\n }, [props.onMessage, store]);\n\n const { minHeight = 800, style = {} } = props;\n\n return (\n <div style={{ minHeight, display: 'flex' }}>\n {!isReady && <p className=\"c-red-500\">error loading editor</p>}\n <div id={props.id ?? 'editor'} style={style} ref={containerRef} />\n </div>\n );\n});\n"],"names":["forwardRef","useEffect","useImperativeHandle","useMemo","useRef","useState","UnlayerStore","useUnlayerRef","UnlayerEditor","props","ref","isReady","setIsReady","containerRef","store","opts","current","init","then","catch","destroy","unlayerRef","setDesign","design","setOnChange","onChange","setOnSnapshotSave","onSnapshotSave","newSnapshot","addTwin","setOnReady","onReady","setOnImage","onImage","setOnMessage","onMessage","minHeight","style","div","display","p","className","id"],"mappings":";AAAA,SAEIA,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,QAAQ;AAEf,SAASC,YAAY,QAAiC,UAAU;AAqBhE,OAAO,MAAMC,gBAAgB,IAAMH,OAA0B,MAAM;AAEnE,OAAO,MAAMI,8BAAgBR,WAA2C,CAACS,OAAOC;IAC5E,MAAM,CAACC,SAASC,WAAW,GAAGP,SAAS;IACvC,MAAMQ,eAAeT,OAA8B;IACnD,MAAMU,QAAQX,QACV,IAAM,IAAIG,aAAaG,MAAMM,IAAI,GACjC,uDAAuD;IACvD,EAAE;IAGNd,UAAU;QACN,IAAIY,aAAaG,OAAO,EAAE;YACtBF,MACKG,IAAI,CAACJ,aAAaG,OAAO,EACzBE,IAAI,CAAC,IAAMN,WAAW,OACtBO,KAAK,CAAC,IAAMP,WAAW;QAChC;QAEA,OAAO,IAAME,MAAMM,OAAO;IAC9B,GAAG;QAACN;KAAM;IACVZ,oBAAoBQ,KAAK,IAAMI,MAAMO,UAAU,EAAE;QAACP;KAAM;IAExDb,UAAU;QACN,IAAIU,SAAS;YACTG,MAAMQ,SAAS,CAACb,MAAMc,MAAM;QAChC;IACJ,GAAG;QAACZ;QAASF,MAAMc,MAAM;QAAET;KAAM;IAEjCb,UAAU;QACNa,MAAMU,WAAW,CAACf,MAAMgB,QAAQ;QAEhC,OAAO,IAAMX,MAAMU,WAAW;IAClC,GAAG;QAACf,MAAMgB,QAAQ;QAAEX;KAAM;IAE1Bb,UAAU;QACNa,MAAMY,iBAAiB,CAACjB,MAAMkB,cAAc;QAE5C,OAAO,IAAMb,MAAMY,iBAAiB;IACxC,GAAG;QAACjB,MAAMkB,cAAc;QAAEb;KAAM;IAEhCb,UAAU;QACN,IAAIQ,MAAMM,IAAI,CAACa,WAAW,EAAE;YACxBd,MAAMe,OAAO,CAACpB,MAAMM,IAAI,CAACa,WAAW;QACxC;IACJ,GAAG;QAACnB,MAAMM,IAAI,CAACa,WAAW;QAAEd;KAAM;IAElCb,UAAU;QACNa,MAAMgB,UAAU,CAACrB,MAAMsB,OAAO;QAE9B,OAAO,IAAMjB,MAAMgB,UAAU;IACjC,GAAG;QAACrB,MAAMsB,OAAO;QAAEjB;KAAM;IAEzBb,UAAU;QACNa,MAAMkB,UAAU,CAACvB,MAAMwB,OAAO;QAE9B,OAAO,IAAMnB,MAAMkB,UAAU;IACjC,GAAG;QAACvB,MAAMwB,OAAO;QAAEnB;KAAM;IAEzBb,UAAU;QACNa,MAAMoB,YAAY,CAACzB,MAAM0B,SAAS;QAElC,OAAO,IAAMrB,MAAMoB,YAAY;IACnC,GAAG;QAACzB,MAAM0B,SAAS;QAAErB;KAAM;IAE3B,MAAM,EAAEsB,YAAY,GAAG,EAAEC,QAAQ,CAAC,CAAC,EAAE,GAAG5B;QAKvBA;IAHjB,qBACI,MAAC6B;QAAID,OAAO;YAAED;YAAWG,SAAS;QAAO;;YACpC,CAAC5B,yBAAW,KAAC6B;gBAAEC,WAAU;0BAAY;;0BACtC,KAACH;gBAAII,IAAIjC,CAAAA,YAAAA,MAAMiC,EAAE,cAARjC,uBAAAA,YAAY;gBAAU4B,OAAOA;gBAAO3B,KAAKG;;;;AAG9D,GAAG"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './editor';\nexport * from './tools';\nexport * from './api-core';\nexport * from './api-custom-tools';\nexport * from './unlayer-interface';\nexport * from './loadScript';\nexport * from './shared/const';\nexport * from './shared/schema';\nexport * from './shared/tools';\nexport { UnlayerDesignChangeInfo } from './store';\nexport { versions } from './unlayer';\n"],"names":["UnlayerDesignChangeInfo","versions"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,aAAa;AAC3B,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,SAASA,uBAAuB,QAAQ,UAAU;AAClD,SAASC,QAAQ,QAAQ,YAAY"}
|
package/dist/loadScript.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadScript.d.ts","sourceRoot":"","sources":["../src/loadScript.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"loadScript.d.ts","sourceRoot":"","sources":["../src/loadScript.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAa1D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,SAI9C,CAAC"}
|
package/dist/loadScript.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
const isScriptInjected = (scriptUrl)
|
|
1
|
+
const isScriptInjected = (scriptUrl)=>{
|
|
2
2
|
const scripts = document.querySelectorAll('script');
|
|
3
3
|
let injected = false;
|
|
4
|
-
scripts.forEach(script
|
|
4
|
+
scripts.forEach((script)=>{
|
|
5
5
|
if (script.src.includes(scriptUrl)) {
|
|
6
6
|
injected = true;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
return injected;
|
|
10
10
|
};
|
|
11
|
-
export const loadScript = (scriptUrl)
|
|
12
|
-
return new Promise(resolve
|
|
11
|
+
export const loadScript = (scriptUrl)=>{
|
|
12
|
+
return new Promise((resolve)=>{
|
|
13
13
|
if (isScriptInjected(scriptUrl)) {
|
|
14
14
|
resolve();
|
|
15
15
|
}
|
|
16
16
|
const embedScript = document.createElement('script');
|
|
17
17
|
embedScript.setAttribute('src', scriptUrl);
|
|
18
|
-
embedScript.onload = ()
|
|
18
|
+
embedScript.onload = ()=>{
|
|
19
19
|
resolve();
|
|
20
20
|
};
|
|
21
21
|
document.head.appendChild(embedScript);
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
export const loadScriptSource = (source)
|
|
24
|
+
export const loadScriptSource = (source)=>{
|
|
25
25
|
const embedScript = document.createElement('script');
|
|
26
26
|
embedScript.textContent = source;
|
|
27
27
|
document.head.appendChild(embedScript);
|
|
28
28
|
};
|
|
29
|
+
|
|
29
30
|
//# sourceMappingURL=loadScript.js.map
|
package/dist/loadScript.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/loadScript.ts"],"sourcesContent":["const isScriptInjected = (scriptUrl: string) => {\n const scripts = document.querySelectorAll('script');\n let injected = false;\n\n scripts.forEach(script => {\n if (script.src.includes(scriptUrl)) {\n injected = true;\n }\n });\n\n return injected;\n};\n\nexport const loadScript = (scriptUrl: string): Promise<void> => {\n return new Promise<void>(resolve => {\n if (isScriptInjected(scriptUrl)) {\n resolve();\n }\n\n const embedScript = document.createElement('script');\n embedScript.setAttribute('src', scriptUrl);\n embedScript.onload = () => {\n resolve();\n };\n document.head.appendChild(embedScript);\n });\n};\n\nexport const loadScriptSource = (source: string) => {\n const embedScript = document.createElement('script');\n embedScript.textContent = source;\n document.head.appendChild(embedScript);\n};\n"],"names":["isScriptInjected","scriptUrl","scripts","document","querySelectorAll","injected","forEach","script","src","includes","loadScript","Promise","resolve","embedScript","createElement","setAttribute","onload","head","appendChild","loadScriptSource","source","textContent"],"mappings":"AAAA,MAAMA,mBAAmB,CAACC;IACtB,MAAMC,UAAUC,SAASC,gBAAgB,CAAC;IAC1C,IAAIC,WAAW;IAEfH,QAAQI,OAAO,CAACC,CAAAA;QACZ,IAAIA,OAAOC,GAAG,CAACC,QAAQ,CAACR,YAAY;YAChCI,WAAW;QACf;IACJ;IAEA,OAAOA;AACX;AAEA,OAAO,MAAMK,aAAa,CAACT;IACvB,OAAO,IAAIU,QAAcC,CAAAA;QACrB,IAAIZ,iBAAiBC,YAAY;YAC7BW;QACJ;QAEA,MAAMC,cAAcV,SAASW,aAAa,CAAC;QAC3CD,YAAYE,YAAY,CAAC,OAAOd;QAChCY,YAAYG,MAAM,GAAG;YACjBJ;QACJ;QACAT,SAASc,IAAI,CAACC,WAAW,CAACL;IAC9B;AACJ,EAAE;AAEF,OAAO,MAAMM,mBAAmB,CAACC;IAC7B,MAAMP,cAAcV,SAASW,aAAa,CAAC;IAC3CD,YAAYQ,WAAW,GAAGD;IAC1BjB,SAASc,IAAI,CAACC,WAAW,CAACL;AAC9B,EAAE"}
|
package/dist/shared/const.js
CHANGED
package/dist/shared/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/shared/const.ts"],"sourcesContent":["import { SchemaObject } from './schema';\n\nexport const constGenericsEditor = {\n infoDataProperty: '_info',\n adminConfigProperty: 'adminConfig',\n userConfigProperty: 'config',\n};\n\nexport interface UnlayerEditorESignRecipientInfo {\n id: number;\n name: string;\n displayName: string;\n}\n\nexport interface UnlayerEditorUnit {\n id: string;\n generic: string;\n title: string;\n values: any;\n}\n\nexport interface UnlayerEditorTwin {\n tool: string;\n title: string;\n values: any;\n}\n\nexport interface UnlayerEventConfig {\n dummyData?: any;\n schema?: SchemaObject;\n generics?: true | string[];\n genericConfigMode?: boolean;\n isSnapshotMode?: boolean;\n units?: UnlayerEditorUnit[];\n}\n\nexport interface UnlayerEventRegister {\n units?: UnlayerEditorUnit[];\n eSignRecipients?: UnlayerEditorESignRecipientInfo[];\n eSignFieldTypes?: string[];\n customTools?: {\n key: string;\n title?: string;\n }[];\n toolTwins?: UnlayerEditorTwin[];\n}\n\nexport interface UnlayerToolMetaData {\n key: string;\n description?: string;\n}\n"],"names":["constGenericsEditor","infoDataProperty","adminConfigProperty","userConfigProperty"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB;IAC/BC,kBAAkB;IAClBC,qBAAqB;IACrBC,oBAAoB;AACxB,EAAE"}
|
package/dist/shared/edit-icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/shared/edit-icon.ts"],"sourcesContent":["export const editIconSvg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\">\n <g clip-path=\"url(#clip0_2941_4625)\">\n <path d=\"M4 23V28H9L23.7533 13.2467L18.7533 8.24667L4 23ZM27.6067 9.39333C28.1267 8.87333 28.1267 8.02667 27.6067 7.50667L24.4933 4.39333C23.9733 3.87333 23.1267 3.87333 22.6067 4.39333L20.1667 6.83333L25.1667 11.8333L27.6067 9.39333Z\" fill=\"#606162\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_2941_4625\">\n <rect width=\"32\" height=\"32\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n`;\n"],"names":["editIconSvg"],"mappings":"AAAA,OAAO,MAAMA,cAAc,CAAC;;;;;;;;;;;AAW5B,CAAC,CAAC"}
|
package/dist/shared/fonts.js
CHANGED
|
@@ -1,75 +1,82 @@
|
|
|
1
1
|
export const unlayerSupportedFonts = [
|
|
2
2
|
{
|
|
3
3
|
label: 'Arial',
|
|
4
|
-
value: 'arial,helvetica,sans-serif'
|
|
4
|
+
value: 'arial,helvetica,sans-serif'
|
|
5
5
|
},
|
|
6
6
|
{
|
|
7
7
|
label: 'Lobster Two',
|
|
8
8
|
value: "'Lobster Two',cursive",
|
|
9
|
-
url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700'
|
|
9
|
+
url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700'
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
label: 'Playfair Display',
|
|
13
13
|
value: "'Playfair Display',serif",
|
|
14
|
-
url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700'
|
|
14
|
+
url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700'
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
label: 'Rubik',
|
|
18
18
|
value: "'Rubik',sans-serif",
|
|
19
|
-
url: 'https://fonts.googleapis.com/css?family=Rubik:400,700'
|
|
19
|
+
url: 'https://fonts.googleapis.com/css?family=Rubik:400,700'
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
label: 'Source Sans Pro',
|
|
23
23
|
value: "'Source Sans Pro',sans-serif",
|
|
24
|
-
url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'
|
|
24
|
+
url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
label: 'Open Sans',
|
|
28
28
|
value: "'Open Sans',sans-serif",
|
|
29
|
-
url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700'
|
|
29
|
+
url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700'
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
label: 'Crimson Text',
|
|
33
33
|
value: "'Crimson Text',serif",
|
|
34
|
-
url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700'
|
|
34
|
+
url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700'
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
label: 'Montserrat',
|
|
38
38
|
value: "'Montserrat',sans-serif",
|
|
39
|
-
url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700'
|
|
39
|
+
url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700'
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
label: 'Old Standard TT',
|
|
43
43
|
value: "'Old Standard TT',serif",
|
|
44
|
-
url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700'
|
|
44
|
+
url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700'
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
label: 'Lato',
|
|
48
48
|
value: "'Lato',sans-serif",
|
|
49
|
-
url: 'https://fonts.googleapis.com/css?family=Lato:400,700'
|
|
49
|
+
url: 'https://fonts.googleapis.com/css?family=Lato:400,700'
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
label: 'Raleway',
|
|
53
53
|
value: "'Raleway',sans-serif",
|
|
54
|
-
url: 'https://fonts.googleapis.com/css?family=Raleway:400,700'
|
|
54
|
+
url: 'https://fonts.googleapis.com/css?family=Raleway:400,700'
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
label: 'Cabin',
|
|
58
58
|
value: "'Cabin',sans-serif",
|
|
59
|
-
url: 'https://fonts.googleapis.com/css?family=Cabin:400,700'
|
|
59
|
+
url: 'https://fonts.googleapis.com/css?family=Cabin:400,700'
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
label: 'Pacifico',
|
|
63
63
|
value: "'Pacifico',cursive",
|
|
64
|
-
url: 'https://fonts.googleapis.com/css?family=Pacifico'
|
|
64
|
+
url: 'https://fonts.googleapis.com/css?family=Pacifico'
|
|
65
65
|
},
|
|
66
66
|
// custom DTE fonts
|
|
67
|
-
{
|
|
68
|
-
|
|
67
|
+
{
|
|
68
|
+
label: 'Sofia Pro',
|
|
69
|
+
value: 'Sofia Pro'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Montserrat',
|
|
73
|
+
value: 'Montserrat'
|
|
74
|
+
},
|
|
69
75
|
{
|
|
70
76
|
label: 'Nunito',
|
|
71
77
|
value: 'Nunito',
|
|
72
|
-
url: 'https://fonts.googleapis.com/css?family=Nunito'
|
|
73
|
-
}
|
|
78
|
+
url: 'https://fonts.googleapis.com/css?family=Nunito'
|
|
79
|
+
}
|
|
74
80
|
];
|
|
81
|
+
|
|
75
82
|
//# sourceMappingURL=fonts.js.map
|
package/dist/shared/fonts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/shared/fonts.ts"],"sourcesContent":["export const unlayerSupportedFonts = [\n {\n label: 'Arial',\n value: 'arial,helvetica,sans-serif',\n },\n {\n label: 'Lobster Two',\n value: \"'Lobster Two',cursive\",\n url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700',\n },\n {\n label: 'Playfair Display',\n value: \"'Playfair Display',serif\",\n url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700',\n },\n {\n label: 'Rubik',\n value: \"'Rubik',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Rubik:400,700',\n },\n {\n label: 'Source Sans Pro',\n value: \"'Source Sans Pro',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700',\n },\n {\n label: 'Open Sans',\n value: \"'Open Sans',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700',\n },\n {\n label: 'Crimson Text',\n value: \"'Crimson Text',serif\",\n url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700',\n },\n {\n label: 'Montserrat',\n value: \"'Montserrat',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700',\n },\n {\n label: 'Old Standard TT',\n value: \"'Old Standard TT',serif\",\n url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700',\n },\n {\n label: 'Lato',\n value: \"'Lato',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Lato:400,700',\n },\n {\n label: 'Raleway',\n value: \"'Raleway',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Raleway:400,700',\n },\n {\n label: 'Cabin',\n value: \"'Cabin',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Cabin:400,700',\n },\n {\n label: 'Pacifico',\n value: \"'Pacifico',cursive\",\n url: 'https://fonts.googleapis.com/css?family=Pacifico',\n },\n // custom DTE fonts\n { label: 'Sofia Pro', value: 'Sofia Pro' },\n { label: 'Montserrat', value: 'Montserrat' },\n\n {\n label: 'Nunito',\n value: 'Nunito',\n url: 'https://fonts.googleapis.com/css?family=Nunito',\n },\n];\n"],"names":["unlayerSupportedFonts","label","value","url"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB;IACjC;QACIC,OAAO;QACPC,OAAO;IACX;IACA;QACID,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA,mBAAmB;IACnB;QAAEF,OAAO;QAAaC,OAAO;IAAY;IACzC;QAAED,OAAO;QAAcC,OAAO;IAAa;IAE3C;QACID,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/shared/schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AACrE,eAAO,MAAM,wBAAwB,UAAgC,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5E,eAAO,MAAM,wBAAwB,UAAsC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/shared/schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AACrE,eAAO,MAAM,wBAAwB,UAAgC,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5E,eAAO,MAAM,wBAAwB,UAAsC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,wBAClB,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACnC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,UAAU,eAAe;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED,MAAM,WAAW,YAAa,SAAQ,eAAe;IACjD,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,WAAY,SAAQ,eAAe;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACvD,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACtC;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAEnE,eAAO,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,YAAuC,CAAC;AACnG,eAAO,MAAM,sBAAsB,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,WACR,CAAC;AAC5D,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,WAAqC,CAAC;AAChG,eAAO,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,kBAChC,CAAC;AAC5B,eAAO,MAAM,kBAAkB,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,kBACR,CAAC;AAExD,eAAO,MAAM,mBAAmB,GAAI,OAAO,UAAU,KAAG,IAAI,IAAI,kBACR,CAAC;AAEzD,eAAO,MAAM,cAAc,GAAI,QAAQ,UAAU,EAAE,KAAK,MAAM,KAAG,UAAU,GAAG,SAgC7E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,UAAU,EAAE,KAAK,MAAM,KAAG,UAAU,GAAG,SAUnF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAAwC,CAAC;AAE7F,eAAO,MAAM,eAAe,GACxB,MAAM,wBAAwB,EAC9B,gBAAgB,wBAAwB,KACzC,UASF,CAAC;AAEF,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,QAAQ,YAAY,KAAG;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CA8ErF,CAAC"}
|
package/dist/shared/schema.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
export const schemaNodeAvailableTypes = [
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const schemaNodeAvailableTypes = [
|
|
2
|
+
'object',
|
|
3
|
+
'array',
|
|
4
|
+
'string'
|
|
5
|
+
];
|
|
6
|
+
export const schemaNodeStringSubTypes = [
|
|
7
|
+
'string',
|
|
8
|
+
'text',
|
|
9
|
+
'html',
|
|
10
|
+
'image'
|
|
11
|
+
];
|
|
12
|
+
export const schemaIsAvailableType = (type)=>schemaNodeAvailableTypes.includes(type);
|
|
4
13
|
export const schemaArrayRootKey = '[]';
|
|
5
|
-
export const schemaIsObject = (node)
|
|
6
|
-
export const schemaIsArrayOfObjects = (node)
|
|
7
|
-
export const schemaIsArray = (node)
|
|
8
|
-
export const schemaIsString = (node)
|
|
9
|
-
export const schemaIsStringHtml = (node)
|
|
10
|
-
export const schemaIsStringImage = (node)
|
|
11
|
-
export const schemaFindNode = (schema, key)
|
|
12
|
-
const nodeFinder = (node, keys)
|
|
14
|
+
export const schemaIsObject = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'object';
|
|
15
|
+
export const schemaIsArrayOfObjects = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'array' && (node === null || node === void 0 ? void 0 : node.items.type) === 'object';
|
|
16
|
+
export const schemaIsArray = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'array';
|
|
17
|
+
export const schemaIsString = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string';
|
|
18
|
+
export const schemaIsStringHtml = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'html';
|
|
19
|
+
export const schemaIsStringImage = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'image';
|
|
20
|
+
export const schemaFindNode = (schema, key)=>{
|
|
21
|
+
const nodeFinder = (node, keys)=>{
|
|
13
22
|
if (!node) {
|
|
14
23
|
return undefined;
|
|
15
24
|
}
|
|
@@ -33,80 +42,113 @@ export const schemaFindNode = (schema, key) => {
|
|
|
33
42
|
};
|
|
34
43
|
return nodeFinder(schema, key.split('.'));
|
|
35
44
|
};
|
|
36
|
-
export const schemaFindParentNode = (schema, key)
|
|
45
|
+
export const schemaFindParentNode = (schema, key)=>{
|
|
37
46
|
const keys = key.split('.');
|
|
38
47
|
keys.pop();
|
|
39
|
-
return keys.length
|
|
40
|
-
? schemaFindNode(schema, keys.join('.'))
|
|
41
|
-
: schemaIsObject(schema) && schema.properties[key]
|
|
42
|
-
? schema
|
|
43
|
-
: undefined;
|
|
48
|
+
return keys.length ? schemaFindNode(schema, keys.join('.')) : schemaIsObject(schema) && schema.properties[key] ? schema : undefined;
|
|
44
49
|
};
|
|
45
|
-
export const schemaGetFieldKey = (fullKey)
|
|
46
|
-
|
|
50
|
+
export const schemaGetFieldKey = (fullKey)=>{
|
|
51
|
+
var _fullKey_split_pop;
|
|
52
|
+
return (_fullKey_split_pop = fullKey.split('.').pop()) !== null && _fullKey_split_pop !== void 0 ? _fullKey_split_pop : '';
|
|
53
|
+
};
|
|
54
|
+
export const schemaBuildNode = (type, arrayItemType)=>{
|
|
47
55
|
if (type === 'object') {
|
|
48
|
-
return {
|
|
56
|
+
return {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {},
|
|
59
|
+
options: {}
|
|
60
|
+
};
|
|
49
61
|
}
|
|
50
62
|
if (type === 'array') {
|
|
51
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
type: 'array',
|
|
65
|
+
items: schemaBuildNode(arrayItemType !== null && arrayItemType !== void 0 ? arrayItemType : 'object'),
|
|
66
|
+
options: {}
|
|
67
|
+
};
|
|
52
68
|
}
|
|
53
|
-
return {
|
|
69
|
+
return {
|
|
70
|
+
type,
|
|
71
|
+
options: {}
|
|
72
|
+
};
|
|
54
73
|
};
|
|
55
|
-
export const schemaBuildMap = (schema)
|
|
74
|
+
export const schemaBuildMap = (schema)=>{
|
|
56
75
|
const fieldsMap = {};
|
|
57
76
|
const dummyData = {};
|
|
58
|
-
const processNode = (node, nodeKey, parentNodes, isArrayed, dummyDataNode)
|
|
59
|
-
var
|
|
60
|
-
const nodeLabel = (
|
|
77
|
+
const processNode = (node, nodeKey, parentNodes, isArrayed, dummyDataNode)=>{
|
|
78
|
+
var _node_title;
|
|
79
|
+
const nodeLabel = (_node_title = node.title) !== null && _node_title !== void 0 ? _node_title : nodeKey;
|
|
61
80
|
const isArrayRoot = nodeKey === schemaArrayRootKey;
|
|
62
81
|
if (nodeKey) {
|
|
63
|
-
const fullKey = [
|
|
64
|
-
|
|
82
|
+
const fullKey = [
|
|
83
|
+
...parentNodes.map((n)=>n.key),
|
|
84
|
+
nodeKey
|
|
85
|
+
].join('.');
|
|
86
|
+
const fullTitle = [
|
|
87
|
+
...parentNodes.map((n)=>n.title),
|
|
88
|
+
nodeLabel
|
|
89
|
+
].join(' - ');
|
|
90
|
+
var _node_title1;
|
|
65
91
|
fieldsMap[fullKey] = {
|
|
66
92
|
fieldKey: nodeKey,
|
|
67
93
|
fullKey,
|
|
68
94
|
fullTitle,
|
|
69
|
-
title: ((
|
|
95
|
+
title: ((_node_title1 = node.title) !== null && _node_title1 !== void 0 ? _node_title1 : isArrayed) ? nodeLabel : fullTitle,
|
|
70
96
|
node,
|
|
71
97
|
isArrayed,
|
|
72
|
-
isValue: !schemaIsObject(node) && !schemaIsArray(node)
|
|
98
|
+
isValue: !schemaIsObject(node) && !schemaIsArray(node)
|
|
73
99
|
};
|
|
74
100
|
}
|
|
75
101
|
if (schemaIsObject(node)) {
|
|
76
|
-
|
|
102
|
+
var _node_properties;
|
|
103
|
+
const properties = (_node_properties = node.properties) !== null && _node_properties !== void 0 ? _node_properties : {};
|
|
77
104
|
const keys = Object.keys(properties !== null && properties !== void 0 ? properties : {}).sort();
|
|
78
105
|
let dummyDataObject = {};
|
|
79
106
|
if (isArrayRoot) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
else if (nodeKey) {
|
|
107
|
+
var _dummyDataNode_push;
|
|
108
|
+
(_dummyDataNode_push = dummyDataNode.push) === null || _dummyDataNode_push === void 0 ? void 0 : _dummyDataNode_push.call(dummyDataNode, dummyDataObject);
|
|
109
|
+
} else if (nodeKey) {
|
|
83
110
|
dummyDataNode[nodeKey] = dummyDataObject;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
111
|
+
} else {
|
|
86
112
|
dummyDataObject = dummyDataNode;
|
|
87
113
|
}
|
|
88
|
-
for (const key of keys)
|
|
89
|
-
processNode(properties[key], key, nodeKey ? [
|
|
114
|
+
for (const key of keys){
|
|
115
|
+
processNode(properties[key], key, nodeKey ? [
|
|
116
|
+
...parentNodes,
|
|
117
|
+
{
|
|
118
|
+
key: nodeKey,
|
|
119
|
+
title: nodeLabel
|
|
120
|
+
}
|
|
121
|
+
] : [], isArrayed, dummyDataObject);
|
|
90
122
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const items = (
|
|
123
|
+
} else if (schemaIsArray(node)) {
|
|
124
|
+
var _node_items;
|
|
125
|
+
const items = (_node_items = node.items) !== null && _node_items !== void 0 ? _node_items : {};
|
|
94
126
|
dummyDataNode[nodeKey] = [];
|
|
95
|
-
processNode(items, schemaArrayRootKey, nodeKey ? [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
127
|
+
processNode(items, schemaArrayRootKey, nodeKey ? [
|
|
128
|
+
...parentNodes,
|
|
129
|
+
{
|
|
130
|
+
key: nodeKey,
|
|
131
|
+
title: nodeLabel
|
|
132
|
+
}
|
|
133
|
+
] : [], true, dummyDataNode[nodeKey]);
|
|
134
|
+
} else if (nodeKey) {
|
|
135
|
+
var _node_options;
|
|
136
|
+
const placeholder = node === null || node === void 0 ? void 0 : (_node_options = node.options) === null || _node_options === void 0 ? void 0 : _node_options.placeholder;
|
|
99
137
|
if (placeholder !== undefined) {
|
|
100
138
|
if (isArrayRoot) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
else {
|
|
139
|
+
var _dummyDataNode_push1;
|
|
140
|
+
(_dummyDataNode_push1 = dummyDataNode.push) === null || _dummyDataNode_push1 === void 0 ? void 0 : _dummyDataNode_push1.call(dummyDataNode, placeholder);
|
|
141
|
+
} else {
|
|
104
142
|
dummyDataNode[nodeKey] = placeholder;
|
|
105
143
|
}
|
|
106
144
|
}
|
|
107
145
|
}
|
|
108
146
|
};
|
|
109
147
|
processNode(schema, '', [], false, dummyData);
|
|
110
|
-
return {
|
|
148
|
+
return {
|
|
149
|
+
map: fieldsMap,
|
|
150
|
+
dummyData
|
|
151
|
+
};
|
|
111
152
|
};
|
|
153
|
+
|
|
112
154
|
//# sourceMappingURL=schema.js.map
|