@symbo.ls/create 2.11.39 → 2.11.98
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 +24903 -0
- package/dist/cjs/define.js +43 -0
- package/dist/cjs/ferchOnCreate.js +54 -0
- package/dist/cjs/index.js +138 -0
- package/dist/cjs/initEmotion.js +54 -0
- package/dist/cjs/options.js +47 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/router.js +78 -0
- package/dist/cjs/syncExtend.js +47 -0
- package/dist/cjs/utilImports.js +35 -0
- package/package.json +24 -4
- /package/{define.js → src/define.js} +0 -0
- /package/{ferchOnCreate.js → src/ferchOnCreate.js} +0 -0
- /package/{index.js → src/index.js} +0 -0
- /package/{initEmotion.js → src/initEmotion.js} +0 -0
- /package/{options.js → src/options.js} +0 -0
- /package/{router.js → src/router.js} +0 -0
- /package/{syncExtend.js → src/syncExtend.js} +0 -0
- /package/{utilImports.js → src/utilImports.js} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var define_exports = {};
|
|
20
|
+
__export(define_exports, {
|
|
21
|
+
defaultDefine: () => defaultDefine
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(define_exports);
|
|
24
|
+
var import_uikit = require("@symbo.ls/uikit");
|
|
25
|
+
const defaultDefine = {
|
|
26
|
+
routes: (param) => param,
|
|
27
|
+
$router: (param, el) => {
|
|
28
|
+
if (!param)
|
|
29
|
+
return;
|
|
30
|
+
const obj = { tag: "fragment", ...param };
|
|
31
|
+
const set = () => {
|
|
32
|
+
el.set(obj, { preventDefineUpdate: "$router" });
|
|
33
|
+
};
|
|
34
|
+
if (el.props && el.props.lazyLoad) {
|
|
35
|
+
window.requestAnimationFrame(set);
|
|
36
|
+
} else
|
|
37
|
+
set();
|
|
38
|
+
return obj;
|
|
39
|
+
},
|
|
40
|
+
$setCollection: import_uikit.Collection.define.$setCollection,
|
|
41
|
+
$setStateCollection: import_uikit.Collection.define.$setStateCollection,
|
|
42
|
+
$setPropsCollection: import_uikit.Collection.define.$setPropsCollection
|
|
43
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ferchOnCreate_exports = {};
|
|
20
|
+
__export(ferchOnCreate_exports, {
|
|
21
|
+
fetchAsync: () => fetchAsync,
|
|
22
|
+
fetchSync: () => fetchSync
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ferchOnCreate_exports);
|
|
25
|
+
var import_utils = require("@domql/utils");
|
|
26
|
+
var import_fetch = require("@symbo.ls/fetch");
|
|
27
|
+
const fetchSync = async (key, options) => {
|
|
28
|
+
if (key && options.editor) {
|
|
29
|
+
try {
|
|
30
|
+
if (!options.editor.async)
|
|
31
|
+
await (0, import_fetch.fetchProject)(key, options);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const fetchAsync = (app, key, options, callback) => {
|
|
38
|
+
if (key && options.editor) {
|
|
39
|
+
try {
|
|
40
|
+
const defaultCallback = (data) => {
|
|
41
|
+
if ((0, import_utils.isObject)(data.designsystem)) {
|
|
42
|
+
options.utils.init(data.designsystem);
|
|
43
|
+
}
|
|
44
|
+
if ((0, import_utils.isObject)(data.state)) {
|
|
45
|
+
app.state.set(data.state);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (options.editor.async)
|
|
49
|
+
(0, import_fetch.fetchProjectAsync)(key, options, callback || defaultCallback);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.error(e);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
create: () => create,
|
|
32
|
+
createSync: () => createSync,
|
|
33
|
+
default: () => src_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var import_domql = __toESM(require("domql"), 1);
|
|
37
|
+
var import_utils = require("@domql/utils");
|
|
38
|
+
var utils = __toESM(require("./utilImports"), 1);
|
|
39
|
+
var uikit = __toESM(require("@symbo.ls/uikit"), 1);
|
|
40
|
+
var import_define = require("./define");
|
|
41
|
+
var import_router = require("./router");
|
|
42
|
+
var import_ferchOnCreate = require("./ferchOnCreate");
|
|
43
|
+
var import_initEmotion = require("./initEmotion");
|
|
44
|
+
var import_syncExtend = require("./syncExtend");
|
|
45
|
+
var import_options = __toESM(require("./options"), 1);
|
|
46
|
+
var import_dynamic = __toESM(require("@symbo.ls/init/dynamic.json"), 1);
|
|
47
|
+
const SYMBOLS_KEY = process.env.SYMBOLS_KEY;
|
|
48
|
+
const mergeWithLocalFile = (options, optionsExternalFile) => {
|
|
49
|
+
const rcfile = (0, import_utils.isObject)(optionsExternalFile) ? optionsExternalFile : import_dynamic.default || {};
|
|
50
|
+
return (0, import_utils.deepMerge)(options, rcfile);
|
|
51
|
+
};
|
|
52
|
+
const create = async (App, options = import_options.default, optionsExternalFile) => {
|
|
53
|
+
const appIsKey = (0, import_utils.isString)(App);
|
|
54
|
+
options = mergeWithLocalFile(options, optionsExternalFile);
|
|
55
|
+
const key = options.key || SYMBOLS_KEY || (appIsKey ? App : "");
|
|
56
|
+
if (appIsKey)
|
|
57
|
+
App = {};
|
|
58
|
+
await (0, import_ferchOnCreate.fetchSync)(key, options);
|
|
59
|
+
const doc = options.parent || options.document || document;
|
|
60
|
+
const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
|
|
61
|
+
const state = options.state || {};
|
|
62
|
+
const pages = options.pages || {};
|
|
63
|
+
const components = options.components ? { ...uikit, ...options.components } : uikit;
|
|
64
|
+
const designSystem = scratchSystem || {};
|
|
65
|
+
const snippets = { ...utils, ...utils.scratchUtils, ...options.snippets || {} };
|
|
66
|
+
const define = options.define || import_define.defaultDefine;
|
|
67
|
+
const routerOptions = (0, import_router.initRouter)(App, options);
|
|
68
|
+
const extend = (0, import_syncExtend.applySyncDebug)([App], options);
|
|
69
|
+
const domqlApp = import_domql.default.create({
|
|
70
|
+
extend,
|
|
71
|
+
routes: options.pages,
|
|
72
|
+
state,
|
|
73
|
+
context: {
|
|
74
|
+
key,
|
|
75
|
+
components,
|
|
76
|
+
state,
|
|
77
|
+
pages,
|
|
78
|
+
designSystem,
|
|
79
|
+
snippets,
|
|
80
|
+
utils: snippets,
|
|
81
|
+
define,
|
|
82
|
+
registry,
|
|
83
|
+
emotion,
|
|
84
|
+
routerOptions,
|
|
85
|
+
document: doc
|
|
86
|
+
}
|
|
87
|
+
}, doc.body, key, {
|
|
88
|
+
extend: [uikit.Box],
|
|
89
|
+
verbose: options.verbose,
|
|
90
|
+
...options.domqlOptions
|
|
91
|
+
});
|
|
92
|
+
(0, import_syncExtend.applyInspectListener)(domqlApp, options);
|
|
93
|
+
(0, import_router.popStateRouter)(domqlApp, options);
|
|
94
|
+
if (options.on && options.on.create)
|
|
95
|
+
options.on.create(domqlApp, options);
|
|
96
|
+
(0, import_ferchOnCreate.fetchAsync)(domqlApp, key, {
|
|
97
|
+
utils,
|
|
98
|
+
...options
|
|
99
|
+
});
|
|
100
|
+
return domqlApp;
|
|
101
|
+
};
|
|
102
|
+
const createSync = (App, options = import_options.default, optionsExternalFile) => {
|
|
103
|
+
const appIsKey = (0, import_utils.isString)(App);
|
|
104
|
+
options = mergeWithLocalFile(options, optionsExternalFile);
|
|
105
|
+
const key = options.key || SYMBOLS_KEY || (appIsKey ? App : "");
|
|
106
|
+
if (appIsKey)
|
|
107
|
+
App = {};
|
|
108
|
+
const doc = options.parent || options.document || document;
|
|
109
|
+
const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
|
|
110
|
+
const state = options.state || {};
|
|
111
|
+
const components = options.components ? { ...uikit, ...options.components } : uikit;
|
|
112
|
+
const designSystem = scratchSystem || {};
|
|
113
|
+
const snippets = { ...utils, ...options.snippets || {} };
|
|
114
|
+
const define = options.define || import_define.defaultDefine;
|
|
115
|
+
const extend = (0, import_syncExtend.applySyncDebug)([App], options);
|
|
116
|
+
const domqlApp = import_domql.default.create({
|
|
117
|
+
extend,
|
|
118
|
+
state,
|
|
119
|
+
context: {
|
|
120
|
+
key,
|
|
121
|
+
components,
|
|
122
|
+
state,
|
|
123
|
+
designSystem,
|
|
124
|
+
snippets,
|
|
125
|
+
utils: snippets,
|
|
126
|
+
define,
|
|
127
|
+
registry,
|
|
128
|
+
emotion,
|
|
129
|
+
document: doc
|
|
130
|
+
}
|
|
131
|
+
}, doc.body, key, {
|
|
132
|
+
// extend: [uikit.Box],
|
|
133
|
+
verbose: options.verbose,
|
|
134
|
+
...options.domqlOptions
|
|
135
|
+
});
|
|
136
|
+
return domqlApp;
|
|
137
|
+
};
|
|
138
|
+
var src_default = create;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var initEmotion_exports = {};
|
|
30
|
+
__export(initEmotion_exports, {
|
|
31
|
+
initEmotion: () => initEmotion
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(initEmotion_exports);
|
|
34
|
+
var import_emotion = require("@domql/emotion");
|
|
35
|
+
var import_emotion2 = require("@symbo.ls/emotion");
|
|
36
|
+
var import_init = require("@symbo.ls/init");
|
|
37
|
+
var import_options = __toESM(require("./options"), 1);
|
|
38
|
+
const initEmotion = (key, options = import_options.default) => {
|
|
39
|
+
const doc = options.parent || options.document || document;
|
|
40
|
+
const initOptions = options.initOptions || {};
|
|
41
|
+
const emotion = initOptions.emotion || import_emotion2.emotion;
|
|
42
|
+
if (!initOptions.emotion)
|
|
43
|
+
initOptions.emotion = emotion;
|
|
44
|
+
const registry = options.registry || (0, import_emotion.transformDOMQLEmotion)(initOptions.emotion, options);
|
|
45
|
+
const scratchSystem = (0, import_init.init)(options.designSystem || {}, {
|
|
46
|
+
key,
|
|
47
|
+
emotion,
|
|
48
|
+
verbose: options.verbose,
|
|
49
|
+
document: doc,
|
|
50
|
+
...import_options.default.designSystem,
|
|
51
|
+
...initOptions
|
|
52
|
+
});
|
|
53
|
+
return [scratchSystem, emotion, registry];
|
|
54
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var options_exports = {};
|
|
20
|
+
__export(options_exports, {
|
|
21
|
+
default: () => options_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(options_exports);
|
|
24
|
+
var import_define = require("./define");
|
|
25
|
+
var import_emotion = require("@symbo.ls/emotion");
|
|
26
|
+
var options_default = {
|
|
27
|
+
editor: {},
|
|
28
|
+
state: {},
|
|
29
|
+
pages: {},
|
|
30
|
+
designSystem: {
|
|
31
|
+
useReset: true,
|
|
32
|
+
useVariable: true,
|
|
33
|
+
useIconSprite: true,
|
|
34
|
+
useSvgSprite: true,
|
|
35
|
+
useDocumentTheme: true,
|
|
36
|
+
useFontImport: true
|
|
37
|
+
},
|
|
38
|
+
components: {},
|
|
39
|
+
initOptions: {
|
|
40
|
+
emotion: import_emotion.emotion
|
|
41
|
+
},
|
|
42
|
+
router: {
|
|
43
|
+
initRouter: true,
|
|
44
|
+
injectRouterInLinkComponent: true
|
|
45
|
+
},
|
|
46
|
+
define: import_define.defaultDefine
|
|
47
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var router_exports = {};
|
|
20
|
+
__export(router_exports, {
|
|
21
|
+
initRouter: () => initRouter,
|
|
22
|
+
injectRouterInLinkComponent: () => injectRouterInLinkComponent,
|
|
23
|
+
popStateRouter: () => popStateRouter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(router_exports);
|
|
26
|
+
var import_router = require("@domql/router");
|
|
27
|
+
var import_globals = require("@domql/globals");
|
|
28
|
+
var import_uikit = require("@symbo.ls/uikit");
|
|
29
|
+
var import_utils = require("@domql/utils");
|
|
30
|
+
const DEFAULT_ROUTING_OPTIONS = {
|
|
31
|
+
initRouter: true,
|
|
32
|
+
injectRouterInLinkComponent: true,
|
|
33
|
+
popState: true
|
|
34
|
+
};
|
|
35
|
+
const initRouter = (element, options) => {
|
|
36
|
+
let routerOptions = (0, import_utils.merge)(options.routerOptions || {}, DEFAULT_ROUTING_OPTIONS);
|
|
37
|
+
if (routerOptions === false)
|
|
38
|
+
return;
|
|
39
|
+
if (routerOptions === true)
|
|
40
|
+
routerOptions = DEFAULT_ROUTING_OPTIONS;
|
|
41
|
+
const router = options.snippets && options.snippets.router ? options.snippets.router : import_router.router;
|
|
42
|
+
const onRouterRenderDefault = (el, s) => {
|
|
43
|
+
const { pathname, hash } = import_globals.window.location;
|
|
44
|
+
const url = pathname + hash;
|
|
45
|
+
if (el.routes)
|
|
46
|
+
router(url, el, {}, { initialRender: true });
|
|
47
|
+
};
|
|
48
|
+
const hasRenderRouter = element.on && !(0, import_utils.isUndefined)(element.on.renderRouter);
|
|
49
|
+
if (routerOptions.initRouter && !hasRenderRouter) {
|
|
50
|
+
if (element.on) {
|
|
51
|
+
element.on.renderRouter = onRouterRenderDefault;
|
|
52
|
+
} else {
|
|
53
|
+
element.on = {
|
|
54
|
+
renderRouter: onRouterRenderDefault
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
injectRouterInLinkComponent(routerOptions);
|
|
59
|
+
return routerOptions;
|
|
60
|
+
};
|
|
61
|
+
let popStateFired;
|
|
62
|
+
const popStateRouter = (element, options) => {
|
|
63
|
+
if (popStateFired)
|
|
64
|
+
return;
|
|
65
|
+
const routerOptions = options.routerOptions || DEFAULT_ROUTING_OPTIONS;
|
|
66
|
+
if (!routerOptions.popState)
|
|
67
|
+
return;
|
|
68
|
+
const router = options.snippets && options.snippets.router ? options.snippets.router : import_router.router;
|
|
69
|
+
const { pathname, hash } = import_globals.window.location;
|
|
70
|
+
const url = pathname + hash;
|
|
71
|
+
import_globals.window.onpopstate = (e) => router(url, element, { pushState: false, level: 0 });
|
|
72
|
+
popStateFired = true;
|
|
73
|
+
};
|
|
74
|
+
const injectRouterInLinkComponent = (routerOptions) => {
|
|
75
|
+
if (routerOptions.injectRouterInLinkComponent) {
|
|
76
|
+
return (0, import_utils.deepMerge)(import_uikit.Link, import_uikit.RouterLink);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var syncExtend_exports = {};
|
|
20
|
+
__export(syncExtend_exports, {
|
|
21
|
+
applyInspectListener: () => applyInspectListener,
|
|
22
|
+
applySyncDebug: () => applySyncDebug
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(syncExtend_exports);
|
|
25
|
+
var import_socket_ui = require("@symbo.ls/socket-ui");
|
|
26
|
+
var import_env = require("@domql/env");
|
|
27
|
+
var import_utils = require("@domql/utils");
|
|
28
|
+
const applySyncDebug = (extend, options) => {
|
|
29
|
+
const { editor } = options;
|
|
30
|
+
if (!editor)
|
|
31
|
+
return extend;
|
|
32
|
+
const inspect = (0, import_utils.isUndefined)(editor.inspect) ? (0, import_env.isDevelopment)() : editor.inspect;
|
|
33
|
+
const liveSync = (0, import_utils.isUndefined)(editor.liveSync) ? (0, import_env.isDevelopment)() : editor.liveSync;
|
|
34
|
+
if (inspect)
|
|
35
|
+
extend.push(import_socket_ui.DevFocus);
|
|
36
|
+
if (liveSync)
|
|
37
|
+
extend.push(import_socket_ui.Sync);
|
|
38
|
+
return extend;
|
|
39
|
+
};
|
|
40
|
+
const applyInspectListener = (root, options) => {
|
|
41
|
+
const { editor } = options;
|
|
42
|
+
if (!editor)
|
|
43
|
+
return;
|
|
44
|
+
const inspect = (0, import_utils.isUndefined)(editor.inspect) ? (0, import_env.isDevelopment)() : editor.inspect;
|
|
45
|
+
if (inspect)
|
|
46
|
+
(0, import_socket_ui.inspectOnKey)(root);
|
|
47
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var utilImports_exports = {};
|
|
21
|
+
__export(utilImports_exports, {
|
|
22
|
+
init: () => import_init.init,
|
|
23
|
+
scratchSystem: () => import_scratch.scratchSystem,
|
|
24
|
+
scratchUtils: () => import_scratch.scratchUtils,
|
|
25
|
+
set: () => import_scratch.set,
|
|
26
|
+
updateReset: () => import_init.updateReset
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(utilImports_exports);
|
|
29
|
+
var import_scratch = require("@symbo.ls/scratch");
|
|
30
|
+
__reExport(utilImports_exports, require("@domql/utils"), module.exports);
|
|
31
|
+
__reExport(utilImports_exports, require("@symbo.ls/utils"), module.exports);
|
|
32
|
+
var import_init = require("@symbo.ls/init");
|
|
33
|
+
__reExport(utilImports_exports, require("@domql/cookie"), module.exports);
|
|
34
|
+
__reExport(utilImports_exports, require("@domql/report"), module.exports);
|
|
35
|
+
__reExport(utilImports_exports, require("@domql/router"), module.exports);
|
package/package.json
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/create",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.98",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
6
|
-
"
|
|
7
|
-
|
|
5
|
+
"gitHead": "fc4397b53ef569c55dba3e4dbe18a781a7884585",
|
|
6
|
+
"files": [
|
|
7
|
+
"src",
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"repository": "https://github.com/symbo-ls/scratch",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"module": "src/index.js",
|
|
13
|
+
"unpkg": "dist/iife/index.js",
|
|
14
|
+
"jsdelivr": "dist/iife/index.js",
|
|
15
|
+
"main": "src/index.js",
|
|
16
|
+
"exports": "./dist/cjs/index.js",
|
|
17
|
+
"source": "src/index.js",
|
|
18
|
+
"publishConfig": {},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
|
|
21
|
+
"build:esm": "npx esbuild ./src/*.js --target=es2020 --format=esm --outdir=dist/esm",
|
|
22
|
+
"build:cjs": "npx esbuild ./src/*.js --target=node16 --format=cjs --outdir=dist/cjs",
|
|
23
|
+
"build:cjs:bundle": "npx esbuild ./src/index.js --target=node16 --format=cjs --outdir=dist/cjs/bundle --bundle",
|
|
24
|
+
"build:iife": "npx esbuild ./src/index.js --target=es2020 --format=iife --outdir=dist/iife --bundle --minify",
|
|
25
|
+
"build": "yarn build:cjs; yarn build:cjs:bundle",
|
|
26
|
+
"prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
|
|
27
|
+
},
|
|
8
28
|
"dependencies": {
|
|
9
29
|
"@domql/cookie": "latest",
|
|
10
30
|
"@domql/emotion": "latest",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|