@process.co/ui 0.0.22 → 0.0.23

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.
@@ -26,6 +26,18 @@ interface SlotDragHandleProps {
26
26
  }
27
27
  declare const SlotDragHandle: (props: SlotDragHandleProps) => React.JSX.Element;
28
28
 
29
+ /**
30
+ * Hook to subscribe to the slot enabled and active states by slot id.
31
+ *
32
+ * When used within a DevProvider, uses the dev context's slot enabled state.
33
+ * When used within a production provider, uses the real store.
34
+ * Returns undefined when not inside any provider.
35
+ */
36
+ declare function useSlotContext(slotId: string): {
37
+ active: boolean;
38
+ enabled: boolean;
39
+ } | undefined;
40
+
29
41
  declare const index_ExportManager: typeof ExportManager;
30
42
  type index_ExportManagerProps = ExportManagerProps;
31
43
  declare const index_SlotDelete: typeof SlotDelete;
@@ -36,8 +48,9 @@ declare const index_SlotElements: typeof SlotElements;
36
48
  type index_SlotElementsProps = SlotElementsProps;
37
49
  declare const index_SlotEnable: typeof SlotEnable;
38
50
  type index_SlotEnableProps = SlotEnableProps;
51
+ declare const index_useSlotContext: typeof useSlotContext;
39
52
  declare namespace index {
40
- export { index_ExportManager as ExportManager, type index_ExportManagerProps as ExportManagerProps, index_SlotDelete as SlotDelete, type index_SlotDeleteProps as SlotDeleteProps, index_SlotDragHandle as SlotDragHandle, type index_SlotDragHandleProps as SlotDragHandleProps, index_SlotElements as SlotElements, type index_SlotElementsProps as SlotElementsProps, index_SlotEnable as SlotEnable, type index_SlotEnableProps as SlotEnableProps };
53
+ export { index_ExportManager as ExportManager, type index_ExportManagerProps as ExportManagerProps, index_SlotDelete as SlotDelete, type index_SlotDeleteProps as SlotDeleteProps, index_SlotDragHandle as SlotDragHandle, type index_SlotDragHandleProps as SlotDragHandleProps, index_SlotElements as SlotElements, type index_SlotElementsProps as SlotElementsProps, index_SlotEnable as SlotEnable, type index_SlotEnableProps as SlotEnableProps, index_useSlotContext as useSlotContext };
41
54
  }
42
55
 
43
- export { ExportManager as E, SlotElements as S, type SlotElementsProps as a, type ExportManagerProps as b, SlotEnable as c, type SlotEnableProps as d, SlotDelete as e, type SlotDeleteProps as f, SlotDragHandle as g, type SlotDragHandleProps as h, index as i };
56
+ export { ExportManager as E, SlotElements as S, type SlotElementsProps as a, type ExportManagerProps as b, SlotEnable as c, type SlotEnableProps as d, SlotDelete as e, type SlotDeleteProps as f, SlotDragHandle as g, type SlotDragHandleProps as h, index as i, useSlotContext as u };
@@ -26,6 +26,18 @@ interface SlotDragHandleProps {
26
26
  }
27
27
  declare const SlotDragHandle: (props: SlotDragHandleProps) => React.JSX.Element;
28
28
 
29
+ /**
30
+ * Hook to subscribe to the slot enabled and active states by slot id.
31
+ *
32
+ * When used within a DevProvider, uses the dev context's slot enabled state.
33
+ * When used within a production provider, uses the real store.
34
+ * Returns undefined when not inside any provider.
35
+ */
36
+ declare function useSlotContext(slotId: string): {
37
+ active: boolean;
38
+ enabled: boolean;
39
+ } | undefined;
40
+
29
41
  declare const index_ExportManager: typeof ExportManager;
30
42
  type index_ExportManagerProps = ExportManagerProps;
31
43
  declare const index_SlotDelete: typeof SlotDelete;
@@ -36,8 +48,9 @@ declare const index_SlotElements: typeof SlotElements;
36
48
  type index_SlotElementsProps = SlotElementsProps;
37
49
  declare const index_SlotEnable: typeof SlotEnable;
38
50
  type index_SlotEnableProps = SlotEnableProps;
51
+ declare const index_useSlotContext: typeof useSlotContext;
39
52
  declare namespace index {
40
- export { index_ExportManager as ExportManager, type index_ExportManagerProps as ExportManagerProps, index_SlotDelete as SlotDelete, type index_SlotDeleteProps as SlotDeleteProps, index_SlotDragHandle as SlotDragHandle, type index_SlotDragHandleProps as SlotDragHandleProps, index_SlotElements as SlotElements, type index_SlotElementsProps as SlotElementsProps, index_SlotEnable as SlotEnable, type index_SlotEnableProps as SlotEnableProps };
53
+ export { index_ExportManager as ExportManager, type index_ExportManagerProps as ExportManagerProps, index_SlotDelete as SlotDelete, type index_SlotDeleteProps as SlotDeleteProps, index_SlotDragHandle as SlotDragHandle, type index_SlotDragHandleProps as SlotDragHandleProps, index_SlotElements as SlotElements, type index_SlotElementsProps as SlotElementsProps, index_SlotEnable as SlotEnable, type index_SlotEnableProps as SlotEnableProps, index_useSlotContext as useSlotContext };
41
54
  }
42
55
 
43
- export { ExportManager as E, SlotElements as S, type SlotElementsProps as a, type ExportManagerProps as b, SlotEnable as c, type SlotEnableProps as d, SlotDelete as e, type SlotDeleteProps as f, SlotDragHandle as g, type SlotDragHandleProps as h, index as i };
56
+ export { ExportManager as E, SlotElements as S, type SlotElementsProps as a, type ExportManagerProps as b, SlotEnable as c, type SlotEnableProps as d, SlotDelete as e, type SlotDeleteProps as f, SlotDragHandle as g, type SlotDragHandleProps as h, index as i, useSlotContext as u };
package/dist/index.cjs CHANGED
@@ -11977,7 +11977,8 @@ __export(slots_exports, {
11977
11977
  SlotDelete: () => SlotDelete,
11978
11978
  SlotDragHandle: () => SlotDragHandle,
11979
11979
  SlotElements: () => SlotElements,
11980
- SlotEnable: () => SlotEnable
11980
+ SlotEnable: () => SlotEnable,
11981
+ useSlotContext: () => useSlotContext
11981
11982
  });
11982
11983
 
11983
11984
  // src/components/slots/SlotElements.tsx
@@ -15388,6 +15389,18 @@ var SlotDragHandle = (props) => {
15388
15389
  const { slotId } = props;
15389
15390
  return /* @__PURE__ */ React.createElement("div", { className: "uii:cursor-grab" }, /* @__PURE__ */ React.createElement(FontAwesomeIcon, { icon: faGripVertical }));
15390
15391
  };
15392
+
15393
+ // src/components/slots/index.tsx
15394
+ function useSlotContext(slotId) {
15395
+ const devContext = React45.useContext(DevContext);
15396
+ const [activeSlotId, setActiveSlotId] = React45.useState(void 0);
15397
+ React45.useEffect(() => {
15398
+ if (devContext) {
15399
+ setActiveSlotId(devContext.activeSlotId ?? void 0);
15400
+ }
15401
+ }, [devContext, slotId]);
15402
+ return { active: (activeSlotId ?? "") === slotId, enabled: true };
15403
+ }
15391
15404
  /*! Bundled license information:
15392
15405
 
15393
15406
  react-is/cjs/react-is.production.min.js: