@mrts/soltw 0.3.23 → 0.3.25

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.
Files changed (3) hide show
  1. package/dist/index.js +18 -450
  2. package/dist/index.jsx +23 -778
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -44,8 +44,6 @@ function nextHydrateContext() {
44
44
  };
45
45
  }
46
46
  const equalFn = (a, b) => a === b;
47
- const $PROXY = Symbol("solid-proxy");
48
- const SUPPORTS_PROXY = typeof Proxy === "function";
49
47
  const $TRACK = Symbol("solid-track");
50
48
  const signalOptions = { equals: equalFn };
51
49
  let ERROR = null;
@@ -630,78 +628,6 @@ function createComponent(Comp, props) {
630
628
  }
631
629
  return untrack(() => Comp(props || {}));
632
630
  }
633
- function trueFn() {
634
- return true;
635
- }
636
- const propTraps = {
637
- get(_, property, receiver) {
638
- if (property === $PROXY) return receiver;
639
- return _.get(property);
640
- },
641
- has(_, property) {
642
- if (property === $PROXY) return true;
643
- return _.has(property);
644
- },
645
- set: trueFn,
646
- deleteProperty: trueFn,
647
- getOwnPropertyDescriptor(_, property) {
648
- return {
649
- configurable: true,
650
- enumerable: true,
651
- get() {
652
- return _.get(property);
653
- },
654
- set: trueFn,
655
- deleteProperty: trueFn
656
- };
657
- },
658
- ownKeys(_) {
659
- return _.keys();
660
- }
661
- };
662
- function splitProps(props, ...keys) {
663
- const len = keys.length;
664
- if (SUPPORTS_PROXY && $PROXY in props) {
665
- const blocked = len > 1 ? keys.flat() : keys[0];
666
- const res = keys.map((k) => {
667
- return new Proxy({
668
- get(property) {
669
- return k.includes(property) ? props[property] : void 0;
670
- },
671
- has(property) {
672
- return k.includes(property) && property in props;
673
- },
674
- keys() {
675
- return k.filter((property) => property in props);
676
- }
677
- }, propTraps);
678
- });
679
- res.push(new Proxy({
680
- get(property) {
681
- return blocked.includes(property) ? void 0 : props[property];
682
- },
683
- has(property) {
684
- return blocked.includes(property) ? false : property in props;
685
- },
686
- keys() {
687
- return Object.keys(props).filter((k) => !blocked.includes(k));
688
- }
689
- }, propTraps));
690
- return res;
691
- }
692
- const objects = [];
693
- for (let i = 0; i <= len; i++) objects[i] = {};
694
- for (const propName of Object.getOwnPropertyNames(props)) {
695
- let keyIndex = len;
696
- for (let i = 0; i < keys.length; i++) if (keys[i].includes(propName)) {
697
- keyIndex = i;
698
- break;
699
- }
700
- const desc = Object.getOwnPropertyDescriptor(props, propName);
701
- !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable ? objects[keyIndex][propName] = desc.value : Object.defineProperty(objects[keyIndex], propName, desc);
702
- }
703
- return objects;
704
- }
705
631
  const narrowedError = (name) => `Stale read from <${name}>.`;
