@symbo.ls/create 2.11.276 → 2.11.291
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/cjs/bundle/index.js +9393 -6221
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/prepare.js +10 -1
- package/package.json +2 -2
- package/src/index.js +4 -4
- package/src/prepare.js +11 -1
package/dist/cjs/index.js
CHANGED
|
@@ -43,10 +43,10 @@ var import_options = __toESM(require("./options"), 1);
|
|
|
43
43
|
var import_dynamic = __toESM(require("@symbo.ls/init/dynamic.json"), 1);
|
|
44
44
|
var import_createDomql = require("./createDomql");
|
|
45
45
|
const SYMBOLS_KEY = process.env.SYMBOLS_KEY;
|
|
46
|
-
const mergeWithLocalFile = (options, optionsExternalFile) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const mergeWithLocalFile = (options, optionsExternalFile) => (0, import_utils.deepMerge)(
|
|
47
|
+
options,
|
|
48
|
+
(0, import_utils.isObject)(optionsExternalFile) ? optionsExternalFile : import_dynamic.default || {}
|
|
49
|
+
);
|
|
50
50
|
const create = (App, options = import_options.default, optionsExternalFile) => {
|
|
51
51
|
const redefinedOptions = { ...import_options.default, ...mergeWithLocalFile(options, optionsExternalFile) };
|
|
52
52
|
const domqlApp = (0, import_createDomql.createDomqlElement)(App, redefinedOptions);
|
package/dist/cjs/prepare.js
CHANGED
|
@@ -80,7 +80,16 @@ const prepareState = (options, App) => {
|
|
|
80
80
|
return (0, import_utils.deepCloneWithExtnd)(state);
|
|
81
81
|
};
|
|
82
82
|
const preparePages = (options) => {
|
|
83
|
-
|
|
83
|
+
const pages = options.pages || {};
|
|
84
|
+
Object.keys(pages).filter((v) => !v.startsWith("/")).forEach((v) => {
|
|
85
|
+
if (v === "main")
|
|
86
|
+
pages["/"] = pages.main;
|
|
87
|
+
else {
|
|
88
|
+
pages["/" + v] = pages[v];
|
|
89
|
+
delete pages[v];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return pages;
|
|
84
93
|
};
|
|
85
94
|
const prepareDocument = (options) => {
|
|
86
95
|
if (typeof document === "undefined") {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -14,10 +14,10 @@ import { createDomqlElement } from './createDomql'
|
|
|
14
14
|
|
|
15
15
|
const SYMBOLS_KEY = process.env.SYMBOLS_KEY
|
|
16
16
|
|
|
17
|
-
const mergeWithLocalFile = (options, optionsExternalFile) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const mergeWithLocalFile = (options, optionsExternalFile) => deepMerge(
|
|
18
|
+
options,
|
|
19
|
+
isObject(optionsExternalFile) ? optionsExternalFile : DYNAMIC_JSON || {}
|
|
20
|
+
)
|
|
21
21
|
|
|
22
22
|
export const create = (App, options = DEFAULT_CREATE_OPTIONS, optionsExternalFile) => {
|
|
23
23
|
const redefinedOptions = { ...DEFAULT_CREATE_OPTIONS, ...mergeWithLocalFile(options, optionsExternalFile) }
|
package/src/prepare.js
CHANGED
|
@@ -48,7 +48,17 @@ export const prepareState = (options, App) => {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export const preparePages = options => {
|
|
51
|
-
|
|
51
|
+
const pages = options.pages || {}
|
|
52
|
+
Object.keys(pages)
|
|
53
|
+
.filter(v => !v.startsWith('/'))
|
|
54
|
+
.forEach(v => {
|
|
55
|
+
if (v === 'main') pages['/'] = pages.main
|
|
56
|
+
else {
|
|
57
|
+
pages['/' + v] = pages[v]
|
|
58
|
+
delete pages[v]
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
return pages
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
export const prepareDocument = options => {
|