@symbo.ls/create 2.11.204 → 2.11.208

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/index.js CHANGED
@@ -51,7 +51,7 @@ const mergeWithLocalFile = (options, optionsExternalFile) => {
51
51
  };
52
52
  const create = async (App, options = import_options.default, optionsExternalFile) => {
53
53
  const appIsKey = (0, import_utils.isString)(App);
54
- options = mergeWithLocalFile(options, optionsExternalFile);
54
+ options = (0, import_utils.deepMerge)(mergeWithLocalFile(options, optionsExternalFile), import_options.default);
55
55
  const key = options.key || SYMBOLS_KEY || (appIsKey ? App : "");
56
56
  if (appIsKey)
57
57
  App = {};
@@ -34,7 +34,9 @@ module.exports = __toCommonJS(initEmotion_exports);
34
34
  var import_emotion = require("@domql/emotion");
35
35
  var import_emotion2 = require("@symbo.ls/emotion");
36
36
  var import_init = require("@symbo.ls/init");
37
+ var import_utils = require("@domql/utils");
37
38
  var import_options = __toESM(require("./options"), 1);
39
+ var import_default_config = __toESM(require("@symbo.ls/default-config"), 1);
38
40
  const initEmotion = (key, options = import_options.default) => {
39
41
  const doc = options.parent || options.document || document;
40
42
  const initOptions = options.initOptions || {};
@@ -42,7 +44,8 @@ const initEmotion = (key, options = import_options.default) => {
42
44
  if (!initOptions.emotion)
43
45
  initOptions.emotion = emotion;
44
46
  const registry = options.registry || (0, import_emotion.transformDOMQLEmotion)(initOptions.emotion, options);
45
- const scratchSystem = (0, import_init.init)(options.designSystem || {}, {
47
+ const designSystem = options.designSystem || (options.defaultConfig ? (0, import_utils.deepClone)(import_default_config.default) : {});
48
+ const scratchSystem = (0, import_init.init)(designSystem, {
46
49
  key,
47
50
  emotion,
48
51
  verbose: options.verbose,
@@ -27,6 +27,7 @@ var options_default = {
27
27
  editor: {},
28
28
  state: {},
29
29
  pages: {},
30
+ defaultConfig: true,
30
31
  designSystem: {
31
32
  useReset: true,
32
33
  useVariable: true,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.204",
3
+ "version": "2.11.208",
4
4
  "license": "MIT",
5
- "gitHead": "dab7f6d84335bca5af356b849c51204910670e76",
5
+ "gitHead": "a81b741e63bbb9a0b3b74773eb7a4f86b01d08f3",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -25,7 +25,7 @@
25
25
  "copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
26
26
  "build:esm": "npx esbuild ./src/*.js --target=es2020 --format=esm --outdir=dist/esm",
27
27
  "build:cjs": "npx esbuild ./src/*.js --target=node16 --format=cjs --outdir=dist/cjs",
28
- "build:cjs:bundle": "npx esbuild ./src/index.js --target=node16 --format=cjs --outdir=dist/cjs/bundle --bundle ",
28
+ "build:cjs:bundle": "npx esbuild ./src/index.js --target=node16 --format=cjs --outdir=dist/cjs/bundle --bundle --loader:.svg=empty",
29
29
  "build:iife": "npx esbuild ./src/index.js --target=es2020 --format=iife --outdir=dist/iife --bundle --minify",
30
30
  "build": "yarn build:cjs; yarn build:cjs:bundle",
31
31
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
package/src/index.js CHANGED
@@ -24,7 +24,7 @@ const mergeWithLocalFile = (options, optionsExternalFile) => {
24
24
 
25
25
  export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExternalFile) => {
26
26
  const appIsKey = isString(App)
27
- options = mergeWithLocalFile(options, optionsExternalFile)
27
+ options = deepMerge(mergeWithLocalFile(options, optionsExternalFile), DEFAULT_CREATE_OPTIONS)
28
28
 
29
29
  const key = options.key || SYMBOLS_KEY || (appIsKey ? App : '')
30
30
 
@@ -3,8 +3,10 @@
3
3
  import { transformDOMQLEmotion } from '@domql/emotion'
4
4
  import { emotion as defaultEmotion } from '@symbo.ls/emotion'
5
5
  import { init } from '@symbo.ls/init'
6
+ import { deepClone } from '@domql/utils'
6
7
 
7
8
  import DEFAULT_CREATE_OPTIONS from './options'
9
+ import DEFAULT_CONFIG from '@symbo.ls/default-config'
8
10
 
9
11
  export const initEmotion = (key, options = DEFAULT_CREATE_OPTIONS) => {
10
12
  const doc = options.parent || options.document || document
@@ -13,7 +15,9 @@ export const initEmotion = (key, options = DEFAULT_CREATE_OPTIONS) => {
13
15
  if (!initOptions.emotion) initOptions.emotion = emotion
14
16
  const registry = options.registry || transformDOMQLEmotion(initOptions.emotion, options)
15
17
 
16
- const scratchSystem = init(options.designSystem || {}, {
18
+ const designSystem = options.designSystem || (options.defaultConfig ? deepClone(DEFAULT_CONFIG) : {})
19
+
20
+ const scratchSystem = init(designSystem, {
17
21
  key,
18
22
  emotion,
19
23
  verbose: options.verbose,
package/src/options.js CHANGED
@@ -7,6 +7,7 @@ export default {
7
7
  editor: {},
8
8
  state: {},
9
9
  pages: {},
10
+ defaultConfig: true,
10
11
  designSystem: {
11
12
  useReset: true,
12
13
  useVariable: true,