@cascateer/core 2.0.14 → 2.0.15
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.
- package/package.json +1 -1
- package/src/component.ts +17 -0
- package/src/index.ts +1 -1
- package/src/slice.ts +5 -1
package/package.json
CHANGED
package/src/component.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dictionary, kebabCase } from "lodash";
|
|
2
2
|
import { defer, share, UnaryFunction } from "rxjs";
|
|
3
3
|
import { createFragment } from ".";
|
|
4
|
+
import { ApiAdapter, ApiEffect } from "./api";
|
|
4
5
|
import { cssStyleSheets } from "./css";
|
|
5
6
|
import { defineCustomElement } from "./dom";
|
|
6
7
|
import { ExtendableDictionary } from "./lib";
|
|
@@ -67,6 +68,8 @@ export class ComponentsAdapter<
|
|
|
67
68
|
export class ExtendableComponentsAdapter<
|
|
68
69
|
StoreSignals extends Dictionary<ComputedSignal<any>>,
|
|
69
70
|
StoreActions extends Dictionary<Action<any, any>>,
|
|
71
|
+
ApiEffects extends Dictionary<ApiEffect<any, any>>,
|
|
72
|
+
ApiActions extends Dictionary<Action<any, any>>,
|
|
70
73
|
TerminalEffects extends Dictionary<TerminalEffect<any, any>>,
|
|
71
74
|
TerminalActions extends Dictionary<Action<any, any>>,
|
|
72
75
|
Components extends Dictionary<ComponentConstructor<any>>,
|
|
@@ -78,6 +81,7 @@ export class ExtendableComponentsAdapter<
|
|
|
78
81
|
constructor(
|
|
79
82
|
public context: {
|
|
80
83
|
store: StoreAdapter<StoreSignals, StoreActions>;
|
|
84
|
+
api: ApiAdapter<ApiEffects, ApiActions>;
|
|
81
85
|
terminal: TerminalAdapter<TerminalEffects, TerminalActions>;
|
|
82
86
|
},
|
|
83
87
|
private extendableComponents: ExtendableDictionary<
|
|
@@ -98,6 +102,10 @@ export class ExtendableComponentsAdapter<
|
|
|
98
102
|
effects: StoreEffects<StoreSignals>;
|
|
99
103
|
actions: StoreActions;
|
|
100
104
|
};
|
|
105
|
+
api: {
|
|
106
|
+
effects: ApiEffects;
|
|
107
|
+
actions: ApiActions;
|
|
108
|
+
};
|
|
101
109
|
terminal: {
|
|
102
110
|
effects: TerminalEffects;
|
|
103
111
|
actions: TerminalActions;
|
|
@@ -121,6 +129,10 @@ export class ExtendableComponentsAdapter<
|
|
|
121
129
|
effects: asStoreEffects(this.context.store.signals),
|
|
122
130
|
actions: this.context.store.actions,
|
|
123
131
|
},
|
|
132
|
+
api: {
|
|
133
|
+
effects: this.context.api.effects,
|
|
134
|
+
actions: this.context.api.actions,
|
|
135
|
+
},
|
|
124
136
|
terminal: {
|
|
125
137
|
effects: this.context.terminal.effects,
|
|
126
138
|
actions: this.context.terminal.actions,
|
|
@@ -135,17 +147,22 @@ export class ExtendableComponentsAdapter<
|
|
|
135
147
|
export class ComponentsProvider<
|
|
136
148
|
StoreSignals extends Dictionary<ComputedSignal<any>>,
|
|
137
149
|
StoreActions extends Dictionary<Action<any, any>>,
|
|
150
|
+
ApiEffects extends Dictionary<ApiEffect<any, any>>,
|
|
151
|
+
ApiActions extends Dictionary<Action<any, any>>,
|
|
138
152
|
TerminalEffects extends Dictionary<TerminalEffect<any, any>>,
|
|
139
153
|
TerminalActions extends Dictionary<Action<any, any>>,
|
|
140
154
|
> extends ExtendableComponentsAdapter<
|
|
141
155
|
StoreSignals,
|
|
142
156
|
StoreActions,
|
|
157
|
+
ApiEffects,
|
|
158
|
+
ApiActions,
|
|
143
159
|
TerminalEffects,
|
|
144
160
|
TerminalActions,
|
|
145
161
|
{}
|
|
146
162
|
> {
|
|
147
163
|
constructor(context: {
|
|
148
164
|
store: StoreAdapter<StoreSignals, StoreActions>;
|
|
165
|
+
api: ApiAdapter<ApiEffects, ApiActions>;
|
|
149
166
|
terminal: TerminalAdapter<TerminalEffects, TerminalActions>;
|
|
150
167
|
}) {
|
|
151
168
|
super(context, new ExtendableDictionary({}));
|
package/src/index.ts
CHANGED
package/src/slice.ts
CHANGED
|
@@ -54,6 +54,8 @@ interface SliceConfig<
|
|
|
54
54
|
new (): ComponentsProvider<
|
|
55
55
|
StoreSignals,
|
|
56
56
|
StoreActions,
|
|
57
|
+
ApiEffects,
|
|
58
|
+
ApiActions,
|
|
57
59
|
TerminalEffects,
|
|
58
60
|
TerminalActions
|
|
59
61
|
>;
|
|
@@ -171,13 +173,15 @@ export class Slice<
|
|
|
171
173
|
class extends ComponentsProvider<
|
|
172
174
|
StoreSignals,
|
|
173
175
|
StoreActions,
|
|
176
|
+
ApiEffects,
|
|
177
|
+
ApiActions,
|
|
174
178
|
TerminalEffects,
|
|
175
179
|
TerminalActions
|
|
176
180
|
> {
|
|
177
181
|
constructor() {
|
|
178
182
|
super(context);
|
|
179
183
|
}
|
|
180
|
-
})({ store: this.store, terminal: this.terminal }),
|
|
184
|
+
})({ store: this.store, api, terminal: this.terminal }),
|
|
181
185
|
}).components,
|
|
182
186
|
(componentConstructor) =>
|
|
183
187
|
componentConstructor.predicate(key),
|