706
632
  function For(props) {
707
633
  const fallback = "fallback" in props && { fallback: () => props.fallback };
@@ -726,79 +652,6 @@ function Show(props) {
726
652
 
727
653
  //#endregion
728
654
  //#region ../../node_modules/solid-js/web/dist/web.js
729
- const Properties = /* @__PURE__ */ new Set([
730
- "className",
731
- "value",
732
- "readOnly",
733
- "noValidate",
734
- "formNoValidate",
735
- "isMap",
736
- "noModule",
737
- "playsInline",
738
- "adAuctionHeaders",
739
- "allowFullscreen",
740
- "browsingTopics",
741
- "defaultChecked",
742
- "defaultMuted",
743
- "defaultSelected",
744
- "disablePictureInPicture",
745
- "disableRemotePlayback",
746
- "preservesPitch",
747
- "shadowRootClonable",
748
- "shadowRootCustomElementRegistry",
749
- "shadowRootDelegatesFocus",
750
- "shadowRootSerializable",
751
- "sharedStorageWritable",
752
- ...[
753
- "allowfullscreen",
754
- "async",
755
- "alpha",
756
- "autofocus",
757
- "autoplay",
758
- "checked",
759
- "controls",
760
- "default",
761
- "disabled",
762
- "formnovalidate",
763
- "hidden",
764
- "indeterminate",
765
- "inert",
766
- "ismap",
767
- "loop",
768
- "multiple",
769
- "muted",
770
- "nomodule",
771
- "novalidate",
772
- "open",
773
- "playsinline",
774
- "readonly",
775
- "required",
776
- "reversed",
777
- "seamless",
778
- "selected",
779
- "adauctionheaders",
780
- "browsingtopics",
781
- "credentialless",
782
- "defaultchecked",
783
- "defaultmuted",
784
- "defaultselected",
785
- "defer",
786
- "disablepictureinpicture",
787
- "disableremoteplayback",
788
- "preservespitch",
789
- "shadowrootclonable",
790
- "shadowrootcustomelementregistry",
791
- "shadowrootdelegatesfocus",
792
- "shadowrootserializable",
793
- "sharedstoragewritable"
794
- ]
795
- ]);
796
- const ChildProperties = /* @__PURE__ */ new Set([
797
- "innerHTML",
798
- "textContent",
799
- "innerText",
800
- "children"
801
- ]);
802
655
  const Aliases = /* @__PURE__ */ Object.assign(Object.create(null), {
803
656
  className: "class",
804
657
  htmlFor: "for"
@@ -888,117 +741,6 @@ const PropAliases = /* @__PURE__ */ Object.assign(Object.create(null), {
888
741
  IMG: 1
889
742
  }
890
743
  });
891
- function getPropAlias(prop, tagName) {
892
- const a = PropAliases[prop];
893
- return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
894
- }
895
- const DelegatedEvents = /* @__PURE__ */ new Set([
896
- "beforeinput",
897
- "click",
898
- "dblclick",
899
- "contextmenu",
900
- "focusin",
901
- "focusout",
902
- "input",
903
- "keydown",
904
- "keyup",
905
- "mousedown",
906
- "mousemove",
907
- "mouseout",
908
- "mouseover",
909
- "mouseup",
910
- "pointerdown",
911
- "pointermove",
912
- "pointerout",
913
- "pointerover",
914
- "pointerup",
915
- "touchend",
916
- "touchmove",
917
- "touchstart"
918
- ]);
919
- const SVGElements = /* @__PURE__ */ new Set([
920
- "altGlyph",
921
- "altGlyphDef",
922
- "altGlyphItem",
923
- "animate",
924
- "animateColor",
925
- "animateMotion",
926
- "animateTransform",
927
- "circle",
928
- "clipPath",
929
- "color-profile",
930
- "cursor",
931
- "defs",
932
- "desc",
933
- "ellipse",
934
- "feBlend",
935
- "feColorMatrix",
936
- "feComponentTransfer",
937
- "feComposite",
938
- "feConvolveMatrix",
939
- "feDiffuseLighting",
940
- "feDisplacementMap",
941
- "feDistantLight",
942
- "feDropShadow",
943
- "feFlood",
944
- "feFuncA",
945
- "feFuncB",
946
- "feFuncG",
947
- "feFuncR",
948
- "feGaussianBlur",
949
- "feImage",
950
- "feMerge",
951
- "feMergeNode",
952
- "feMorphology",
953
- "feOffset",
954
- "fePointLight",
955
- "feSpecularLighting",
956
- "feSpotLight",
957
- "feTile",
958
- "feTurbulence",
959
- "filter",
960
- "font",
961
- "font-face",
962
- "font-face-format",
963
- "font-face-name",
964
- "font-face-src",
965
- "font-face-uri",
966
- "foreignObject",
967
- "g",
968
- "glyph",
969
- "glyphRef",
970
- "hkern",
971
- "image",
972
- "line",
973
- "linearGradient",
974
- "marker",
975
- "mask",
976
- "metadata",
977
- "missing-glyph",
978
- "mpath",
979
- "path",
980
- "pattern",
981
- "polygon",
982
- "polyline",
983
- "radialGradient",
984
- "rect",
985
- "set",
986
- "stop",
987
- "svg",
988
- "switch",
989
- "symbol",
990
- "text",
991
- "textPath",
992
- "tref",
993
- "tspan",
994
- "use",
995
- "view",
996
- "vkern"
997
- ]);
998
- const SVGNamespace = {
999
- xlink: "http://www.w3.org/1999/xlink",
1000
- xml: "http://www.w3.org/XML/1998/namespace"
1001
- };
1002
744
  function reconcileArrays(parentNode, a, b) {
1003
745
  let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
1004
746
  while (aStart < aEnd || bStart < bEnd) {
@@ -1067,163 +809,19 @@ function delegateEvents(eventNames, document$1 = window.document) {
1067
809
  }
1068
810
  }
1069
811
  }
1070
- function setAttribute(node, name, value) {
1071
- if (isHydrating(node)) return;
1072
- if (value == null) node.removeAttribute(name);
1073
- else node.setAttribute(name, value);
1074
- }
1075
- function setAttributeNS(node, namespace, name, value) {
1076
- if (isHydrating(node)) return;
1077
- if (value == null) node.removeAttributeNS(namespace, name);
1078
- else node.setAttributeNS(namespace, name, value);
1079
- }
1080
- function setBoolAttribute(node, name, value) {
1081
- if (isHydrating(node)) return;
1082
- value ? node.setAttribute(name, "") : node.removeAttribute(name);
1083
- }
1084
812
  function className(node, value) {
1085
813
  if (isHydrating(node)) return;
1086
814
  if (value == null) node.removeAttribute("class");
1087
815
  else node.className = value;
1088
816
  }
1089
- function addEventListener(node, name, handler, delegate) {
1090
- if (delegate) if (Array.isArray(handler)) {
1091
- node[`$$${name}`] = handler[0];
1092
- node[`$$${name}Data`] = handler[1];
1093
- } else node[`$$${name}`] = handler;
1094
- else if (Array.isArray(handler)) {
1095
- const handlerFn = handler[0];
1096
- node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
1097
- } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
1098
- }
1099
- function classList(node, value, prev = {}) {
1100
- const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
1101
- let i, len;
1102
- for (i = 0, len = prevKeys.length; i < len; i++) {
1103
- const key = prevKeys[i];
1104
- if (!key || key === "undefined" || value[key]) continue;
1105
- toggleClassKey(node, key, false);
1106
- delete prev[key];
1107
- }
1108
- for (i = 0, len = classKeys.length; i < len; i++) {
1109
- const key = classKeys[i], classValue = !!value[key];
1110
- if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
1111
- toggleClassKey(node, key, true);
1112
- prev[key] = classValue;
1113
- }
1114
- return prev;
1115
- }
1116
- function style(node, value, prev) {
1117
- if (!value) return prev ? setAttribute(node, "style") : value;
1118
- const nodeStyle = node.style;
1119
- if (typeof value === "string") return nodeStyle.cssText = value;
1120
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
1121
- prev || (prev = {});
1122
- value || (value = {});
1123
- let v, s;
1124
- for (s in prev) {
1125
- value[s] ?? nodeStyle.removeProperty(s);
1126
- delete prev[s];
1127
- }
1128
- for (s in value) {
1129
- v = value[s];
1130
- if (v !== prev[s]) {
1131
- nodeStyle.setProperty(s, v);
1132
- prev[s] = v;
1133
- }
1134
- }
1135
- return prev;
1136
- }
1137
- function spread(node, props = {}, isSVG, skipChildren) {
1138
- const prevProps = {};
1139
- if (!skipChildren) createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
1140
- createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
1141
- createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
1142
- return prevProps;
1143
- }
1144
- function use(fn, element, arg) {
1145
- return untrack(() => fn(element, arg));
1146
- }
1147
817
  function insert(parent, accessor, marker, initial) {
1148
818
  if (marker !== void 0 && !initial) initial = [];
1149
819
  if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
1150
820
  createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
1151
821
  }
1152
- function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
1153
- props || (props = {});
1154
- for (const prop in prevProps) if (!(prop in props)) {
1155
- if (prop === "children") continue;
1156
- prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
1157
- }
1158
- for (const prop in props) {
1159
- if (prop === "children") {
1160
- if (!skipChildren) insertExpression(node, props.children);
1161
- continue;
1162
- }
1163
- const value = props[prop];
1164
- prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
1165
- }
1166
- }
1167
- function getNextElement(template$1) {
1168
- let node, key;
1169
- if (!isHydrating() || !(node = sharedConfig.registry.get(key = getHydrationKey()))) return template$1();
1170
- if (sharedConfig.completed) sharedConfig.completed.add(node);
1171
- sharedConfig.registry.delete(key);
1172
- return node;
1173
- }
1174
822
  function isHydrating(node) {
1175
823
  return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);
1176
824
  }
1177
- function toPropertyName(name) {
1178
- return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
1179
- }
1180
- function toggleClassKey(node, key, value) {
1181
- const classNames = key.trim().split(/\s+/);
1182
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
1183
- }
1184
- function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
1185
- let isCE, isProp, isChildProp, propAlias, forceProp;
1186
- if (prop === "style") return style(node, value, prev);
1187
- if (prop === "classList") return classList(node, value, prev);
1188
- if (value === prev) return prev;
1189
- if (prop === "ref") {
1190
- if (!skipRef) value(node);
1191
- } else if (prop.slice(0, 3) === "on:") {
1192
- const e = prop.slice(3);
1193
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
1194
- value && node.addEventListener(e, value, typeof value !== "function" && value);
1195
- } else if (prop.slice(0, 10) === "oncapture:") {
1196
- const e = prop.slice(10);
1197
- prev && node.removeEventListener(e, prev, true);
1198
- value && node.addEventListener(e, value, true);
1199
- } else if (prop.slice(0, 2) === "on") {
1200
- const name = prop.slice(2).toLowerCase();
1201
- const delegate = DelegatedEvents.has(name);
1202
- if (!delegate && prev) {
1203
- const h = Array.isArray(prev) ? prev[0] : prev;
1204
- node.removeEventListener(name, h);
1205
- }
1206
- if (delegate || value) {
1207
- addEventListener(node, name, value, delegate);
1208
- delegate && delegateEvents([name]);
1209
- }
1210
- } else if (prop.slice(0, 5) === "attr:") setAttribute(node, prop.slice(5), value);
1211
- else if (prop.slice(0, 5) === "bool:") setBoolAttribute(node, prop.slice(5), value);
1212
- else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
1213
- if (forceProp) {
1214
- prop = prop.slice(5);
1215
- isProp = true;
1216
- } else if (isHydrating(node)) return value;
1217
- if (prop === "class" || prop === "className") className(node, value);
1218
- else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
1219
- else node[propAlias || prop] = value;
1220
- } else {
1221
- const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
1222
- if (ns) setAttributeNS(node, ns, prop, value);
1223
- else setAttribute(node, Aliases[prop] || prop, value);
1224
- }
1225
- return value;
1226
- }
1227
825
  function eventHandler(e) {
1228
826
  if (sharedConfig.registry && sharedConfig.events) {
1229
827
  if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
@@ -1389,31 +987,6 @@ function cleanChildren(parent, current, marker, replacement) {
1389
987
  } else parent.insertBefore(node, marker);
1390
988
  return [node];
1391
989
  }
1392
- function getHydrationKey() {
1393
- return sharedConfig.getNextContextId();
1394
- }
1395
- const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1396
- function createElement(tagName, isSVG = false, is = void 0) {
1397
- return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, { is });
1398
- }
1399
- function createDynamic(component, props) {
1400
- const cached = createMemo(component);
1401
- return createMemo(() => {
1402
- const component$1 = cached();
1403
- switch (typeof component$1) {
1404
- case "function": return untrack(() => component$1(props));
1405
- case "string":
1406
- const isSvg = SVGElements.has(component$1);
1407
- const el = sharedConfig.context ? getNextElement() : createElement(component$1, isSvg, untrack(() => props.is));
1408
- spread(el, props, isSvg);
1409
- return el;
1410
- }
1411
- });
1412
- }
1413
- function Dynamic(props) {
1414
- const [, others] = splitProps(props, ["component"]);
1415
- return createDynamic(() => props.component, others);
1416
- }
1417
990
 
