@motiadev/plugin-states 0.13.0-beta.162-846200 → 0.13.0-beta.162-813224

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 @@
1
+ /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-950:oklch(25.8% .092 26.042);--color-orange-500:oklch(70.5% .213 47.604);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-950:oklch(26.6% .065 152.934);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-semibold:600;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-weight-500:var(--font-weight-500);--font-weight-600:var(--font-weight-600);--font-weight-700:var(--font-weight-700)}}@layer base{*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.left-3{left:calc(var(--spacing)*3)}.mr-1{margin-right:calc(var(--spacing)*1)}.flex{display:flex}.grid{display:grid}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-\[34px\]{height:34px}.h-full{height:100%}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.flex-1{flex:1}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/20{background-color:color-mix(in oklab,var(--background)20%,transparent)}}.bg-destructive\/90{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/90{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted-foreground\/10{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/10{background-color:color-mix(in oklab,var(--muted-foreground)10%,transparent)}}.bg-orange-500{background-color:var(--color-orange-500)}.bg-red-50{background-color:var(--color-red-50)}.p-2{padding:calc(var(--spacing)*2)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-9\!{padding-inline:calc(var(--spacing)*9)!important}.py-1{padding-block:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-green-700{color:var(--color-green-700)}.text-muted-foreground,.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}}.text-red-700{color:var(--color-red-700)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}@media (hover:hover){.hover\:bg-muted-foreground\/10:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted-foreground\/10:hover{background-color:color-mix(in oklab,var(--muted-foreground)10%,transparent)}}.hover\:bg-muted-foreground\/20:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted-foreground\/20:hover{background-color:color-mix(in oklab,var(--muted-foreground)20%,transparent)}}.hover\:bg-transparent:hover{background-color:#0000}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}}.dark\:border-green-800:is(.dark *){border-color:var(--color-green-800)}.dark\:border-red-800:is(.dark *){border-color:var(--color-red-800)}.dark\:bg-green-950\/20:is(.dark *){background-color:#032e1533}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-950\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-green-950)20%,transparent)}}.dark\:bg-red-950\/20:is(.dark *){background-color:#46080933}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-950\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-red-950)20%,transparent)}}.dark\:text-green-400:is(.dark *){color:var(--color-green-400)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}}:root{--default-font-family:"DM Sans",ui-sans-serif,sans-serif;--font-dm-mono:"DM Mono",ui-monospace,monospace;color-scheme:light dark;font-size:16px;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"),serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-optical-sizing:auto;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--accent-1000:#2862fe;--accent-970:#2862fef7;--accent-950:#2862fef2;--accent-900:#2862fee5;--accent-800:#2862fecc;--accent-700:#2862feb2;--accent-600:#2862fe99;--accent-500:#2862fe80;--accent-400:#2862fe66;--accent-300:#2862fe4d;--accent-200:#2862fe33;--accent-100:#2862fe1a;--accent-50:#2862fe0d;--accent-30:#2862fe08;--dark-1000:#0a0a0a;--dark-970:#0a0a0af7;--dark-950:#0a0a0af2;--dark-900:#0a0a0ae5;--dark-800:#0a0a0acc;--dark-700:#0a0a0ab2;--dark-600:#0a0a0a99;--dark-500:#0a0a0a80;--dark-400:#0a0a0a66;--dark-300:#0a0a0a4d;--dark-200:#0a0a0a33;--dark-100:#0a0a0a1a;--dark-50:#0a0a0a0d;--dark-30:#0a0a0a08;--light-1000:#fff;--light-970:#fffffff7;--light-950:#fffffff2;--light-900:#ffffffe5;--light-800:#fffc;--light-700:#ffffffb2;--light-600:#fff9;--light-500:#ffffff80;--light-400:#fff6;--light-300:#ffffff4d;--light-200:#fff3;--light-100:#ffffff1a;--light-50:#ffffff0d;--light-30:#ffffff08;--error:#d61355;--canvas-background:#ebebeb;--background:var(--light-1000);--foreground:var(--dark-1000);--surface-content:var(--dark-30);--surface-component:var(--dark-50);--surface-light-100:var(--dark-100);--surface-light-200:var(--dark-200);--border:var(--dark-100);--border-accent:var(--accent-1000);--states-hover:var(--dark-30);--states-selected:var(--dark-100);--states-active:var(--accent-1000);--text-header:var(--dark-1000);--text-body:var(--dark-600);--text-placeholder:var(--dark-400);--text-accent:var(--accent-1000);--text-error:var(--error);--icon-active:var(--dark-1000);--icon-light:var(--dark-600);--icon-component:var(--dark-400);--icon-accent:var(--accent-1000);--primary:var(--accent-1000);--primary-foreground:var(--light-1000);--secondary:var(--surface-component);--secondary-foreground:var(--text-body);--muted:var(--surface-light-100);--muted-foreground:var(--text-body);--accent:var(--accent-1000);--accent-foreground:var(--light-1000);--destructive:var(--error);--destructive-foreground:var(--light-1000);--card:var(--surface-content);--card-foreground:var(--foreground);--popover:var(--surface-content);--popover-foreground:var(--foreground);--input:var(--states-hover);--ring:var(--border-accent);--chart-1:var(--accent-1000);--chart-2:var(--accent-800);--chart-3:var(--accent-600);--chart-4:var(--accent-400);--chart-5:var(--accent-200);--header:var(--background);--header-foreground:var(--text-header);--header-primary:var(--primary);--header-primary-foreground:var(--primary-foreground);--header-accent:var(--surface-component);--header-accent-foreground:var(--text-body);--header-border:var(--border);--header-ring:var(--ring);--sidebar:var(--background);--sidebar-foreground:var(--text-header);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--surface-component);--sidebar-accent-foreground:var(--text-body);--sidebar-border:var(--border);--sidebar-ring:var(--ring);width:100%}.dark{--canvas-background:#030303;--background:var(--dark-1000);--foreground:var(--light-1000);--surface-content:var(--light-30);--surface-component:var(--light-50);--surface-light-100:var(--light-100);--surface-light-200:var(--light-200);--border:var(--light-100);--states-hover:var(--light-30);--states-selected:var(--light-100);--text-header:var(--light-1000);--text-body:var(--light-600);--text-placeholder:var(--light-400);--icon-active:var(--light-1000);--icon-light:var(--light-600);--icon-component:var(--light-400);--secondary-foreground:var(--light-600);--muted-foreground:var(--light-600);--card:var(--surface-content);--card-foreground:var(--foreground);--popover:var(--surface-content);--popover-foreground:var(--foreground);--input:var(--states-hover);--ring:var(--border-accent);--chart-1:var(--accent-1000);--chart-2:var(--accent-800);--chart-3:var(--accent-600);--chart-4:var(--accent-400);--chart-5:var(--accent-200);--header:var(--background);--header-foreground:var(--text-header);--header-primary:var(--primary);--header-primary-foreground:var(--primary-foreground);--header-accent:var(--surface-component);--header-accent-foreground:var(--text-body);--header-border:var(--border);--header-ring:var(--ring);--sidebar:var(--background);--sidebar-foreground:var(--text-header);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--surface-component);--sidebar-accent-foreground:var(--text-body);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}.json-view{background-color:#0000!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
@@ -0,0 +1 @@
1
+ "use strict";const i=s=>{s.registerApi({method:"GET",path:"/__motia/state"},async r=>{try{const e=r.queryParams.groupId,t=r.queryParams.filter?JSON.parse(r.queryParams.filter):void 0;return{status:200,body:await s.state.items({groupId:e,filter:t})}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),s.registerApi({method:"POST",path:"/__motia/state"},async(r,e)=>{try{const{key:t,groupId:o,value:a}=r.body;return await e.state.set(o,t,a),{status:200,body:{key:t,groupId:o,value:a}}}catch(t){return{status:500,body:{error:t instanceof Error?t.message:"Unknown error"}}}}),s.registerApi({method:"POST",path:"/__motia/state/delete"},async(r,e)=>{try{for(const t of r.body.ids){const[o,...a]=t.split(":"),n=a.join(":");await e.state.delete(o,n)}return{status:204,body:""}}catch(t){return{status:500,body:{error:t instanceof Error?t.message:"Unknown error"}}}})};function c(s){return i(s),{workbench:[{packageName:"@motiadev/plugin-states",cssImports:["@motiadev/plugin-states/dist/plugin-states.css"],label:"States",position:"bottom",componentName:"StatesPage",labelIcon:"file"}]}}module.exports=c;
package/dist/plugin.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- import { MotiaPlugin, MotiaPluginContext } from "@motiadev/core";
2
-
3
- //#region src/plugin.d.ts
4
- declare function plugin(motia: MotiaPluginContext): MotiaPlugin;
5
- //#endregion
6
- export { plugin as default };
1
+ import { MotiaPlugin, MotiaPluginContext } from '@motiadev/core';
2
+ export default function plugin(motia: MotiaPluginContext): MotiaPlugin;
7
3
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","names":[],"sources":["../src/plugin.ts"],"sourcesContent":[],"mappings":";;;iBAGwB,MAAA,QAAc,qBAAqB"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAGrE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,WAAW,CAerE"}
package/dist/plugin.js CHANGED
@@ -1,85 +1,80 @@
1
- //#region src/api.ts
2
- const api = (motia) => {
3
- motia.registerApi({
4
- method: "GET",
5
- path: "/__motia/state"
6
- }, async (req) => {
7
- try {
8
- const groupId = req.queryParams.groupId;
9
- const filter = req.queryParams.filter ? JSON.parse(req.queryParams.filter) : void 0;
10
- return {
11
- status: 200,
12
- body: await motia.state.items({
13
- groupId,
14
- filter
15
- })
16
- };
17
- } catch (error) {
18
- return {
19
- status: 500,
20
- body: { error: error instanceof Error ? error.message : "Unknown error" }
21
- };
22
- }
23
- });
24
- motia.registerApi({
25
- method: "POST",
26
- path: "/__motia/state"
27
- }, async (req, ctx) => {
28
- try {
29
- const { key, groupId, value } = req.body;
30
- await ctx.state.set(groupId, key, value);
31
- return {
32
- status: 200,
33
- body: {
34
- key,
35
- groupId,
36
- value
37
- }
38
- };
39
- } catch (error) {
40
- return {
41
- status: 500,
42
- body: { error: error instanceof Error ? error.message : "Unknown error" }
43
- };
44
- }
45
- });
46
- motia.registerApi({
47
- method: "POST",
48
- path: "/__motia/state/delete"
49
- }, async (req, ctx) => {
50
- try {
51
- for (const id of req.body.ids) {
52
- const [groupId, ...keyParts] = id.split(":");
53
- const key = keyParts.join(":");
54
- await ctx.state.delete(groupId, key);
55
- }
56
- return {
57
- status: 204,
58
- body: ""
59
- };
60
- } catch (error) {
61
- return {
62
- status: 500,
63
- body: { error: error instanceof Error ? error.message : "Unknown error" }
64
- };
65
- }
66
- });
1
+ const i = (s) => {
2
+ s.registerApi(
3
+ {
4
+ method: "GET",
5
+ path: "/__motia/state"
6
+ },
7
+ async (r) => {
8
+ try {
9
+ const e = r.queryParams.groupId, t = r.queryParams.filter ? JSON.parse(r.queryParams.filter) : void 0;
10
+ return {
11
+ status: 200,
12
+ body: await s.state.items({ groupId: e, filter: t })
13
+ };
14
+ } catch (e) {
15
+ return {
16
+ status: 500,
17
+ body: { error: e instanceof Error ? e.message : "Unknown error" }
18
+ };
19
+ }
20
+ }
21
+ ), s.registerApi(
22
+ {
23
+ method: "POST",
24
+ path: "/__motia/state"
25
+ },
26
+ async (r, e) => {
27
+ try {
28
+ const { key: t, groupId: a, value: o } = r.body;
29
+ return await e.state.set(a, t, o), {
30
+ status: 200,
31
+ body: { key: t, groupId: a, value: o }
32
+ };
33
+ } catch (t) {
34
+ return {
35
+ status: 500,
36
+ body: { error: t instanceof Error ? t.message : "Unknown error" }
37
+ };
38
+ }
39
+ }
40
+ ), s.registerApi(
41
+ {
42
+ method: "POST",
43
+ path: "/__motia/state/delete"
44
+ },
45
+ async (r, e) => {
46
+ try {
47
+ for (const t of r.body.ids) {
48
+ const [a, ...o] = t.split(":"), n = o.join(":");
49
+ await e.state.delete(a, n);
50
+ }
51
+ return {
52
+ status: 204,
53
+ body: ""
54
+ };
55
+ } catch (t) {
56
+ return {
57
+ status: 500,
58
+ body: { error: t instanceof Error ? t.message : "Unknown error" }
59
+ };
60
+ }
61
+ }
62
+ );
67
63
  };
68
-
69
- //#endregion
70
- //#region src/plugin.ts
71
- function plugin(motia) {
72
- api(motia);
73
- return { workbench: [{
74
- packageName: "@motiadev/plugin-states",
75
- cssImports: ["@motiadev/plugin-states/dist/index.css"],
76
- label: "States",
77
- position: "bottom",
78
- componentName: "StatesPage",
79
- labelIcon: "file"
80
- }] };
64
+ function c(s) {
65
+ return i(s), {
66
+ workbench: [
67
+ {
68
+ packageName: "@motiadev/plugin-states",
69
+ cssImports: ["@motiadev/plugin-states/dist/plugin-states.css"],
70
+ label: "States",
71
+ position: "bottom",
72
+ componentName: "StatesPage",
73
+ labelIcon: "file"
74
+ }
75
+ ]
76
+ };
81
77
  }
82
-
83
- //#endregion
84
- export { plugin as default };
85
- //# sourceMappingURL=plugin.js.map
78
+ export {
79
+ c as default
80
+ };
@@ -0,0 +1,6 @@
1
+ export type StatesState = {
2
+ selectedStateId?: string;
3
+ selectStateId: (stateId?: string) => void;
4
+ };
5
+ export declare const useStatesStore: import('zustand').UseBoundStore<import('zustand').StoreApi<StatesState>>;
6
+ //# sourceMappingURL=use-states-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-states-store.d.ts","sourceRoot":"","sources":["../../src/stores/use-states-store.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IACxB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,eAAO,MAAM,cAAc,0EAGxB,CAAA"}
@@ -0,0 +1,7 @@
1
+ export interface StateItem {
2
+ groupId: string;
3
+ key: string;
4
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null';
5
+ value: string | number | boolean | object | unknown[] | null;
6
+ }
7
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/types/state.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACnE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAAA;CAC7D"}
package/package.json CHANGED
@@ -1,46 +1,51 @@
1
1
  {
2
2
  "name": "@motiadev/plugin-states",
3
- "version": "0.13.0-beta.162-846200",
3
+ "version": "0.13.0-beta.162-813224",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- ".": "./dist/index.js",
10
- "./plugin": "./dist/plugin.js",
11
- "./package.json": "./package.json"
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ },
14
+ "./plugin": {
15
+ "types": "./dist/plugin.d.ts",
16
+ "import": "./dist/plugin.js",
17
+ "require": "./dist/plugin.cjs"
18
+ },
19
+ "./styles.css": "./dist/plugin-states.css"
12
20
  },
13
21
  "files": [
14
22
  "dist"
15
23
  ],
16
24
  "dependencies": {
17
25
  "@monaco-editor/react": "^4.7.0",
18
- "lucide-react": "^0.555.0",
26
+ "lucide-react": "^0.545.0",
19
27
  "react18-json-view": "^0.2.9",
20
28
  "zustand": "^5.0.8"
21
29
  },
22
30
  "peerDependencies": {
23
- "@motiadev/core": "0.13.0-beta.162-846200",
24
- "@motiadev/ui": "0.13.0-beta.162-846200"
31
+ "@motiadev/stream-client-browser": "0.13.0-beta.162-813224",
32
+ "@motiadev/ui": "0.13.0-beta.162-813224",
33
+ "@motiadev/core": "0.13.0-beta.162-813224"
25
34
  },
26
35
  "devDependencies": {
27
- "@bosh-code/tsdown-plugin-inject-css": "^2.0.0",
28
- "@bosh-code/tsdown-plugin-tailwindcss": "^1.0.1",
29
- "@rollup/plugin-babel": "^6.1.0",
30
- "@tailwindcss/postcss": "^4.1.17",
31
- "@types/node": "^24.10.1",
32
- "@types/react": "^19.2.7",
33
- "babel-plugin-react-compiler": "^1.0.0",
34
- "publint": "^0.3.15",
36
+ "@tailwindcss/vite": "^4.1.14",
37
+ "@types/node": "^24.7.2",
38
+ "@types/react": "^19.2.2",
39
+ "@vitejs/plugin-react": "^5.0.4",
35
40
  "react": "^19.2.0",
36
- "tailwindcss": "^4.1.17",
37
- "tsdown": "^0.16.8",
41
+ "tailwindcss": "^4.1.14",
38
42
  "typescript": "^5.9.3",
39
- "unplugin-unused": "^0.5.6"
43
+ "vite": "^7.1.10",
44
+ "vite-plugin-dts": "^4.5.4"
40
45
  },
41
46
  "scripts": {
42
- "build": "tsdown",
43
- "dev": "tsdown --watch",
47
+ "build": "vite build",
48
+ "dev": "vite build --watch",
44
49
  "clean": "rm -rf dist"
45
50
  }
46
51
  }