@cleanweb/oore 1.2.0-alpha.7 → 1.2.0-alpha.9

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.
@@ -36,6 +36,9 @@ var getComponentSlotName = function (TargetComponent, child) {
36
36
  var keyTypes = ['string', 'number', 'symbol'];
37
37
  var slotName = child.props['data-slot-name'];
38
38
  if (keyTypes.includes(typeof slotName)) {
39
+ if (typeof child.type === 'string') {
40
+ child.props.tagName = child.type;
41
+ }
39
42
  return slotName;
40
43
  }
41
44
  else
@@ -47,7 +50,6 @@ var getComponentSlotName = function (TargetComponent, child) {
47
50
  exports.getComponentSlotName = getComponentSlotName;
48
51
  var useSlots = function (children, slotComponents, _requiredSlots) {
49
52
  var useMemo = react_1.default.useMemo;
50
- console.log({ slotComponents: slotComponents });
51
53
  var slotsAliasLookup = useMemo(function () {
52
54
  var entries = Object.entries(slotComponents);
53
55
  var aliasLookup = {};
@@ -62,7 +64,6 @@ var useSlots = function (children, slotComponents, _requiredSlots) {
62
64
  });
63
65
  return aliasLookup;
64
66
  }, [slotComponents]);
65
- console.log({ slotsAliasLookup: slotsAliasLookup });
66
67
  var result = useMemo(function () {
67
68
  var slotNodes = {};
68
69
  var unmatchedChildren = [];
@@ -87,7 +88,6 @@ var useSlots = function (children, slotComponents, _requiredSlots) {
87
88
  var slotName = (0, exports.getComponentSlotName)(child.type, child);
88
89
  return slotName ? slotsAliasLookup[slotName] : null;
89
90
  })();
90
- console.log('match:', { key: slotAlias });
91
91
  if (slotAlias && (typeof slotComponents[slotAlias] !== 'string')) {
92
92
  if (slotComponents[slotAlias].isRequiredSlot) {
93
93
  requiredSlots.push(slotAlias);
@@ -98,7 +98,6 @@ var useSlots = function (children, slotComponents, _requiredSlots) {
98
98
  else
99
99
  unmatchedChildren.push(child);
100
100
  });
101
- console.log({ unmatchedChildren: unmatchedChildren, invalidChildren: invalidChildren });
102
101
  requiredSlots.forEach(function (slotAlias) {
103
102
  if (!slotNodes[slotAlias]) {
104
103
  (0, errors_1.throwDevError)("Missing required slot \"".concat(String(slotAlias), "\"."));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "1.2.0-alpha.7",
3
+ "version": "1.2.0-alpha.9",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=20"