@decido/shell 4.0.3 → 4.0.4

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.
Files changed (70) hide show
  1. package/dist/CenterComposite-V3LL23PG.mjs +64 -0
  2. package/dist/DebugPanel-NFXQOZQ6.mjs +1 -0
  3. package/dist/MorphShell-4JGDAN46.mjs +1 -0
  4. package/dist/PlaygroundAppSidebar-QI73PNRI.mjs +1 -0
  5. package/dist/PlaygroundChat-CBIIQMWU.mjs +1 -0
  6. package/dist/PlaygroundTerminal-MVZKXTYW.mjs +1 -0
  7. package/dist/PluginSandbox-MUNBFWGH.mjs +1 -0
  8. package/dist/ReactFlowEditor-2ALQWCHQ.mjs +6 -0
  9. package/dist/ReactFlowEditor-ROZ6RF3K.css +1 -0
  10. package/dist/TimelineEditor-UPRRXXVM.mjs +3 -0
  11. package/dist/WidgetSlotPanel-YX2VBQAP.mjs +1 -0
  12. package/dist/chunk-3YEFIKFH.mjs +1 -0
  13. package/dist/chunk-53FADIUX.mjs +1 -0
  14. package/dist/chunk-5FWJFDER.mjs +285 -0
  15. package/dist/chunk-6K3AFDP5.mjs +1 -0
  16. package/dist/chunk-AGAAZ2MU.mjs +1 -0
  17. package/dist/chunk-BCP43BRV.mjs +2 -0
  18. package/dist/chunk-BSJBW64M.mjs +1 -0
  19. package/dist/chunk-C5FD536O.mjs +1 -0
  20. package/dist/chunk-DTH34ILQ.mjs +1 -0
  21. package/dist/chunk-DWP77YZU.mjs +1 -0
  22. package/dist/chunk-O3OWL3Q2.mjs +1 -0
  23. package/dist/chunk-POBZMHZ5.mjs +7 -0
  24. package/dist/chunk-S3AQ4QDD.mjs +42 -0
  25. package/dist/chunk-XDA6ZRIQ.mjs +1 -0
  26. package/dist/chunk-XTDMHHMW.mjs +5 -0
  27. package/dist/chunk-YAYNNUEX.mjs +12 -0
  28. package/dist/chunk-YEKQJ4YC.mjs +1 -0
  29. package/dist/chunk-YHFKY5MB.mjs +1 -0
  30. package/dist/chunk-ZKD74U4X.mjs +1 -0
  31. package/dist/index.css +1 -561
  32. package/dist/index.js +462 -65086
  33. package/dist/index.mjs +50 -40209
  34. package/dist/useIntentLens-OCAUBNOQ.mjs +1 -0
  35. package/dist/useSuggestionsStore-Q4KVPU7L.mjs +1 -0
  36. package/dist/wasm-A4BTVJWV.mjs +1 -0
  37. package/package.json +15 -15
  38. package/dist/CenterComposite-RPEGBKQU.mjs +0 -1697
  39. package/dist/DebugPanel-KEKDMHDN.mjs +0 -14
  40. package/dist/MorphShell-FKDBB7E5.mjs +0 -14
  41. package/dist/PlaygroundAppSidebar-ALYJJGAO.mjs +0 -9
  42. package/dist/PlaygroundChat-MI2KXMK6.mjs +0 -15
  43. package/dist/PlaygroundTerminal-5AV4BJAI.mjs +0 -7
  44. package/dist/PluginSandbox-WMNAUQOJ.mjs +0 -188
  45. package/dist/ReactFlowEditor-RTF2652X.mjs +0 -3574
  46. package/dist/ReactFlowEditor-ZW5MCN5Y.css +0 -561
  47. package/dist/TimelineEditor-N4HRMHTB.mjs +0 -226
  48. package/dist/WidgetSlotPanel-KJI4CHHD.mjs +0 -11
  49. package/dist/chunk-2YMI4N5I.mjs +0 -2004
  50. package/dist/chunk-3BZX7LF2.mjs +0 -139
  51. package/dist/chunk-3P4P3M54.mjs +0 -136
  52. package/dist/chunk-F3OTFHNO.mjs +0 -40
  53. package/dist/chunk-IMHORBTL.mjs +0 -48
  54. package/dist/chunk-JF5QSJYT.mjs +0 -295
  55. package/dist/chunk-LWMMFTJC.mjs +0 -382
  56. package/dist/chunk-MSVEFEXE.mjs +0 -179
  57. package/dist/chunk-OCHGY2MN.mjs +0 -1662
  58. package/dist/chunk-PMYAM764.mjs +0 -813
  59. package/dist/chunk-Q64KZXPK.mjs +0 -43
  60. package/dist/chunk-QHQW2HMU.mjs +0 -155
  61. package/dist/chunk-RWZ4BOIN.mjs +0 -385
  62. package/dist/chunk-UHT6FIYF.mjs +0 -195
  63. package/dist/chunk-UJCSKKID.mjs +0 -30
  64. package/dist/chunk-V3CYNPGL.mjs +0 -8758
  65. package/dist/chunk-VBPGEFNM.mjs +0 -2381
  66. package/dist/chunk-XMSU6UWD.mjs +0 -158
  67. package/dist/chunk-ZCCCBHE6.mjs +0 -55
  68. package/dist/useIntentLens-LEQCAXCK.mjs +0 -13
  69. package/dist/useSuggestionsStore-4L2AIZ2D.mjs +0 -7
  70. package/dist/wasm-QFXGEYGP.mjs +0 -81
