@symbo.ls/create 2.11.417 → 2.11.422

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.
@@ -607,7 +607,7 @@ var require_object = __commonJS({
607
607
  diff: () => diff,
608
608
  diffArrays: () => diffArrays,
609
609
  diffObjects: () => diffObjects,
610
- exec: () => exec4,
610
+ exec: () => exec5,
611
611
  flattenRecursive: () => flattenRecursive,
612
612
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
613
613
  getExtendsInElement: () => getExtendsInElement,
@@ -632,7 +632,7 @@ var require_object = __commonJS({
632
632
  var import_types = require_types();
633
633
  var import_array = require_array();
634
634
  var import_string = require_string();
635
- var exec4 = (param, element, state, context) => {
635
+ var exec5 = (param, element, state, context) => {
636
636
  if ((0, import_types.isFunction)(param)) {
637
637
  return param(
638
638
  element,
@@ -644,7 +644,7 @@ var require_object = __commonJS({
644
644
  };
645
645
  var map2 = (obj, extention, element) => {
646
646
  for (const e in extention) {
647
- obj[e] = exec4(extention[e], element);
647
+ obj[e] = exec5(extention[e], element);
648
648
  }
649
649
  };
650
650
  var merge6 = (element, obj, excludeFrom = []) => {
@@ -733,7 +733,7 @@ var require_object = __commonJS({
733
733
  return o;
734
734
  };
735
735
  var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
736
- const o = (0, import_types.isArray)(obj) ? [] : {};
736
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
737
737
  for (const prop in obj) {
738
738
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
739
739
  continue;
@@ -1109,6 +1109,12 @@ var require_object = __commonJS({
1109
1109
  if (foundString || foundInArray)
1110
1110
  return el;
1111
1111
  }
1112
+ if (el.parent && el.parent.childExtend) {
1113
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1114
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1115
+ if (foundString || foundInArray)
1116
+ return el;
1117
+ }
1112
1118
  };
1113
1119
  var getExtendsInElement = (obj) => {
1114
1120
  let result = [];
@@ -2142,7 +2148,7 @@ var require_cjs2 = __commonJS({
2142
2148
  diff: () => diff,
2143
2149
  diffArrays: () => diffArrays,
2144
2150
  diffObjects: () => diffObjects,
2145
- exec: () => exec4,
2151
+ exec: () => exec5,
2146
2152
  flattenRecursive: () => flattenRecursive,
2147
2153
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2148
2154
  getExtendsInElement: () => getExtendsInElement,
@@ -2167,7 +2173,7 @@ var require_cjs2 = __commonJS({
2167
2173
  var import_types = require_types4();
2168
2174
  var import_array = require_array4();
2169
2175
  var import_string = require_string4();
2170
- var exec4 = (param, element, state, context) => {
2176
+ var exec5 = (param, element, state, context) => {
2171
2177
  if ((0, import_types.isFunction)(param)) {
2172
2178
  return param(
2173
2179
  element,
@@ -2179,7 +2185,7 @@ var require_cjs2 = __commonJS({
2179
2185
  };
2180
2186
  var map2 = (obj, extention, element) => {
2181
2187
  for (const e in extention) {
2182
- obj[e] = exec4(extention[e], element);
2188
+ obj[e] = exec5(extention[e], element);
2183
2189
  }
2184
2190
  };
2185
2191
  var merge52 = (element, obj, excludeFrom = []) => {
@@ -4004,7 +4010,7 @@ var require_cjs2 = __commonJS({
4004
4010
  diff: () => diff,
4005
4011
  diffArrays: () => diffArrays,
4006
4012
  diffObjects: () => diffObjects,
4007
- exec: () => exec4,
4013
+ exec: () => exec5,
4008
4014
  flattenRecursive: () => flattenRecursive,
4009
4015
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
4010
4016
  getExtendsInElement: () => getExtendsInElement,
@@ -4029,7 +4035,7 @@ var require_cjs2 = __commonJS({
4029
4035
  var import_types = require_types22();
4030
4036
  var import_array = require_array22();
4031
4037
  var import_string = require_string22();
4032
- var exec4 = (param, element, state, context) => {
4038
+ var exec5 = (param, element, state, context) => {
4033
4039
  if ((0, import_types.isFunction)(param)) {
4034
4040
  return param(
4035
4041
  element,
@@ -4041,7 +4047,7 @@ var require_cjs2 = __commonJS({
4041
4047
  };
4042
4048
  var map2 = (obj, extention, element) => {
4043
4049
  for (const e in extention) {
4044
- obj[e] = exec4(extention[e], element);
4050
+ obj[e] = exec5(extention[e], element);
4045
4051
  }
4046
4052
  };
4047
4053
  var merge52 = (element, obj, excludeFrom = []) => {
@@ -7265,7 +7271,7 @@ var require_cjs3 = __commonJS({
7265
7271
  diff: () => diff,
7266
7272
  diffArrays: () => diffArrays,
7267
7273
  diffObjects: () => diffObjects,
7268
- exec: () => exec4,
7274
+ exec: () => exec5,
7269
7275
  flattenRecursive: () => flattenRecursive,
7270
7276
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
7271
7277
  getExtendsInElement: () => getExtendsInElement,
@@ -7290,7 +7296,7 @@ var require_cjs3 = __commonJS({
7290
7296
  var import_types = require_types4();
7291
7297
  var import_array = require_array4();
7292
7298
  var import_string = require_string4();
7293
- var exec4 = (param, element, state, context) => {
7299
+ var exec5 = (param, element, state, context) => {
7294
7300
  if ((0, import_types.isFunction)(param)) {
7295
7301
  return param(
7296
7302
  element,
@@ -7302,7 +7308,7 @@ var require_cjs3 = __commonJS({
7302
7308
  };
7303
7309
  var map2 = (obj, extention, element) => {
7304
7310
  for (const e in extention) {
7305
- obj[e] = exec4(extention[e], element);
7311
+ obj[e] = exec5(extention[e], element);
7306
7312
  }
7307
7313
  };
7308
7314
  var merge6 = (element, obj, excludeFrom = []) => {
@@ -7391,7 +7397,7 @@ var require_cjs3 = __commonJS({
7391
7397
  return o;
7392
7398
  };
7393
7399
  var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
7394
- const o = (0, import_types.isArray)(obj) ? [] : {};
7400
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
7395
7401
  for (const prop in obj) {
7396
7402
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
7397
7403
  continue;
@@ -7767,6 +7773,12 @@ var require_cjs3 = __commonJS({
7767
7773
  if (foundString || foundInArray)
7768
7774
  return el;
7769
7775
  }
7776
+ if (el.parent && el.parent.childExtend) {
7777
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
7778
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
7779
+ if (foundString || foundInArray)
7780
+ return el;
7781
+ }
7770
7782
  };
7771
7783
  var getExtendsInElement = (obj) => {
7772
7784
  let result = [];
@@ -8182,13 +8194,15 @@ var require_cjs3 = __commonJS({
8182
8194
  });
8183
8195
  module2.exports = __toCommonJS2(src_exports2);
8184
8196
  var import_utils210 = __toESM2(require_cjs18(), 1);
8185
- var toggleFullscreen = (el) => {
8197
+ var toggleFullscreen = async (el) => {
8186
8198
  if (!document.fullscreenElement) {
8187
- el.node.requestFullscreen().catch((err) => {
8199
+ try {
8200
+ await (el.node || document).requestFullscreen();
8201
+ } catch (err) {
8188
8202
  console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
8189
- });
8203
+ }
8190
8204
  } else {
8191
- document.exitFullscreen();
8205
+ await document.exitFullscreen();
8192
8206
  }
8193
8207
  };
8194
8208
  var import_utils32 = __toESM2(require_cjs18(), 1);
@@ -8243,7 +8257,7 @@ var require_cjs3 = __commonJS({
8243
8257
  }
8244
8258
  });
8245
8259
  };
8246
- var loadJavascriptFileSync2 = (FILE_URL, doc = document, type = "text/javascript") => {
8260
+ var loadJavascriptFileSync2 = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
8247
8261
  const xhr = new window.XMLHttpRequest();
8248
8262
  xhr.open("GET", FILE_URL, false);
8249
8263
  xhr.send();
@@ -8252,6 +8266,8 @@ var require_cjs3 = __commonJS({
8252
8266
  scriptEle.type = type;
8253
8267
  scriptEle.text = xhr.responseText;
8254
8268
  doc.body.appendChild(scriptEle);
8269
+ if (typeof fallback === "function")
8270
+ fallback();
8255
8271
  } else {
8256
8272
  throw new Error(`Failed to load the script ${FILE_URL}`);
8257
8273
  }
@@ -9971,7 +9987,7 @@ var require_attr = __commonJS({
9971
9987
  if (params) {
9972
9988
  for (const attr in params) {
9973
9989
  const val = (0, import_utils32.exec)(params[attr], element);
9974
- if ((0, import_utils32.isDefined)(val) && val && node3.setAttribute)
9990
+ if (val !== false && !(0, import_utils32.isUndefined)(val) && !(0, import_utils32.isNull)(val) && node3.setAttribute)
9975
9991
  node3.setAttribute(attr, val);
9976
9992
  else if (node3.removeAttribute)
9977
9993
  node3.removeAttribute(attr);
@@ -10145,11 +10161,9 @@ var require_set = __commonJS({
10145
10161
  ...options
10146
10162
  });
10147
10163
  };
10148
- var reset = (params = {}, options) => {
10164
+ var reset = (options) => {
10149
10165
  const element = void 0;
10150
- if (!options.preventRemove)
10151
- (0, import_content.removeContent)(element, options);
10152
- (0, import_create.default)(params, element, options.contentElementKey || "content", {
10166
+ (0, import_create.default)(element, element.parent, void 0, {
10153
10167
  ignoreChildExtend: true,
10154
10168
  ...import_mixins.registry.defaultOptions,
10155
10169
  ...import_options3.default.create,
@@ -10335,7 +10349,8 @@ var require_html = __commonJS({
10335
10349
  module2.exports = __toCommonJS2(html_exports);
10336
10350
  var import_utils32 = require_cjs();
10337
10351
  var html_default = (param, element, node3) => {
10338
- const prop = (0, import_utils32.exec)(param, element);
10352
+ var _a;
10353
+ const prop = (0, import_utils32.exec)(param, element) || (0, import_utils32.exec)((_a = element == null ? void 0 : element.props) == null ? void 0 : _a.html, element);
10339
10354
  const { __ref } = element;
10340
10355
  if (prop !== __ref.__html) {
10341
10356
  if (node3.nodeName === "SVG")
@@ -10780,6 +10795,7 @@ var require_methods2 = __commonJS({
10780
10795
  return parent;
10781
10796
  };
10782
10797
  var lookdown = function(param) {
10798
+ var _a;
10783
10799
  const el = this;
10784
10800
  const { __ref: ref } = el;
10785
10801
  const children = ref.__children;
@@ -10789,18 +10805,19 @@ var require_methods2 = __commonJS({
10789
10805
  if (v === param)
10790
10806
  return childElem;
10791
10807
  else if ((0, import_utils32.isFunction)(param)) {
10792
- const exec4 = param(childElem, childElem.state, childElem.context);
10793
- if (childElem.state && exec4) {
10808
+ const exec5 = param(childElem, childElem.state, childElem.context);
10809
+ if (childElem.state && exec5) {
10794
10810
  return childElem;
10795
10811
  }
10796
10812
  }
10797
- const lookdown2 = childElem == null ? void 0 : childElem.lookdown(param);
10813
+ const lookdown2 = (_a = childElem == null ? void 0 : childElem.lookdown) == null ? void 0 : _a.call(childElem, param);
10798
10814
  if (lookdown2)
10799
10815
  return lookdown2;
10800
10816
  }
10801
10817
  return null;
10802
10818
  };
10803
10819
  var lookdownAll = function(param, results = []) {
10820
+ var _a;
10804
10821
  const el = this;
10805
10822
  const { __ref: ref } = el;
10806
10823
  const children = ref.__children;
@@ -10810,11 +10827,11 @@ var require_methods2 = __commonJS({
10810
10827
  if (v === param)
10811
10828
  results.push(childElem);
10812
10829
  else if ((0, import_utils32.isFunction)(param)) {
10813
- const exec4 = param(childElem, childElem.state, childElem.context);
10814
- if (childElem.state && exec4)
10830
+ const exec5 = param(childElem, childElem.state, childElem.context);
10831
+ if (childElem.state && exec5)
10815
10832
  results.push(childElem);
10816
10833
  }
10817
- childElem == null ? void 0 : childElem.lookdownAll(param, results);
10834
+ (_a = childElem == null ? void 0 : childElem.lookdownAll) == null ? void 0 : _a.call(childElem, param, results);
10818
10835
  }
10819
10836
  return results.length ? results : null;
10820
10837
  };
@@ -12599,7 +12616,7 @@ var require_object3 = __commonJS({
12599
12616
  diff: () => diff,
12600
12617
  diffArrays: () => diffArrays,
12601
12618
  diffObjects: () => diffObjects,
12602
- exec: () => exec4,
12619
+ exec: () => exec5,
12603
12620
  flattenRecursive: () => flattenRecursive,
12604
12621
  hasOwnProperty: () => hasOwnProperty,
12605
12622
  isEmpty: () => isEmpty,
@@ -12622,7 +12639,7 @@ var require_object3 = __commonJS({
12622
12639
  var import_types = require_types2();
12623
12640
  var import_array = require_array2();
12624
12641
  var import_string = require_string2();
12625
- var exec4 = (param, element, state, context) => {
12642
+ var exec5 = (param, element, state, context) => {
12626
12643
  if ((0, import_types.isFunction)(param)) {
12627
12644
  return param(
12628
12645
  element,
@@ -12634,7 +12651,7 @@ var require_object3 = __commonJS({
12634
12651
  };
12635
12652
  var map2 = (obj, extention, element) => {
12636
12653
  for (const e in extention) {
12637
- obj[e] = exec4(extention[e], element);
12654
+ obj[e] = exec5(extention[e], element);
12638
12655
  }
12639
12656
  };
12640
12657
  var merge6 = (element, obj, excludeFrom = []) => {
@@ -14954,7 +14971,7 @@ var require_object4 = __commonJS({
14954
14971
  diff: () => diff,
14955
14972
  diffArrays: () => diffArrays,
14956
14973
  diffObjects: () => diffObjects,
14957
- exec: () => exec4,
14974
+ exec: () => exec5,
14958
14975
  flattenRecursive: () => flattenRecursive,
14959
14976
  hasOwnProperty: () => hasOwnProperty,
14960
14977
  isEmpty: () => isEmpty,
@@ -14977,7 +14994,7 @@ var require_object4 = __commonJS({
14977
14994
  var import_types = require_types3();
14978
14995
  var import_array = require_array3();
14979
14996
  var import_string = require_string3();
14980
- var exec4 = (param, element, state, context) => {
14997
+ var exec5 = (param, element, state, context) => {
14981
14998
  if ((0, import_types.isFunction)(param)) {
14982
14999
  return param(
14983
15000
  element,
@@ -14989,7 +15006,7 @@ var require_object4 = __commonJS({
14989
15006
  };
14990
15007
  var map2 = (obj, extention, element) => {
14991
15008
  for (const e in extention) {
14992
- obj[e] = exec4(extention[e], element);
15009
+ obj[e] = exec5(extention[e], element);
14993
15010
  }
14994
15011
  };
14995
15012
  var merge6 = (element, obj, excludeFrom = []) => {
@@ -17334,6 +17351,7 @@ __export(uikit_exports, {
17334
17351
  CommonField: () => CommonField,
17335
17352
  CommonFieldTemplate: () => CommonFieldTemplate,
17336
17353
  CountIndicator: () => CountIndicator,
17354
+ Data: () => Data,
17337
17355
  Dialog: () => Dialog,
17338
17356
  DialogFooter: () => DialogFooter,
17339
17357
  DialogHeader: () => DialogHeader,
@@ -17826,8 +17844,8 @@ var Img = {
17826
17844
  attr: {
17827
17845
  src: (el) => {
17828
17846
  const { props: props2, context } = el;
17829
- const { exec: exec4, isString: isString14, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3 } = context.utils;
17830
- let src = (props2.preSrc || "") + exec4(props2.src, el);
17847
+ const { exec: exec5, isString: isString14, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3 } = context.utils;
17848
+ let src = (props2.preSrc || "") + exec5(props2.src, el);
17831
17849
  if (isString14(src) && src.includes("{{")) {
17832
17850
  src = replaceLiteralsWithObjectFields3(src, el.state);
17833
17851
  }
@@ -17912,8 +17930,8 @@ var getComputedBackgroundColor = ({ props: props2 }) => {
17912
17930
  return (0, import_scratch6.getColor)(props2.shapeDirectionColor) || (0, import_scratch6.getColor)(props2.borderColor) || (0, import_scratch6.getColor)(props2.backgroundColor) || (0, import_scratch6.getColor)(props2.background);
17913
17931
  };
17914
17932
  var inheritTransition = ({ props: props2, deps }) => {
17915
- const exec4 = Timing.class.transition({ props: props2, deps });
17916
- return exec4 && exec4.transition;
17933
+ const exec5 = Timing.class.transition({ props: props2, deps });
17934
+ return exec5 && exec5.transition;
17917
17935
  };
17918
17936
  var SHAPES = {
17919
17937
  rectangle: {},
@@ -18578,9 +18596,10 @@ var Collection = {
18578
18596
  $collection: (param, el, state) => {
18579
18597
  const { __ref: ref } = el;
18580
18598
  const { children, childrenAs, childrenExtend } = el.props || {};
18581
- const hasChildren = (0, import_utils8.isArray)(children);
18599
+ const childrenExec = children && (0, import_utils8.exec)(children, el, state);
18600
+ const hasChildren = (0, import_utils8.isArray)(childrenExec);
18582
18601
  if (hasChildren) {
18583
- param = children;
18602
+ param = (0, import_utils8.deepCloneWithExtend)(childrenExec);
18584
18603
  if (childrenAs)
18585
18604
  param = param.map((v) => ({ extend: childrenExtend, [childrenAs]: v }));
18586
18605
  } else if (!param)
@@ -18641,7 +18660,8 @@ var Collection = {
18641
18660
  return data;
18642
18661
  },
18643
18662
  $stateCollection: (param, el, state, ctx) => {
18644
- if (!param)
18663
+ const { children, childrenAs } = el.props || {};
18664
+ if (!param || children || childrenAs)
18645
18665
  return;
18646
18666
  if ((0, import_utils8.isString)(param)) {
18647
18667
  if (param === "state")
@@ -18682,7 +18702,8 @@ var Collection = {
18682
18702
  el.content = obj;
18683
18703
  },
18684
18704
  $propsCollection: (param, el, state) => {
18685
- if (!param)
18705
+ const { children, childrenAs } = el.props || {};
18706
+ if (!param || children || childrenAs)
18686
18707
  return;
18687
18708
  if ((0, import_utils8.isString)(param)) {
18688
18709
  if (param === "state")
@@ -18816,6 +18837,8 @@ var Svg = {
18816
18837
  const { designSystem, utils: utils2 } = context;
18817
18838
  const SVG = designSystem && designSystem.SVG;
18818
18839
  const useSvgSprite = props2.spriteId || context.designSystem && context.designSystem.useSvgSprite;
18840
+ if (props2.html)
18841
+ return props2.html;
18819
18842
  if (!useSvgSprite && props2.src)
18820
18843
  return props2.src;
18821
18844
  const useSVGSymbol = (icon) => `<use xlink:href="#${icon}" />`;
@@ -18942,6 +18965,7 @@ var Footnote = {
18942
18965
  };
18943
18966
  var B = { tag: "b" };
18944
18967
  var I = { tag: "i" };
18968
+ var Data = { tag: "data" };
18945
18969
 
18946
18970
  // ../uikit/Atoms/Transform.js
18947
18971
  var import_utils11 = __toESM(require_cjs());
@@ -19435,8 +19459,8 @@ var Link = {
19435
19459
  },
19436
19460
  attr: {
19437
19461
  href: (el, s, ctx) => {
19438
- const { isString: isString14, exec: exec4, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3 } = ctx.utils;
19439
- const href = exec4(el.props.href, el) || exec4(el.props, el).href;
19462
+ const { isString: isString14, exec: exec5, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3 } = ctx.utils;
19463
+ const href = exec5(el.props.href, el) || exec5(el.props, el).href;
19440
19464
  if (isString14(href) && href.includes("{{")) {
19441
19465
  return replaceLiteralsWithObjectFields3(href, s);
19442
19466
  }
@@ -19452,8 +19476,8 @@ var RouterLink = {
19452
19476
  click: (event, el, s) => {
19453
19477
  const { props: props2, context: ctx } = el;
19454
19478
  const { href: h, scrollToTop, stopPropagation } = props2;
19455
- const { exec: exec4, isString: isString14, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3, isDefined: isDefined2 } = ctx.utils;
19456
- let href = exec4(h, el, s);
19479
+ const { exec: exec5, isString: isString14, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3, isDefined: isDefined2 } = ctx.utils;
19480
+ let href = exec5(h, el, s);
19457
19481
  if (isString14(href) && href.includes("{{")) {
19458
19482
  href = replaceLiteralsWithObjectFields3(href, s);
19459
19483
  }
@@ -22171,8 +22195,8 @@ var initRouter = (element, options) => {
22171
22195
  const routerOptions = options.router;
22172
22196
  const router2 = options.snippets && options.snippets.router ? options.snippets.router : import_router2.router;
22173
22197
  const onRouterRenderDefault = (el, s) => {
22174
- const { pathname, hash: hash3 } = import_utils20.window.location;
22175
- const url2 = pathname + hash3;
22198
+ const { pathname, search, hash: hash3 } = import_utils20.window.location;
22199
+ const url2 = pathname + search + hash3;
22176
22200
  if (el.routes)
22177
22201
  router2(url2, el, {}, { initialRender: true });
22178
22202
  };
@@ -22199,8 +22223,8 @@ var popStateRouter = (element, options) => {
22199
22223
  return;
22200
22224
  const router2 = options.snippets && options.snippets.router ? options.snippets.router : import_router2.router;
22201
22225
  import_utils20.window.onpopstate = (e) => {
22202
- const { pathname, hash: hash3 } = import_utils20.window.location;
22203
- const url2 = pathname + hash3;
22226
+ const { pathname, search, hash: hash3 } = import_utils20.window.location;
22227
+ const url2 = pathname + search + hash3;
22204
22228
  router2(url2, element, {}, { pushState: false, scrollToTop: false, level: 0 });
22205
22229
  };
22206
22230
  };
@@ -25591,19 +25615,29 @@ var ENV = "development";
25591
25615
  var defautlOpts = {};
25592
25616
  var CONNECT_ATTEPT = 0;
25593
25617
  var CONNECT_ATTEPT_MAX_ALLOWED = 1;
25594
- var connect = (key, options = {}) => {
25595
- const isDev = options.development || window3 && window3.location && window3.location.host.includes("local") || (ENV === "test" || ENV === "development");
25618
+ var getIsDev = (options) => {
25619
+ return options.development || window3 && window3.location && window3.location.host.includes("local") || (ENV === "test" || ENV === "development");
25620
+ };
25621
+ var getSocketUrl = (options, isDev) => {
25596
25622
  const SOCKET_BACKEND_URL = isDev ? "http://localhost:13336/" : "https://socket.symbols.app/";
25597
25623
  const socketUrls = isArray3(options.socketUrl) ? options.socketUrl : [options.socketUrl || SOCKET_BACKEND_URL];
25598
25624
  const primaryUrl = socketUrls[0];
25599
25625
  const secondaryUrl = socketUrls[1] || "socket.symbols.app";
25600
- const socket = lookup2(primaryUrl || SOCKET_BACKEND_URL, {
25626
+ return {
25627
+ primaryUrl: primaryUrl || SOCKET_BACKEND_URL,
25628
+ secondaryUrl
25629
+ };
25630
+ };
25631
+ var connect = (key, options = {}) => {
25632
+ const isDev = getIsDev(options);
25633
+ const { primaryUrl, secondaryUrl } = getSocketUrl(options, isDev);
25634
+ const socket = lookup2(primaryUrl || secondaryUrl, {
25601
25635
  // withCredentials: true
25602
25636
  });
25603
25637
  socket.on("connect", () => {
25604
25638
  if (isDev) {
25605
25639
  console.log(
25606
- `Connected to %c${primaryUrl || SOCKET_BACKEND_URL} %c${key} %c${socket.id}`,
25640
+ `Connected to %c${primaryUrl} %c${key} %c${socket.id}`,
25607
25641
  "font-weight: bold; color: green;",
25608
25642
  "font-weight: bold;",
25609
25643
  ""
@@ -25868,7 +25902,9 @@ var connectedToSymbols = (clients, element, state) => {
25868
25902
  state.update({ connected: false });
25869
25903
  const t = setTimeout(() => {
25870
25904
  delete state.notifications.connected;
25871
- element.notifications.content.connected.setProps({ animation: "fadeOutDown" });
25905
+ if (element.notifications.content.connected) {
25906
+ element.notifications.content.connected.setProps({ animation: "fadeOutDown" });
25907
+ }
25872
25908
  state.update({ connected: true });
25873
25909
  clearTimeout(t);
25874
25910
  }, 3e3);
@@ -41,8 +41,8 @@ const initRouter = (element, options) => {
41
41
  const routerOptions = options.router;
42
42
  const router = options.snippets && options.snippets.router ? options.snippets.router : import_router.router;
43
43
  const onRouterRenderDefault = (el, s) => {
44
- const { pathname, hash } = import_utils.window.location;
45
- const url = pathname + hash;
44
+ const { pathname, search, hash } = import_utils.window.location;
45
+ const url = pathname + search + hash;
46
46
  if (el.routes)
47
47
  router(url, el, {}, { initialRender: true });
48
48
  };
@@ -69,8 +69,8 @@ const popStateRouter = (element, options) => {
69
69
  return;
70
70
  const router = options.snippets && options.snippets.router ? options.snippets.router : import_router.router;
71
71
  import_utils.window.onpopstate = (e) => {
72
- const { pathname, hash } = import_utils.window.location;
73
- const url = pathname + hash;
72
+ const { pathname, search, hash } = import_utils.window.location;
73
+ const url = pathname + search + hash;
74
74
  router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 });
75
75
  };
76
76
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.417",
3
+ "version": "2.11.422",
4
4
  "license": "MIT",
5
- "gitHead": "d3f5ad50e57320d72c7d50bc0309f3308e6b8ff2",
5
+ "gitHead": "656fc11f2234248ed554e1a1d4ba11c70fa3253b",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
package/src/router.js CHANGED
@@ -19,8 +19,8 @@ export const initRouter = (element, options) => {
19
19
  const router = (options.snippets && options.snippets.router) ? options.snippets.router : defaultRouter
20
20
 
21
21
  const onRouterRenderDefault = (el, s) => {
22
- const { pathname, hash } = window.location
23
- const url = pathname + hash
22
+ const { pathname, search, hash } = window.location
23
+ const url = pathname + search + hash
24
24
  if (el.routes) router(url, el, {}, { initialRender: true })
25
25
  }
26
26
 
@@ -50,8 +50,8 @@ export const popStateRouter = (element, options) => {
50
50
  ? options.snippets.router
51
51
  : defaultRouter
52
52
  window.onpopstate = e => {
53
- const { pathname, hash } = window.location
54
- const url = pathname + hash
53
+ const { pathname, search, hash } = window.location
54
+ const url = pathname + search + hash
55
55
  router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 })
56
56
  }
57
57
  }