@assistant-wi/core 0.0.6 → 0.0.8

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.
@@ -0,0 +1,112 @@
1
+ function a(t, r, e) {
2
+ const n = {};
3
+ return c(n, t, r), l(n, t), s(n, t, e), n;
4
+ }
5
+ function c(t, r, e) {
6
+ for (const n of e)
7
+ Object.defineProperty(t, n, {
8
+ value: (o) => (r[n] = o, t),
9
+ enumerable: !1,
10
+ writable: !1,
11
+ configurable: !1
12
+ });
13
+ }
14
+ function s(t, r, e) {
15
+ if (!e) return;
16
+ const n = e(r);
17
+ for (const o of Object.keys(n))
18
+ Object.defineProperty(t, o, {
19
+ value: (...u) => (n[o]?.(...u), t),
20
+ enumerable: !1,
21
+ writable: !1,
22
+ configurable: !1
23
+ });
24
+ }
25
+ function l(t, r) {
26
+ Object.defineProperty(t, "build", {
27
+ value: () => r,
28
+ enumerable: !1,
29
+ writable: !1,
30
+ configurable: !1
31
+ });
32
+ }
33
+ function i(...t) {
34
+ return a({ type: "block", nodes: t ?? [] }, ["direction", "gap", "nodes"], (e) => ({
35
+ row() {
36
+ e.direction = "row";
37
+ },
38
+ col() {
39
+ e.direction = "col";
40
+ },
41
+ addNode(n) {
42
+ e.nodes.push(n);
43
+ }
44
+ }));
45
+ }
46
+ function d(...t) {
47
+ return i(...t).row();
48
+ }
49
+ function f(...t) {
50
+ return i(...t).col();
51
+ }
52
+ function b(t) {
53
+ return a({
54
+ type: "button",
55
+ text: t
56
+ }, ["text", "variant", "onClick"], (e) => ({
57
+ primary() {
58
+ e.variant = "primary";
59
+ },
60
+ secondary() {
61
+ e.variant = "secondary";
62
+ },
63
+ outline() {
64
+ e.variant = "outline";
65
+ },
66
+ ghost() {
67
+ e.variant = "ghost";
68
+ },
69
+ destructive() {
70
+ e.variant = "destructive";
71
+ }
72
+ }));
73
+ }
74
+ function p(...t) {
75
+ return a(
76
+ {
77
+ type: "form",
78
+ nodes: t,
79
+ submitTitle: "Submit"
80
+ },
81
+ ["title", "description", "submitTitle", "onSubmit"],
82
+ (e) => ({
83
+ addNode(n) {
84
+ e.nodes.push(n);
85
+ }
86
+ })
87
+ );
88
+ }
89
+ function y(t) {
90
+ return {
91
+ type: "text",
92
+ text: t
93
+ };
94
+ }
95
+ const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
96
+ __proto__: null,
97
+ block: i,
98
+ button: b,
99
+ col: f,
100
+ form: p,
101
+ row: d,
102
+ text: y
103
+ }, Symbol.toStringTag, { value: "Module" }));
104
+ export {
105
+ b as a,
106
+ i as b,
107
+ f as c,
108
+ p as f,
109
+ m as i,
110
+ d as r,
111
+ y as t
112
+ };
@@ -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 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.js"),i=require("./index-DjmSSUD0.js");exports.tool=e.index;exports.ui=i.index;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { i } from "./index-BXj6EgSG.js";
2
- import { i as a } from "./index-Dbt2oV4y.js";
1
+ import { i } from "./index-BXj6EgSG.mjs";
2
+ import { i as a } from "./index-Csxo4340.mjs";
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 e=require("../index-DMcbwFzr.cjs");exports.createTool=e.createTool;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DMcbwFzr.js");exports.createTool=e.createTool;
@@ -1,4 +1,4 @@
1
- import { c as r } from "../index-BXj6EgSG.js";
1
+ import { c as r } from "../index-BXj6EgSG.mjs";
2
2
  export {
3
3
  r as createTool
4
4
  };
@@ -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-DjmSSUD0.js");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-Csxo4340.mjs";
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.6",
5
- "type": "module",
4
+ "version": "0.0.8",
6
5
  "main": "./dist/index.cjs.js",
7
6
  "module": "./dist/index.es.js",
8
7
  "types": "./dist/index.d.ts",
@@ -1,112 +0,0 @@
1
- function a(e, o, t) {
2
- const n = {};
3
- return c(n, e, o), l(n, e), s(n, e, t), n;
4
- }
5
- function c(e, o, t) {
6
- for (const n of t)
7
- Object.defineProperty(e, n, {
8
- value: (r) => (o[n] = r, e),
9
- enumerable: !1,
10
- writable: !1,
11
- configurable: !1
12
- });
13
- }
14
- function s(e, o, t) {
15
- if (!t) return;
16
- const n = t(o);
17
- for (const r of Object.keys(n))
18
- Object.defineProperty(e, r, {
19
- value: (...u) => (n[r]?.(...u), e),
20
- enumerable: !1,
21
- writable: !1,
22
- configurable: !1
23
- });
24
- }
25
- function l(e, o) {
26
- Object.defineProperty(e, "build", {
27
- value: () => o,
28
- enumerable: !1,
29
- writable: !1,
30
- configurable: !1
31
- });
32
- }
33
- function i(e) {
34
- return a({ type: "block", nodes: e ?? [] }, ["direction", "gap", "nodes"], (t) => ({
35
- row() {
36
- t.direction = "row";
37
- },
38
- col() {
39
- t.direction = "col";
40
- },
41
- addNode(n) {
42
- t.nodes.push(n);
43
- }
44
- }));
45
- }
46
- function d(e) {
47
- return i(e).row();
48
- }
49
- function f(e) {
50
- return i(e).col();
51
- }
52
- function b(e) {
53
- return a({
54
- type: "button",
55
- text: e
56
- }, ["text", "variant", "onClick"], (t) => ({
57
- primary() {
58
- t.variant = "primary";
59
- },
60
- secondary() {
61
- t.variant = "secondary";
62
- },
63
- outline() {
64
- t.variant = "outline";
65
- },
66
- ghost() {
67
- t.variant = "ghost";
68
- },
69
- destructive() {
70
- t.variant = "destructive";
71
- }
72
- }));
73
- }
74
- function p(e) {
75
- return a(
76
- {
77
- type: "form",
78
- nodes: e ?? [],
79
- submitTitle: "Submit"
80
- },
81
- ["title", "description", "submitTitle", "onSubmit"],
82
- (t) => ({
83
- addNode(n) {
84
- t.nodes.push(n);
85
- }
86
- })
87
- );
88
- }
89
- function y(e) {
90
- return {
91
- type: "text",
92
- text: e
93
- };
94
- }
95
- const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
96
- __proto__: null,
97
- block: i,
98
- button: b,
99
- col: f,
100
- form: p,
101
- row: d,
102
- text: y
103
- }, Symbol.toStringTag, { value: "Module" }));
104
- export {
105
- b as a,
106
- i as b,
107
- f as c,
108
- p as f,
109
- m as i,
110
- d as r,
111
- y as t
112
- };
@@ -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;
File without changes
File without changes