@@ -1,195 +0,0 @@
1
- import {
2
- dlog
3
- } from "./chunk-3P4P3M54.mjs";
4
-
5
- // src/store/useMorphInstanceStore.ts
6
- import { create } from "zustand";
7
- import { persist } from "zustand/middleware";
8
- var useMorphInstanceStore = create()(
9
- persist(
10
- (set, get) => ({
11
- instances: /* @__PURE__ */ new Map(),
12
- activeInstanceId: null,
13
- historyByInstance: /* @__PURE__ */ new Map(),
14
- upsertInstance: (partial) => {
15
- dlog.store(`upsertInstance: ${partial.id} (${partial.shellType})`, { id: partial.id, shellType: partial.shellType, label: partial.label });
16
- set((state) => {
17
- const instances = new Map(state.instances);
18
- const existing = instances.get(partial.id);
19
- const historyByInstance = new Map(state.historyByInstance);
20
- if (existing?.data) {
21
- const hist = historyByInstance.get(partial.id) || { stack: [], index: -1 };
22
- const trimmed = hist.stack.slice(0, hist.index + 1);
23
- trimmed.push({ ...existing.data });
24
- if (trimmed.length > 20) trimmed.shift();
25
- historyByInstance.set(partial.id, { stack: trimmed, index: trimmed.length - 1 });
26
- }
27
- instances.set(partial.id, {
28
- artifacts: [],
29
- activeArtifactIndex: 0,
30
- createdAt: Date.now(),
31
- ...existing,
32
- ...partial
33
- });
34
- return { instances, activeInstanceId: partial.id, historyByInstance };
35
- });
36
- },
37
- removeInstance: (id) => {
38
- set((state) => {
39
- const instances = new Map(state.instances);
40
- instances.delete(id);
41
- const activeInstanceId = state.activeInstanceId === id ? instances.size > 0 ? instances.keys().next().value ?? null : null : state.activeInstanceId;
42
- return { instances, activeInstanceId };
43
- });
44
- },
45
- setActiveInstance: (id) => set({ activeInstanceId: id }),
46
- pushArtifact: (instanceId, artifact) => {
47
- set((state) => {
48
- const instances = new Map(state.instances);
49
- const instance = instances.get(instanceId);
50
- if (!instance) return state;
51
- const newArtifact = { ...artifact, updatedAt: Date.now() };
52
- const artifacts = [...instance.artifacts, newArtifact];
53
- instances.set(instanceId, {
54
- ...instance,
55
- artifacts,
56
- activeArtifactIndex: artifacts.length - 1
57
- });
58
- return { instances };
59
- });
60
- },
61
- updateArtifact: (instanceId, artifactId, data) => {
62
- set((state) => {
63
- const instances = new Map(state.instances);
64
- const instance = instances.get(instanceId);
65
- if (!instance) return state;
66
- const artifacts = instance.artifacts.map(
67
- (a) => a.id === artifactId ? { ...a, data: { ...a.data, ...data }, updatedAt: Date.now() } : a
68
- );
69
- instances.set(instanceId, { ...instance, artifacts });
70
- return { instances };
71
- });
72
- },
73
- setActiveArtifact: (instanceId, index) => {
74
- set((state) => {
75
- const instances = new Map(state.instances);
76
- const instance = instances.get(instanceId);
77
- if (!instance) return state;
78
- instances.set(instanceId, {
79
- ...instance,
80
- activeArtifactIndex: Math.max(0, Math.min(index, instance.artifacts.length - 1))
81
- });
82
- return { instances };
83
- });
84
- },
85
- removeArtifact: (instanceId, artifactId) => {
86
- set((state) => {
87
- const instances = new Map(state.instances);
88
- const instance = instances.get(instanceId);
89
- if (!instance) return state;
90
- const artifacts = instance.artifacts.filter((a) => a.id !== artifactId);
91
- instances.set(instanceId, {
92
- ...instance,
93
- artifacts,
94
- activeArtifactIndex: Math.min(instance.activeArtifactIndex, Math.max(0, artifacts.length - 1))
95
- });
96
- return { instances };
97
- });
98
- },
99
- getInstance: (id) => get().instances.get(id),
100
- getInstances: () => Array.from(get().instances.values()),
101
- getActiveInstance: () => {
102
- const { instances, activeInstanceId } = get();
103
- return activeInstanceId ? instances.get(activeInstanceId) : void 0;
104
- },
105
- // Sprint AL: Undo/Redo
106
- undo: (instanceId) => {
107
- const id = instanceId || get().activeInstanceId;
108
- if (!id) return;
109
- set((state) => {
110
- const hist = state.historyByInstance.get(id);
111
- if (!hist || hist.index < 0) return state;
112
- const instances = new Map(state.instances);
113
- const inst = instances.get(id);
114
- if (!inst) return state;
115
- const historyByInstance = new Map(state.historyByInstance);
116
- const restoredData = hist.stack[hist.index];
117
- dlog.store(`undo: ${id} \u2192 version ${hist.index}/${hist.stack.length}`, { instanceId: id });
118
- instances.set(id, { ...inst, data: { ...restoredData } });
119
- historyByInstance.set(id, { ...hist, index: hist.index - 1 });
120
- return { instances, historyByInstance };
121
- });
122
- },
123
- redo: (instanceId) => {
124
- const id = instanceId || get().activeInstanceId;
125
- if (!id) return;
126
- set((state) => {
127
- const hist = state.historyByInstance.get(id);
128
- if (!hist || hist.index >= hist.stack.length - 1) return state;
129
- const instances = new Map(state.instances);
130
- const inst = instances.get(id);
131
- if (!inst) return state;
132
- const historyByInstance = new Map(state.historyByInstance);
133
- const nextIndex = hist.index + 1;
134
- const restoredData = hist.stack[nextIndex];
135
- dlog.store(`redo: ${id} \u2192 version ${nextIndex + 1}/${hist.stack.length}`, { instanceId: id });
136
- instances.set(id, { ...inst, data: { ...restoredData } });
137
- historyByInstance.set(id, { ...hist, index: nextIndex });
138
- return { instances, historyByInstance };
139
- });
140
- },
141
- canUndo: (instanceId) => {
142
- const id = instanceId || get().activeInstanceId;
143
- if (!id) return false;
144
- const hist = get().historyByInstance.get(id);
145
- return !!hist && hist.index >= 0;
146
- },
147
- canRedo: (instanceId) => {
148
- const id = instanceId || get().activeInstanceId;
149
- if (!id) return false;
150
- const hist = get().historyByInstance.get(id);
151
- return !!hist && hist.index < hist.stack.length - 1;
152
- },
153
- getHistoryInfo: (instanceId) => {
154
- const id = instanceId || get().activeInstanceId;
155
- if (!id) return { current: 0, total: 0 };
156
- const hist = get().historyByInstance.get(id);
157
- if (!hist) return { current: 0, total: 0 };
158
- return { current: hist.index + 2, total: hist.stack.length + 1 };
159
- }
160
- }),
161
- {
162
- name: "decido-morph-instances",
163
- storage: {
164
- getItem: (name) => {
165
- const raw = localStorage.getItem(name);
166
- if (!raw) return null;
167
- const parsed = JSON.parse(raw);
168
- if (parsed.state?.instances) {
169
- parsed.state.instances = new Map(parsed.state.instances);
170
- }
171
- return parsed;
172
- },
173
- setItem: (name, value) => {
174
- const toStore = {
175
- ...value,
176
- state: {
177
- ...value.state,
178
- instances: Array.from(value.state.instances.entries())
179
- }
180
- };
181
- localStorage.setItem(name, JSON.stringify(toStore));
182
- },
183
- removeItem: (name) => localStorage.removeItem(name)
184
- },
185
- partialize: (state) => ({
186
- instances: state.instances,
187
- activeInstanceId: state.activeInstanceId
188
- })
189
- }
190
- )
191
- );
192
-
193
- export {
194
- useMorphInstanceStore
195
- };
@@ -1,30 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
- export {
28
- __commonJS,
29
- __toESM
30
- };