plug-code 1.1.2 → 1.1.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.
package/README.md CHANGED
@@ -41,7 +41,7 @@ import { createPlugAndCode } from 'plug-code';
41
41
  export const { useSystemPlc, SystemPlcRoot } = createPlugAndCode((api) => {
42
42
 
43
43
  // Define a Sales Feature
44
- api.feature("sales", (api) => {
44
+ api.createFuture("sales", (api) => {
45
45
  // Register a UI component into a slot
46
46
  api.register("header.cart", () => <CartIcon />);
47
47
 
@@ -53,7 +53,7 @@ export const { useSystemPlc, SystemPlcRoot } = createPlugAndCode((api) => {
53
53
  });
54
54
 
55
55
  // Define a Logger Feature that wraps existing logic
56
- api.feature("logger", (api) => {
56
+ api.createFuture("logger", (api) => {
57
57
  api.wrapCommand("sales.checkout", (next) => async (items) => {
58
58
  console.log("Checkout started...");
59
59
  const result = await next(items);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plug-code",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "src/plug-code.tsx",
6
6
  "types": "types/plug-code.d.ts",
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  // Tipos Generales
5
5
  // ==========================================
6
6
 
7
- export type ObjectType = Record<string, any>;
7
+ export declare type ObjectType = Record<string, any>;
8
8
 
9
9
  export type Slot = () => React.ReactNode;
10
10
 
@@ -52,7 +52,7 @@ export declare class PlcAPI<S extends ObjectType> {
52
52
  * @param name Identificador único para debugging y prevención de duplicados.
53
53
  * @param setupFn Función de configuración donde registras slots, comandos, etc.
54
54
  */
55
- feature(name: string, setupFn: (api: PlcAPI<S>) => void): PlcAPI<S>;
55
+ createFuture(name: string, setupFn: (api: PlcAPI<S>) => void): PlcAPI<S>;
56
56
 
57
57
  // --- Gestión de UI (Slots & Rendering) ---
58
58