@assistant-wi/core 0.0.5 → 0.0.7

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.
@@ -1,6 +1,6 @@
1
1
  function a(e, o, t) {
2
2
  const n = {};
3
- return c(n, e, o), l(n, e), s(n, e, t), n;
3
+ return c(n, e, o), s(n, e), l(n, e, t), n;
4
4
  }
5
5
  function c(e, o, t) {
6
6
  for (const n of t)
@@ -11,7 +11,7 @@ function c(e, o, t) {
11
11
  configurable: !1
12
12
  });
13
13
  }
14
- function s(e, o, t) {
14
+ function l(e, o, t) {
15
15
  if (!t) return;
16
16
  const n = t(o);
17
17
  for (const r of Object.keys(n))
@@ -22,7 +22,7 @@ function s(e, o, t) {
22
22
  configurable: !1
23
23
  });
24
24
  }
25
- function l(e, o) {
25
+ function s(e, o) {
26
26
  Object.defineProperty(e, "build", {
27
27
  value: () => o,
28
28
  enumerable: !1,
@@ -30,7 +30,7 @@ function l(e, o) {
30
30
  configurable: !1
31
31
  });
32
32
  }
33
- function i(e) {
33
+ function i(...e) {
34
34
  return a({ type: "block", nodes: e ?? [] }, ["direction", "gap", "nodes"], (t) => ({
35
35
  row() {
36
36
  t.direction = "row";
@@ -43,11 +43,11 @@ function i(e) {
43
43
  }
44
44
  }));
45
45
  }
46
- function d(e) {
47
- return i(e).row();
46
+ function d(...e) {
47
+ return i(...e).row();
48
48
  }
49
- function f(e) {
50
- return i(e).col();
49
+ function f(...e) {
50
+ return i(...e).col();
51
51
  }
52
52
  function b(e) {
53
53
  return a({
@@ -71,11 +71,11 @@ function b(e) {
71
71
  }
72
72
  }));
73
73
  }
74
- function p(e) {
75
- return a(
74
+ function p(...e) {
75
+ return console.log("nodes", e), a(
76
76
  {
77
77
  type: "form",
78
- nodes: e ?? [],
78
+ nodes: e,
79
79
  submitTitle: "Submit"
80
80
  },
81
81
  ["title", "description", "submitTitle", "onSubmit"],
@@ -0,0 +1 @@
1
+ "use strict";function a(t,o,e){const n={};return b(n,t,o),y(n,t),p(n,t,e),n}function b(t,o,e){for(const n of e)Object.defineProperty(t,n,{value:r=>(o[n]=r,t),enumerable:!1,writable:!1,configurable:!1})}function p(t,o,e){if(!e)return;const n=e(o);for(const r of Object.keys(n))Object.defineProperty(t,r,{value:(...f)=>(n[r]?.(...f),t),enumerable:!1,writable:!1,configurable:!1})}function y(t,o){Object.defineProperty(t,"build",{value:()=>o,enumerable:!1,writable:!1,configurable:!1})}function i(...t){return a({type:"block",nodes:t??[]},["direction","gap","nodes"],e=>({row(){e.direction="row"},col(){e.direction="col"},addNode(n){e.nodes.push(n)}}))}function u(...t){return i(...t).row()}function c(...t){return i(...t).col()}function l(t){return a({type:"button",text:t},["text","variant","onClick"],e=>({primary(){e.variant="primary"},secondary(){e.variant="secondary"},outline(){e.variant="outline"},ghost(){e.variant="ghost"},destructive(){e.variant="destructive"}}))}function d(...t){return console.log("nodes",t),a({type:"form",nodes:t,submitTitle:"Submit"},["title","description","submitTitle","onSubmit"],e=>({addNode(n){e.nodes.push(n)}}))}function s(t){return{type:"text",text:t}}const m=Object.freeze(Object.defineProperty({__proto__:null,block:i,button:l,col:c,form:d,row:u,text:s},Symbol.toStringTag,{value:"Module"}));exports.block=i;exports.button=l;exports.col=c;exports.form=d;exports.index=m;exports.row=u;exports.text=s;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DMcbwFzr.cjs"),i=require("./index-Oe1iY2v9.cjs");exports.tool=e.index;exports.ui=i.index;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DMcbwFzr.cjs"),i=require("./index-du_6NCi7.cjs");exports.tool=e.index;exports.ui=i.index;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i } from "./index-BXj6EgSG.js";
2
- import { i as a } from "./index-Dbt2oV4y.js";
2
+ import { i as a } from "./index-CFIfaRxl.js";
3
3
  export {
4
4
  i as tool,
5
5
  a as ui
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index-Oe1iY2v9.cjs");exports.block=o.block;exports.button=o.button;exports.col=o.col;exports.form=o.form;exports.row=o.row;exports.text=o.text;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index-du_6NCi7.cjs");exports.block=o.block;exports.button=o.button;exports.col=o.col;exports.form=o.form;exports.row=o.row;exports.text=o.text;
@@ -1,4 +1,4 @@
1
- import { b as s, a as t, c as r, f as b, r as c, t as f } from "../index-Dbt2oV4y.js";
1
+ import { b as s, a as t, c as r, f as b, r as c, t as f } from "../index-CFIfaRxl.js";
2
2
  export {
3
3
  s as block,
4
4
  t as button,
@@ -5,17 +5,17 @@ export interface UIBlock {
5
5
  direction?: 'row' | 'col' | undefined;
6
6
  gap?: number | undefined;
7
7
  }
8
- export declare function block(nodes?: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
8
+ export declare function block(...nodes: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
9
9
  row(): void;
10
10
  col(): void;
11
11
  addNode(node: UI): void;
12
12
  }>;
13
- export declare function row(nodes?: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
13
+ export declare function row(...nodes: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
14
14
  row(): void;
15
15
  col(): void;
16
16
  addNode(node: UI): void;
17
17
  }>;
18
- export declare function col(nodes?: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
18
+ export declare function col(...nodes: UI[]): import('./builder').Builder<UIBlock, ("direction" | "gap" | "nodes")[], {
19
19
  row(): void;
20
20
  col(): void;
21
21
  addNode(node: UI): void;
@@ -15,6 +15,6 @@ export interface UIFormNode {
15
15
  value?: string;
16
16
  onChange?: (value: string) => void;
17
17
  }
18
- export declare function form(nodes?: UIFormNode[]): import('./builder').Builder<UIForm, ("title" | "description" | "submitTitle" | "onSubmit")[], {
18
+ export declare function form(...nodes: UIFormNode[]): import('./builder').Builder<UIForm, ("title" | "description" | "submitTitle" | "onSubmit")[], {
19
19
  addNode(node: UIFormNode): void;
20
20
  }>;
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@assistant-wi/core",
3
3
  "private": false,
4
- "version": "0.0.5",
5
- "type": "module",
4
+ "version": "0.0.7",
6
5
  "main": "./dist/index.cjs.js",
7
6
  "module": "./dist/index.es.js",
8
7
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- "use strict";function a(t,o,e){const n={};return b(n,t,o),y(n,t),p(n,t,e),n}function b(t,o,e){for(const n of e)Object.defineProperty(t,n,{value:r=>(o[n]=r,t),enumerable:!1,writable:!1,configurable:!1})}function p(t,o,e){if(!e)return;const n=e(o);for(const r of Object.keys(n))Object.defineProperty(t,r,{value:(...f)=>(n[r]?.(...f),t),enumerable:!1,writable:!1,configurable:!1})}function y(t,o){Object.defineProperty(t,"build",{value:()=>o,enumerable:!1,writable:!1,configurable:!1})}function i(t){return a({type:"block",nodes:t??[]},["direction","gap","nodes"],e=>({row(){e.direction="row"},col(){e.direction="col"},addNode(n){e.nodes.push(n)}}))}function u(t){return i(t).row()}function c(t){return i(t).col()}function l(t){return a({type:"button",text:t},["text","variant","onClick"],e=>({primary(){e.variant="primary"},secondary(){e.variant="secondary"},outline(){e.variant="outline"},ghost(){e.variant="ghost"},destructive(){e.variant="destructive"}}))}function d(t){return a({type:"form",nodes:t??[],submitTitle:"Submit"},["title","description","submitTitle","onSubmit"],e=>({addNode(n){e.nodes.push(n)}}))}function s(t){return{type:"text",text:t}}const m=Object.freeze(Object.defineProperty({__proto__:null,block:i,button:l,col:c,form:d,row:u,text:s},Symbol.toStringTag,{value:"Module"}));exports.block=i;exports.button=l;exports.col=c;exports.form=d;exports.index=m;exports.row=u;exports.text=s;