@cleanweb/oore 2.0.0-beta.0 → 2.0.0-beta.3

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.
@@ -77,7 +77,7 @@ exports.getComponentSlotName = getComponentSlotName;
77
77
  */
78
78
  var useSlots = function (children, Caller) {
79
79
  var slotsAliasLookup = (0, react_1.useMemo)(function () {
80
- var entries = Object.entries(Caller.slots);
80
+ var entries = Object.entries(Caller.Slots);
81
81
  var aliasLookup = {};
82
82
  entries.forEach(function (_a) {
83
83
  var alias = _a[0], RegisteredSlotComponent = _a[1];
@@ -89,7 +89,7 @@ var useSlots = function (children, Caller) {
89
89
  aliasLookup[slotName] = alias;
90
90
  });
91
91
  return aliasLookup;
92
- }, [Caller.slots]);
92
+ }, [Caller.Slots]);
93
93
  var result = (0, react_1.useMemo)(function () {
94
94
  var _a;
95
95
  var slotNodes = {};
@@ -117,8 +117,8 @@ var useSlots = function (children, Caller) {
117
117
  var slotName = (0, exports.getComponentSlotName)(child.type, child);
118
118
  return slotName ? slotsAliasLookup[slotName] : null;
119
119
  })();
120
- if (slotAlias && (typeof Caller.slots[slotAlias] !== 'string')) {
121
- if ((_a = Caller.slots[slotAlias]) === null || _a === void 0 ? void 0 : _a.isRequiredSlot) {
120
+ if (slotAlias && (typeof Caller.Slots[slotAlias] !== 'string')) {
121
+ if ((_a = Caller.Slots[slotAlias]) === null || _a === void 0 ? void 0 : _a.isRequiredSlot) {
122
122
  requiredSlotAliases.push(slotAlias);
123
123
  }
124
124
  }
@@ -82,7 +82,7 @@ export type SlotComponent<TComponentArg extends TComponent = TComponent> = (Slot
82
82
  * through an alias that is easy to remember.
83
83
  */
84
84
  export type Slotted<TComponentArg extends object = TComponent, TSlotAliasArg extends TSlotAlias = TSlotAlias, TSlotsRecordArg extends TSlotsRecord<TSlotAliasArg> = TSlotsRecord<TSlotAliasArg>> = TComponentArg & {
85
- slots: TSlotsRecordArg;
85
+ Slots: TSlotsRecordArg;
86
86
  requiredSlotAliases?: TSlotAliasArg[];
87
87
  };
88
88
  /**
@@ -118,6 +118,6 @@ export interface IUseSlots {
118
118
  * The nodes it contains will be categorized and
119
119
  * grouped according to the predefined {@link slotComponents}.
120
120
  */
121
- children: ReactNode, Caller: Slotted): TUseSlotsResult<TSlotAliasArg>;
121
+ children: ReactNode, Caller: Slotted<TComponent, TSlotAliasArg, TSlotsRecord<TSlotAliasArg>>): TUseSlotsResult<TSlotAliasArg>;
122
122
  }
123
123
  export type PotentialSlotComponent = string | SlotComponent | TComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=22"