@assistant-wi/core 0.0.10 → 0.0.11

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.
@@ -30,7 +30,7 @@ function p(t, n) {
30
30
  configurable: !1
31
31
  });
32
32
  }
33
- function u(...t) {
33
+ function c(...t) {
34
34
  return i(
35
35
  {
36
36
  type: "block",
@@ -54,10 +54,10 @@ function u(...t) {
54
54
  );
55
55
  }
56
56
  function b(...t) {
57
- return u(...t).row();
57
+ return c(...t).row();
58
58
  }
59
59
  function g(...t) {
60
- return u(...t).col();
60
+ return c(...t).col();
61
61
  }
62
62
  function y(t) {
63
63
  return i({
@@ -105,13 +105,13 @@ function v(t) {
105
105
  const r = Math.max(1, Math.floor(o || 0)), s = Math.ceil(a.length / r);
106
106
  e.totalPages = s, e.pagination = (l) => {
107
107
  if (s === 0) return { items: [], hasMore: !1 };
108
- const d = Math.max(1, Math.floor(l || 0)), c = Math.min(d, s);
108
+ const d = Math.max(1, Math.floor(l || 0)), u = Math.min(d, s);
109
109
  return {
110
110
  items: a.slice(
111
- (c - 1) * r,
112
- c * r
111
+ (u - 1) * r,
112
+ u * r
113
113
  ),
114
- hasMore: c < s
114
+ hasMore: u < s
115
115
  };
116
116
  };
117
117
  }
@@ -122,7 +122,7 @@ function w(t) {
122
122
  {
123
123
  type: "text",
124
124
  text: t,
125
- animation: "none",
125
+ animation: null,
126
126
  color: "primary",
127
127
  weight: "normal",
128
128
  size: "md"
@@ -146,7 +146,7 @@ function w(t) {
146
146
  }
147
147
  const P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
148
148
  __proto__: null,
149
- block: u,
149
+ block: c,
150
150
  button: y,
151
151
  col: g,
152
152
  form: h,
@@ -156,7 +156,7 @@ const P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
156
156
  }, Symbol.toStringTag, { value: "Module" }));
157
157
  export {
158
158
  y as a,
159
- u as b,
159
+ c as b,
160
160
  g as c,
161
161
  h as f,
162
162
  P as i,
@@ -0,0 +1 @@
1
+ "use strict";function i(t,a,e){const n={};return h(n,t,a),w(n,t),v(n,t,e),n}function h(t,a,e){for(const n of e)Object.defineProperty(t,n,{value:o=>(a[n]=o,t),enumerable:!1,writable:!1,configurable:!1})}function v(t,a,e){if(!e)return;const n=e(a);for(const o of Object.keys(n))Object.defineProperty(t,o,{value:(...r)=>(n[o]?.(...r),t),enumerable:!1,writable:!1,configurable:!1})}function w(t,a){Object.defineProperty(t,"build",{value:()=>a,enumerable:!1,writable:!1,configurable:!1})}function c(...t){return i({type:"block",nodes:t,width:"auto",align:"start",justify:"start"},["direction","gap","nodes","width","align","justify"],e=>({row(){e.direction="row"},col(){e.direction="col"},addNode(n){e.nodes.push(n)}}))}function l(...t){return c(...t).row()}function d(...t){return c(...t).col()}function f(t){return i({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 m(...t){return i({type:"form",nodes:t,submitTitle:"Submit"},["title","description","submitTitle","onSubmit","nodes"],e=>({addNode(n){e.nodes.push(n)}}))}function p(t){return i({type:"list",pagination:t??(()=>({items:[],hasMore:!1}))},["pagination","title","totalPages"],e=>({staticPagination(n,o){const r=Math.max(1,Math.floor(o||0)),u=Math.ceil(n.length/r);e.totalPages=u,e.pagination=g=>{if(u===0)return{items:[],hasMore:!1};const y=Math.max(1,Math.floor(g||0)),s=Math.min(y,u);return{items:n.slice((s-1)*r,s*r),hasMore:s<u}}}}))}function b(t){return i({type:"text",text:t,animation:null,color:"primary",weight:"normal",size:"md"},["text","color","weight","size","animation"],e=>({primary(){e.color="primary"},muted(){e.color="muted"},shimmering(n={}){e.animation={type:"shimmering",...n}}}))}const P=Object.freeze(Object.defineProperty({__proto__:null,block:c,button:f,col:d,form:m,list:p,row:l,text:b},Symbol.toStringTag,{value:"Module"}));exports.block=c;exports.button=f;exports.col=d;exports.form=m;exports.index=P;exports.list=p;exports.row=l;exports.text=b;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DMcbwFzr.js"),i=require("./index-CuC3Zv7t.js");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-Iczub9lN.js");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.mjs";
2
- import { i as a } from "./index-KeJx8f_d.mjs";
2
+ import { i as a } from "./index-CmnEBvxT.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 t=require("../index-CuC3Zv7t.js");exports.block=t.block;exports.button=t.button;exports.col=t.col;exports.form=t.form;exports.list=t.list;exports.row=t.row;exports.text=t.text;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../index-Iczub9lN.js");exports.block=t.block;exports.button=t.button;exports.col=t.col;exports.form=t.form;exports.list=t.list;exports.row=t.row;exports.text=t.text;
@@ -1,4 +1,4 @@
1
- import { b as o, a as t, c as r, f as l, l as b, r as c, t as f } from "../index-KeJx8f_d.mjs";
1
+ import { b as o, a as t, c as r, f as l, l as b, r as c, t as f } from "../index-CmnEBvxT.mjs";
2
2
  export {
3
3
  o as block,
4
4
  t as button,
@@ -0,0 +1,5 @@
1
+ export interface UIError {
2
+ type: 'error';
3
+ text: string;
4
+ }
5
+ export declare function error(text: string): import('./builder').Builder<UIError, "text"[], {}>;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,7 +4,7 @@ export interface UIText {
4
4
  color?: 'primary' | 'muted';
5
5
  weight?: 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
6
6
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
7
- animation?: 'none' | UITextAnimationShimmering;
7
+ animation?: null | UITextAnimationShimmering;
8
8
  }
9
9
  export type UITextAnimationShimmering = {
10
10
  type: 'shimmering';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@assistant-wi/core",
3
3
  "private": false,
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- "use strict";function i(t,o,e){const n={};return h(n,t,o),w(n,t),v(n,t,e),n}function h(t,o,e){for(const n of e)Object.defineProperty(t,n,{value:a=>(o[n]=a,t),enumerable:!1,writable:!1,configurable:!1})}function v(t,o,e){if(!e)return;const n=e(o);for(const a of Object.keys(n))Object.defineProperty(t,a,{value:(...r)=>(n[a]?.(...r),t),enumerable:!1,writable:!1,configurable:!1})}function w(t,o){Object.defineProperty(t,"build",{value:()=>o,enumerable:!1,writable:!1,configurable:!1})}function s(...t){return i({type:"block",nodes:t,width:"auto",align:"start",justify:"start"},["direction","gap","nodes","width","align","justify"],e=>({row(){e.direction="row"},col(){e.direction="col"},addNode(n){e.nodes.push(n)}}))}function l(...t){return s(...t).row()}function d(...t){return s(...t).col()}function f(t){return i({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 m(...t){return i({type:"form",nodes:t,submitTitle:"Submit"},["title","description","submitTitle","onSubmit","nodes"],e=>({addNode(n){e.nodes.push(n)}}))}function p(t){return i({type:"list",pagination:t??(()=>({items:[],hasMore:!1}))},["pagination","title","totalPages"],e=>({staticPagination(n,a){const r=Math.max(1,Math.floor(a||0)),c=Math.ceil(n.length/r);e.totalPages=c,e.pagination=g=>{if(c===0)return{items:[],hasMore:!1};const y=Math.max(1,Math.floor(g||0)),u=Math.min(y,c);return{items:n.slice((u-1)*r,u*r),hasMore:u<c}}}}))}function b(t){return i({type:"text",text:t,animation:"none",color:"primary",weight:"normal",size:"md"},["text","color","weight","size","animation"],e=>({primary(){e.color="primary"},muted(){e.color="muted"},shimmering(n={}){e.animation={type:"shimmering",...n}}}))}const P=Object.freeze(Object.defineProperty({__proto__:null,block:s,button:f,col:d,form:m,list:p,row:l,text:b},Symbol.toStringTag,{value:"Module"}));exports.block=s;exports.button=f;exports.col=d;exports.form=m;exports.index=P;exports.list=p;exports.row=l;exports.text=b;