@symbo.ls/create 2.11.203 → 2.11.204

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.
@@ -812,22 +812,28 @@ var require_object = __commonJS({
812
812
  delete objectized[prop];
813
813
  return stack;
814
814
  };
815
- var isEqualDeep2 = (param, element) => {
816
- if (param === element)
815
+ var isEqualDeep2 = (param, element, visited = /* @__PURE__ */ new Set()) => {
816
+ if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
817
+ return param === element;
818
+ }
819
+ if (visited.has(param) || visited.has(element)) {
817
820
  return true;
818
- if (!param || !element)
821
+ }
822
+ visited.add(param);
823
+ visited.add(element);
824
+ const keysParam = Object.keys(param);
825
+ const keysElement = Object.keys(element);
826
+ if (keysParam.length !== keysElement.length) {
819
827
  return false;
820
- for (const prop in param) {
821
- const paramProp = param[prop];
822
- const elementProp = element[prop];
823
- if ((0, import_types.isObjectLike)(paramProp)) {
824
- const isEqual = isEqualDeep2(paramProp, elementProp);
825
- if (!isEqual)
826
- return false;
827
- } else {
828
- const isEqual = paramProp === elementProp;
829
- if (!isEqual)
830
- return false;
828
+ }
829
+ for (const key of keysParam) {
830
+ if (!keysElement.includes(key)) {
831
+ return false;
832
+ }
833
+ const paramProp = param[key];
834
+ const elementProp = element[key];
835
+ if (!isEqualDeep2(paramProp, elementProp, visited)) {
836
+ return false;
831
837
  }
832
838
  }
833
839
  return true;
@@ -871,6 +877,7 @@ var require_function = __commonJS({
871
877
  var function_exports = {};
872
878
  __export2(function_exports, {
873
879
  debounce: () => debounce,
880
+ isStringFunction: () => isStringFunction,
874
881
  memoize: () => memoize2
875
882
  });
876
883
  module2.exports = __toCommonJS2(function_exports);
@@ -896,6 +903,10 @@ var require_function = __commonJS({
896
903
  }
897
904
  };
898
905
  };
906
+ var isStringFunction = (inputString) => {
907
+ const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
908
+ return functionRegex.test(inputString);
909
+ };
899
910
  }
900
911
  });
901
912
 
@@ -4181,7 +4192,11 @@ var require_node2 = __commonJS({
4181
4192
  if (isElement) {
4182
4193
  const { hasDefine, hasContextDefine } = isElement;
4183
4194
  if (element[param] && !hasDefine && !hasContextDefine) {
4184
- (0, import_create.default)((0, import_utils20.exec)(prop, element), element, param, options);
4195
+ const createAsync = () => (0, import_create.default)((0, import_utils20.exec)(prop, element), element, param, options);
4196
+ if (element.props && element.props.lazyLoad || options.lazyLoad) {
4197
+ window.requestAnimationFrame(() => createAsync());
4198
+ } else
4199
+ createAsync();
4185
4200
  }
4186
4201
  }
4187
4202
  }
@@ -4871,7 +4886,7 @@ var require_create4 = __commonJS({
4871
4886
  }
4872
4887
  };
4873
4888
  var createKey = (element, parent, key) => {
4874
- return (key || element.key || (0, import_utils20.generateKey)()).toString();
4889
+ return ((0, import_utils20.exec)(key, element) || key || element.key || (0, import_utils20.generateKey)()).toString();
4875
4890
  };
4876
4891
  var addRef = (element, parent) => {
4877
4892
  if (element.__ref)
@@ -6014,22 +6029,28 @@ var require_cjs9 = __commonJS({
6014
6029
  delete objectized[prop];
6015
6030
  return stack;
6016
6031
  };
6017
- var isEqualDeep2 = (param, element) => {
6018
- if (param === element)
6032
+ var isEqualDeep2 = (param, element, visited = /* @__PURE__ */ new Set()) => {
6033
+ if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
6034
+ return param === element;
6035
+ }
6036
+ if (visited.has(param) || visited.has(element)) {
6019
6037
  return true;
6020
- if (!param || !element)
6038
+ }
6039
+ visited.add(param);
6040
+ visited.add(element);
6041
+ const keysParam = Object.keys(param);
6042
+ const keysElement = Object.keys(element);
6043
+ if (keysParam.length !== keysElement.length) {
6021
6044
  return false;
6022
- for (const prop in param) {
6023
- const paramProp = param[prop];
6024
- const elementProp = element[prop];
6025
- if ((0, import_types.isObjectLike)(paramProp)) {
6026
- const isEqual = isEqualDeep2(paramProp, elementProp);
6027
- if (!isEqual)
6028
- return false;
6029
- } else {
6030
- const isEqual = paramProp === elementProp;
6031
- if (!isEqual)
6032
- return false;
6045
+ }
6046
+ for (const key of keysParam) {
6047
+ if (!keysElement.includes(key)) {
6048
+ return false;
6049
+ }
6050
+ const paramProp = param[key];
6051
+ const elementProp = element[key];
6052
+ if (!isEqualDeep2(paramProp, elementProp, visited)) {
6053
+ return false;
6033
6054
  }
6034
6055
  }
6035
6056
  return true;
@@ -6071,6 +6092,7 @@ var require_cjs9 = __commonJS({
6071
6092
  var function_exports = {};
6072
6093
  __export22(function_exports, {
6073
6094
  debounce: () => debounce,
6095
+ isStringFunction: () => isStringFunction,
6074
6096
  memoize: () => memoize2
6075
6097
  });
6076
6098
  module22.exports = __toCommonJS22(function_exports);
@@ -6096,6 +6118,10 @@ var require_cjs9 = __commonJS({
6096
6118
  }
6097
6119
  };
6098
6120
  };
6121
+ var isStringFunction = (inputString) => {
6122
+ const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
6123
+ return functionRegex.test(inputString);
6124
+ };
6099
6125
  }
6100
6126
  });
6101
6127
  var require_log2 = __commonJS2({
@@ -9897,6 +9923,7 @@ __export(domql_exports, {
9897
9923
  Animation: () => Animation,
9898
9924
  Avatar: () => Avatar,
9899
9925
  AvatarBundle: () => AvatarBundle,
9926
+ AvatarChooser: () => AvatarChooser,
9900
9927
  AvatarIndicator: () => AvatarIndicator,
9901
9928
  BalanceCard: () => BalanceCard,
9902
9929
  Block: () => Block,
@@ -12701,16 +12728,14 @@ var CardLabel = {
12701
12728
  // ../../uikit/domql/Avatar/Avatar.js
12702
12729
  var Avatar = {
12703
12730
  extend: Img,
12704
- props: {
12731
+ props: ({ key, props: props4 }) => ({
12705
12732
  display: "block",
12706
12733
  avatarType: "initials",
12707
12734
  borderRadius: "100%",
12708
12735
  boxSize: "C+X C+X",
12709
- cursor: "pointer"
12710
- },
12711
- attr: {
12712
- src: ({ key, props: props4 }) => props4.src || `https://avatars.dicebear.com/api/${props4.avatarType || "adventurer-neutral"}/${props4.key || key}.svg`
12713
- }
12736
+ cursor: "pointer",
12737
+ src: `https://api.dicebear.com/7.x/${props4.avatarType || "adventurer-neutral"}/svg?seed=${props4.key || key}`
12738
+ })
12714
12739
  };
12715
12740
 
12716
12741
  // ../../uikit/domql/Avatar/AvatarIndicator.js
@@ -12743,6 +12768,60 @@ var AvatarBundle = {
12743
12768
  ...[{}, {}, {}, {}]
12744
12769
  };
12745
12770
 
12771
+ // ../../uikit/domql/Avatar/index.js
12772
+ var AvatarChooser = {
12773
+ extend: Button,
12774
+ tag: "label",
12775
+ props: {
12776
+ round: "C",
12777
+ gap: "Y",
12778
+ padding: "W2 A W2 W2",
12779
+ theme: "tertiary",
12780
+ position: "relative",
12781
+ cursor: "pointer"
12782
+ },
12783
+ Avatar: {
12784
+ props: ({ state }) => ({
12785
+ key: state.key,
12786
+ boxSize: "B1",
12787
+ pointerEvents: "none"
12788
+ })
12789
+ },
12790
+ Select: {
12791
+ props: {
12792
+ outline: "none",
12793
+ pointerEvents: "all",
12794
+ appearance: "none",
12795
+ border: "none",
12796
+ width: "100%",
12797
+ height: "100%",
12798
+ background: "none",
12799
+ color: "currentColor",
12800
+ fontSize: "A",
12801
+ lineHeight: 1,
12802
+ margin: "0 0 0 -B1+X",
12803
+ padding: "0 A 0 B1+X",
12804
+ ":focus-visible": {
12805
+ outline: "none"
12806
+ }
12807
+ },
12808
+ childExtend: { tag: "option" },
12809
+ $setPropsCollection: ({ parent, state }) => {
12810
+ return parent.props.options.map((v) => {
12811
+ if (v.text === state.key)
12812
+ return { ...v, selected: true };
12813
+ return v;
12814
+ });
12815
+ },
12816
+ on: {
12817
+ change: (ev, { state }) => {
12818
+ state.update({ key: ev.target.value });
12819
+ console.log(state.key);
12820
+ }
12821
+ }
12822
+ }
12823
+ };
12824
+
12746
12825
  // ../../uikit/domql/Notification/index.js
12747
12826
  var Notification = {
12748
12827
  extend: Flex,
@@ -15347,7 +15426,7 @@ var transformEmotionStyle = (emotion2) => {
15347
15426
  else
15348
15427
  element.class = { elementStyle: execParams };
15349
15428
  }
15350
- transformEmotionClass(emotion2)(element.class, element, state, true);
15429
+ transformEmotionClass(emotion2)(element.class, element, element.state, true);
15351
15430
  };
15352
15431
  };
15353
15432
  var transformEmotionClass = (emotion2) => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.203",
3
+ "version": "2.11.204",
4
4
  "license": "MIT",
5
- "gitHead": "259e21226f487484b278f3d039164e82bfccc972",
5
+ "gitHead": "dab7f6d84335bca5af356b849c51204910670e76",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"