1418
991
  //#endregion
1419
992
  //#region ../../node_modules/tailwind-merge/dist/bundle-mjs.mjs
@@ -1702,7 +1275,7 @@ const createConfigUtils = (config) => ({
1702
1275
  ...createClassGroupUtils(config)
1703
1276
  });
1704
1277
  const SPLIT_CLASSES_REGEX = /\s+/;
1705
- const mergeClassList = (classList$1, configUtils) => {
1278
+ const mergeClassList = (classList, configUtils) => {
1706
1279
  const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
1707
1280
  /**
1708
1281
  * Set of classGroupIds in following format:
@@ -1712,7 +1285,7 @@ const mergeClassList = (classList$1, configUtils) => {
1712
1285
  * @example 'md:!pr'
1713
1286
  */
1714
1287
  const classGroupsInConflict = [];
1715
- const classNames = classList$1.trim().split(SPLIT_CLASSES_REGEX);
1288
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
1716
1289
  let result = "";
1717
1290
  for (let index = classNames.length - 1; index >= 0; index -= 1) {
1718
1291
  const originalClassName = classNames[index];
@@ -1788,18 +1361,18 @@ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
1788
1361
  let cacheGet;
1789
1362
  let cacheSet;
1790
1363
  let functionToCall;
1791
- const initTailwindMerge = (classList$1) => {
1364
+ const initTailwindMerge = (classList) => {
1792
1365
  configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
1793
1366
  cacheGet = configUtils.cache.get;
1794
1367
  cacheSet = configUtils.cache.set;
1795
1368
  functionToCall = tailwindMerge;
1796
- return tailwindMerge(classList$1);
1369
+ return tailwindMerge(classList);
1797
1370
  };
1798
- const tailwindMerge = (classList$1) => {
1799
- const cachedResult = cacheGet(classList$1);
1371
+ const tailwindMerge = (classList) => {
1372
+ const cachedResult = cacheGet(classList);
1800
1373
  if (cachedResult) return cachedResult;
1801
- const result = mergeClassList(classList$1, configUtils);
1802
- cacheSet(classList$1, result);
1374
+ const result = mergeClassList(classList, configUtils);
1375
+ cacheSet(classList, result);
1803
1376
  return result;
1804
1377
  };
1805
1378
  functionToCall = initTailwindMerge;
@@ -3543,7 +3116,7 @@ var Stylers = class {
3543
3116
 
3544
3117
  //#endregion
3545
3118
  //#region src/items/Item.tsx
3546
- var _tmpl$$1 = /* @__PURE__ */ template(`<div>`);
3119
+ var _tmpl$$2 = /* @__PURE__ */ template(`<div>`);
3547
3120
  const Item = (props) => {
3548
3121
  const itemData = () => {
3549
3122
  const r = buildIdLabel(props.idLabel);
@@ -3591,7 +3164,7 @@ const Item = (props) => {
3591
3164
  if (props.callback != void 0) props.callback(itemData());
3592
3165
  }
3593
3166
  return (() => {
3594
- var _el$ = _tmpl$$1();
3167
+ var _el$ = _tmpl$$2();
3595
3168
  _el$.$$click = handleClick;
3596
3169
  insert(_el$, () => itemData().label, null);
3597
3170
  insert(_el$, createComponent(Show, {
@@ -3599,7 +3172,7 @@ const Item = (props) => {
3599
3172
  return props.disabled;
3600
3173
  },
3601
3174
  get children() {
3602
- var _el$2 = _tmpl$$1();
3175
+ var _el$2 = _tmpl$$2();
3603
3176
  _el$2.$$click = (e) => {
3604
3177
  if (!props.clickableWhendisabled) e.stopPropagation();
3605
3178
  };
@@ -3615,8 +3188,8 @@ delegateEvents(["click"]);
3615
3188
 
3616
3189
  //#endregion
3617
3190
  //#region src/Block.tsx
3191
+ var _tmpl$$1 = /* @__PURE__ */ template(`<div>`);
3618
3192
  const Block = (props) => {
3619
- const elementTag = () => props.element ?? "div";
3620
3193
  const currentStyler = () => {
3621
3194
  if (props.styler) return props.styler;
3622
3195
  else return Stylers.base;
@@ -3626,17 +3199,12 @@ const Block = (props) => {
3626
3199
  if (props.class) classes.push(props.class);
3627
3200
  return twMerge(classes);
3628
3201
  }
3629
- return createComponent(Dynamic, {
3630
- get component() {
3631
- return elementTag();
3632
- },
3633
- get ["class"]() {
3634
- return blockClasses();
3635
- },
3636
- get children() {
3637
- return props.children;
3638
- }
3639
- });
3202
+ return (() => {
3203
+ var _el$ = _tmpl$$1();
3204
+ insert(_el$, () => props.children);
3205
+ createRenderEffect(() => className(_el$, blockClasses()));
3206
+ return _el$;
3207
+ })();
3640
3208
  };
3641
3209
 
3642
3210
  //#endregion