sygnal 5.3.1 → 5.3.2
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/dist/index.cjs.js +120 -119
- package/dist/index.esm.js +84 -83
- package/dist/sygnal.min.js +1 -1
- package/package.json +1 -1
- package/src/extra/pwa.ts +29 -27
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as xs$
|
|
1
|
+
import * as xs$2 from 'xstream';
|
|
2
2
|
import xs__default, { Stream as Stream$1, NO } from 'xstream';
|
|
3
3
|
import * as dropRepeatsModule from 'xstream/extra/dropRepeats.js';
|
|
4
4
|
import dropRepeatsModule__default from 'xstream/extra/dropRepeats.js';
|
|
@@ -2053,10 +2053,10 @@ function getXs(namespaceValue) {
|
|
|
2053
2053
|
}
|
|
2054
2054
|
return value;
|
|
2055
2055
|
}
|
|
2056
|
-
const xs = getXs(xs$
|
|
2057
|
-
const Stream = xs$
|
|
2058
|
-
(xs$
|
|
2059
|
-
(xs && xs.Stream);
|
|
2056
|
+
const xs$1 = getXs(xs$2);
|
|
2057
|
+
const Stream = xs$2.Stream ||
|
|
2058
|
+
(xs$2.default && xs$2.default.Stream) ||
|
|
2059
|
+
(xs$1 && xs$1.Stream);
|
|
2060
2060
|
|
|
2061
2061
|
const dropRepeats$1 = resolveInteropDefault(dropRepeatsModule);
|
|
2062
2062
|
function switchable(factories, name$, initial, opts = {}) {
|
|
@@ -2102,7 +2102,7 @@ function _switchable(factories, sources, name$, switched = ['DOM'], stateSourceN
|
|
|
2102
2102
|
const sinks = Object.entries(factories).map(([name, factory]) => {
|
|
2103
2103
|
if (sources[stateSourceName]) {
|
|
2104
2104
|
const state$ = sources[stateSourceName].stream;
|
|
2105
|
-
const switchedState = xs
|
|
2105
|
+
const switchedState = xs$1
|
|
2106
2106
|
.combine(name$, state$)
|
|
2107
2107
|
.filter(([newComponentName]) => newComponentName == name)
|
|
2108
2108
|
.map(([, state]) => state)
|
|
@@ -2117,7 +2117,7 @@ function _switchable(factories, sources, name$, switched = ['DOM'], stateSourceN
|
|
|
2117
2117
|
obj[sinkName] = name$
|
|
2118
2118
|
.map((newComponentName) => {
|
|
2119
2119
|
const sink = sinks.find(([componentName]) => componentName === newComponentName);
|
|
2120
|
-
return (sink && sink[1][sinkName]) || xs.never();
|
|
2120
|
+
return (sink && sink[1][sinkName]) || xs$1.never();
|
|
2121
2121
|
})
|
|
2122
2122
|
.flatten()
|
|
2123
2123
|
.remember()
|
|
@@ -2127,7 +2127,7 @@ function _switchable(factories, sources, name$, switched = ['DOM'], stateSourceN
|
|
|
2127
2127
|
const definedSinks = sinks
|
|
2128
2128
|
.filter(([, sink]) => sink[sinkName] !== undefined)
|
|
2129
2129
|
.map(([, sink]) => sink[sinkName]);
|
|
2130
|
-
obj[sinkName] = xs.merge(...definedSinks);
|
|
2130
|
+
obj[sinkName] = xs$1.merge(...definedSinks);
|
|
2131
2131
|
}
|
|
2132
2132
|
return obj;
|
|
2133
2133
|
}, {});
|
|
@@ -2142,7 +2142,7 @@ Switchable.preventInstantiation = true;
|
|
|
2142
2142
|
|
|
2143
2143
|
function createCommand() {
|
|
2144
2144
|
const listener = { next: () => { } };
|
|
2145
|
-
const _stream = xs.create({
|
|
2145
|
+
const _stream = xs$1.create({
|
|
2146
2146
|
start(l) { listener.next = (val) => l.next(val); },
|
|
2147
2147
|
stop() { listener.next = () => { }; },
|
|
2148
2148
|
});
|
|
@@ -2438,7 +2438,7 @@ class Component {
|
|
|
2438
2438
|
// This is necessary to ensure that the component tree's state sink is subscribed to
|
|
2439
2439
|
if (!this.isSubComponent && typeof this.intent === 'undefined' && typeof this.model === 'undefined') {
|
|
2440
2440
|
this.initialState = initialState || true;
|
|
2441
|
-
this.intent = (_) => ({ __NOOP_ACTION__: xs.never() });
|
|
2441
|
+
this.intent = (_) => ({ __NOOP_ACTION__: xs$1.never() });
|
|
2442
2442
|
this.model = {
|
|
2443
2443
|
__NOOP_ACTION__: (state) => state
|
|
2444
2444
|
};
|
|
@@ -2447,12 +2447,12 @@ class Component {
|
|
|
2447
2447
|
this._activeSubComponents = new Map();
|
|
2448
2448
|
this._childReadyState = {};
|
|
2449
2449
|
this._readyChangedListener = null;
|
|
2450
|
-
this._readyChanged$ = xs.create({
|
|
2450
|
+
this._readyChanged$ = xs$1.create({
|
|
2451
2451
|
start: (listener) => { this._readyChangedListener = listener; },
|
|
2452
2452
|
stop: () => { },
|
|
2453
2453
|
});
|
|
2454
2454
|
this._disposeListener = null;
|
|
2455
|
-
this._dispose$ = xs.create({
|
|
2455
|
+
this._dispose$ = xs$1.create({
|
|
2456
2456
|
start: (listener) => { this._disposeListener = listener; },
|
|
2457
2457
|
stop: () => { },
|
|
2458
2458
|
});
|
|
@@ -2555,7 +2555,7 @@ class Component {
|
|
|
2555
2555
|
}
|
|
2556
2556
|
initHmrActions() {
|
|
2557
2557
|
if (typeof this.hmrActions === 'undefined') {
|
|
2558
|
-
this.hmrAction$ = xs.of().filter((_) => false);
|
|
2558
|
+
this.hmrAction$ = xs$1.of().filter((_) => false);
|
|
2559
2559
|
return;
|
|
2560
2560
|
}
|
|
2561
2561
|
if (typeof this.hmrActions === 'string') {
|
|
@@ -2567,12 +2567,12 @@ class Component {
|
|
|
2567
2567
|
if (this.hmrActions.some(action => typeof action !== 'string')) {
|
|
2568
2568
|
throw new Error(`[${this.name}] hmrActions must be the name of an action or an array of names of actions to run when a component is hot-reloaded`);
|
|
2569
2569
|
}
|
|
2570
|
-
this.hmrAction$ = xs.fromArray(this.hmrActions.map(action => ({ type: action })));
|
|
2570
|
+
this.hmrAction$ = xs$1.fromArray(this.hmrActions.map(action => ({ type: action })));
|
|
2571
2571
|
}
|
|
2572
2572
|
initAction$() {
|
|
2573
2573
|
const requestSource = (this.sources && this.sources[this.requestSourceName]) || null;
|
|
2574
2574
|
if (!this.intent$) {
|
|
2575
|
-
this.action$ = xs.never();
|
|
2575
|
+
this.action$ = xs$1.never();
|
|
2576
2576
|
return;
|
|
2577
2577
|
}
|
|
2578
2578
|
let runner;
|
|
@@ -2588,23 +2588,23 @@ class Component {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
const mapped = Object.entries(this.intent$)
|
|
2590
2590
|
.map(([type, data$]) => data$.map((data) => ({ type, data })));
|
|
2591
|
-
runner = xs.merge(xs.never(), ...mapped);
|
|
2591
|
+
runner = xs$1.merge(xs$1.never(), ...mapped);
|
|
2592
2592
|
}
|
|
2593
|
-
const action$ = ((runner instanceof Stream) ? runner : (runner.apply && runner(this.sources) || xs.never()));
|
|
2594
|
-
const bootstrap$ = xs.of({ type: BOOTSTRAP_ACTION }).compose(delay(10));
|
|
2593
|
+
const action$ = ((runner instanceof Stream) ? runner : (runner.apply && runner(this.sources) || xs$1.never()));
|
|
2594
|
+
const bootstrap$ = xs$1.of({ type: BOOTSTRAP_ACTION }).compose(delay(10));
|
|
2595
2595
|
const _hmrUpdating = typeof window !== 'undefined' && window.__SYGNAL_HMR_UPDATING === true;
|
|
2596
|
-
const hmrAction$ = _hmrUpdating ? this.hmrAction$ : xs.of().filter((_) => false);
|
|
2597
|
-
const wrapped$ = (this.model[BOOTSTRAP_ACTION] && !_hmrUpdating) ? concat(bootstrap$, action$) : concat(xs.of().compose(delay(1)).filter((_) => false), hmrAction$, action$);
|
|
2596
|
+
const hmrAction$ = _hmrUpdating ? this.hmrAction$ : xs$1.of().filter((_) => false);
|
|
2597
|
+
const wrapped$ = (this.model[BOOTSTRAP_ACTION] && !_hmrUpdating) ? concat(bootstrap$, action$) : concat(xs$1.of().compose(delay(1)).filter((_) => false), hmrAction$, action$);
|
|
2598
2598
|
let initialApiData;
|
|
2599
2599
|
if (!_hmrUpdating && requestSource && typeof requestSource.select == 'function') {
|
|
2600
2600
|
initialApiData = requestSource.select('initial')
|
|
2601
2601
|
.flatten();
|
|
2602
2602
|
}
|
|
2603
2603
|
else {
|
|
2604
|
-
initialApiData = xs.never();
|
|
2604
|
+
initialApiData = xs$1.never();
|
|
2605
2605
|
}
|
|
2606
2606
|
const hydrate$ = initialApiData.map((data) => ({ type: HYDRATE_ACTION, data }));
|
|
2607
|
-
this.action$ = xs.merge(wrapped$, hydrate$)
|
|
2607
|
+
this.action$ = xs$1.merge(wrapped$, hydrate$)
|
|
2608
2608
|
.compose(this.log(({ type }) => `<${type}> Action triggered`))
|
|
2609
2609
|
.map((action) => {
|
|
2610
2610
|
if (typeof window !== 'undefined' && window.__SYGNAL_DEVTOOLS__?.connected) {
|
|
@@ -2632,15 +2632,15 @@ class Component {
|
|
|
2632
2632
|
}
|
|
2633
2633
|
initContext() {
|
|
2634
2634
|
if (!this.context && !this.sources.__parentContext$) {
|
|
2635
|
-
this.context$ = xs.of({});
|
|
2635
|
+
this.context$ = xs$1.of({});
|
|
2636
2636
|
return;
|
|
2637
2637
|
}
|
|
2638
|
-
const state$ = this.sources[this.stateSourceName]?.stream.startWith({}).compose(dropRepeats(objIsEqual)) || xs.never();
|
|
2639
|
-
const parentContext$ = this.sources.__parentContext$?.startWith({}).compose(dropRepeats(objIsEqual)) || xs.of({});
|
|
2638
|
+
const state$ = this.sources[this.stateSourceName]?.stream.startWith({}).compose(dropRepeats(objIsEqual)) || xs$1.never();
|
|
2639
|
+
const parentContext$ = this.sources.__parentContext$?.startWith({}).compose(dropRepeats(objIsEqual)) || xs$1.of({});
|
|
2640
2640
|
if (this.context && !isObj(this.context)) {
|
|
2641
2641
|
console.error(`[${this.name}] Context must be an object mapping names to values of functions: ignoring provided ${typeof this.context}`);
|
|
2642
2642
|
}
|
|
2643
|
-
this.context$ = xs.combine(state$, parentContext$)
|
|
2643
|
+
this.context$ = xs$1.combine(state$, parentContext$)
|
|
2644
2644
|
.map(([_, parent]) => {
|
|
2645
2645
|
const _parent = isObj(parent) ? parent : {};
|
|
2646
2646
|
const context = isObj(this.context) ? this.context : {};
|
|
@@ -2679,7 +2679,7 @@ class Component {
|
|
|
2679
2679
|
initModel$() {
|
|
2680
2680
|
if (typeof this.model == 'undefined') {
|
|
2681
2681
|
this.model$ = this.sourceNames.reduce((a, s) => {
|
|
2682
|
-
a[s] = xs.never();
|
|
2682
|
+
a[s] = xs$1.never();
|
|
2683
2683
|
return a;
|
|
2684
2684
|
}, {});
|
|
2685
2685
|
return;
|
|
@@ -2692,7 +2692,7 @@ class Component {
|
|
|
2692
2692
|
}
|
|
2693
2693
|
const hasInitialState = (typeof effectiveInitialState !== 'undefined');
|
|
2694
2694
|
const shouldInjectInitialState = hasInitialState && (ENVIRONMENT?.__SYGNAL_HMR_UPDATING !== true || typeof hmrState !== 'undefined');
|
|
2695
|
-
const shimmed$ = shouldInjectInitialState ? concat(xs.of(initial), this.action$).compose(delay(0)) : this.action$;
|
|
2695
|
+
const shimmed$ = shouldInjectInitialState ? concat(xs$1.of(initial), this.action$).compose(delay(0)) : this.action$;
|
|
2696
2696
|
const onState = () => this.makeOnAction(shimmed$, true, this.action$);
|
|
2697
2697
|
const onNormal = () => this.makeOnAction(this.action$, false, this.action$);
|
|
2698
2698
|
const modelEntries = Object.entries(this.model);
|
|
@@ -2761,7 +2761,7 @@ class Component {
|
|
|
2761
2761
|
});
|
|
2762
2762
|
const model$ = Object.entries(reducers).reduce((acc, entry) => {
|
|
2763
2763
|
const [sink, streams] = entry;
|
|
2764
|
-
acc[sink] = xs.merge(xs.never(), ...streams);
|
|
2764
|
+
acc[sink] = xs$1.merge(xs$1.never(), ...streams);
|
|
2765
2765
|
return acc;
|
|
2766
2766
|
}, {});
|
|
2767
2767
|
this.model$ = model$;
|
|
@@ -2791,13 +2791,13 @@ class Component {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
initChildSources$() {
|
|
2793
2793
|
let newSourcesNext;
|
|
2794
|
-
const childSources$ = xs.create({
|
|
2794
|
+
const childSources$ = xs$1.create({
|
|
2795
2795
|
start: (listener) => {
|
|
2796
2796
|
newSourcesNext = listener.next.bind(listener);
|
|
2797
2797
|
},
|
|
2798
2798
|
stop: (_) => {
|
|
2799
2799
|
}
|
|
2800
|
-
}).map((sources) => xs.merge(...sources)).flatten();
|
|
2800
|
+
}).map((sources) => xs$1.merge(...sources)).flatten();
|
|
2801
2801
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
2802
2802
|
select: (nameOrComponent) => {
|
|
2803
2803
|
const all$ = childSources$;
|
|
@@ -2816,7 +2816,7 @@ class Component {
|
|
|
2816
2816
|
};
|
|
2817
2817
|
}
|
|
2818
2818
|
initSubComponentSink$() {
|
|
2819
|
-
const subComponentSink$ = xs.create({
|
|
2819
|
+
const subComponentSink$ = xs$1.create({
|
|
2820
2820
|
start: (listener) => {
|
|
2821
2821
|
this.newSubComponentSinks = listener.next.bind(listener);
|
|
2822
2822
|
},
|
|
@@ -2827,7 +2827,7 @@ class Component {
|
|
|
2827
2827
|
this.subComponentSink$ = subComponentSink$.filter((sinks) => Object.keys(sinks).length > 0);
|
|
2828
2828
|
}
|
|
2829
2829
|
initSubComponentsRendered$() {
|
|
2830
|
-
const stream = xs.create({
|
|
2830
|
+
const stream = xs$1.create({
|
|
2831
2831
|
start: (listener) => {
|
|
2832
2832
|
this.triggerSubComponentsRendered = listener.next.bind(listener);
|
|
2833
2833
|
},
|
|
@@ -2838,7 +2838,7 @@ class Component {
|
|
|
2838
2838
|
}
|
|
2839
2839
|
initVdom$() {
|
|
2840
2840
|
if (typeof this.view != 'function') {
|
|
2841
|
-
this.vdom$ = xs.of(null);
|
|
2841
|
+
this.vdom$ = xs$1.of(null);
|
|
2842
2842
|
return;
|
|
2843
2843
|
}
|
|
2844
2844
|
const renderParameters$ = this.collectRenderParameters();
|
|
@@ -2877,12 +2877,12 @@ class Component {
|
|
|
2877
2877
|
this.sinks = this.sourceNames.reduce((acc, name) => {
|
|
2878
2878
|
if (name == this.DOMSourceName)
|
|
2879
2879
|
return acc;
|
|
2880
|
-
const subComponentSink$ = (this.subComponentSink$ && name !== PARENT_SINK_NAME) ? this.subComponentSink$.map((sinks) => sinks[name]).filter((sink) => !!sink).flatten() : xs.never();
|
|
2880
|
+
const subComponentSink$ = (this.subComponentSink$ && name !== PARENT_SINK_NAME) ? this.subComponentSink$.map((sinks) => sinks[name]).filter((sink) => !!sink).flatten() : xs$1.never();
|
|
2881
2881
|
if (name === this.stateSourceName) {
|
|
2882
|
-
acc[name] = xs.merge((this.model$[name] || xs.never()), subComponentSink$, this.sources[this.stateSourceName].stream.filter((_) => false), ...(this.peers$[name] || []));
|
|
2882
|
+
acc[name] = xs$1.merge((this.model$[name] || xs$1.never()), subComponentSink$, this.sources[this.stateSourceName].stream.filter((_) => false), ...(this.peers$[name] || []));
|
|
2883
2883
|
}
|
|
2884
2884
|
else {
|
|
2885
|
-
acc[name] = xs.merge((this.model$[name] || xs.never()), subComponentSink$, ...(this.peers$[name] || []));
|
|
2885
|
+
acc[name] = xs$1.merge((this.model$[name] || xs$1.never()), subComponentSink$, ...(this.peers$[name] || []));
|
|
2886
2886
|
}
|
|
2887
2887
|
// Stamp EVENTS sink emissions with emitter component info for devtools
|
|
2888
2888
|
if (name === 'EVENTS' && acc[name]) {
|
|
@@ -2893,7 +2893,7 @@ class Component {
|
|
|
2893
2893
|
return acc;
|
|
2894
2894
|
}, {});
|
|
2895
2895
|
this.sinks[this.DOMSourceName] = this.vdom$;
|
|
2896
|
-
this.sinks[PARENT_SINK_NAME] = this.model$[PARENT_SINK_NAME] || xs.never();
|
|
2896
|
+
this.sinks[PARENT_SINK_NAME] = this.model$[PARENT_SINK_NAME] || xs$1.never();
|
|
2897
2897
|
// EFFECT sink: subscribe to trigger side effects but don't expose as a driver sink
|
|
2898
2898
|
if (this.model$[EFFECT_SINK_NAME]) {
|
|
2899
2899
|
const effectSub = this.model$[EFFECT_SINK_NAME].subscribe({
|
|
@@ -2915,7 +2915,7 @@ class Component {
|
|
|
2915
2915
|
this.sinks[READY_SINK_NAME].__explicitReady = true;
|
|
2916
2916
|
}
|
|
2917
2917
|
else {
|
|
2918
|
-
this.sinks[READY_SINK_NAME] = xs.of(true);
|
|
2918
|
+
this.sinks[READY_SINK_NAME] = xs$1.of(true);
|
|
2919
2919
|
}
|
|
2920
2920
|
}
|
|
2921
2921
|
makeOnAction(action$, isStateSink = true, rootAction$) {
|
|
@@ -3106,7 +3106,7 @@ class Component {
|
|
|
3106
3106
|
const state = this.sources[this.stateSourceName];
|
|
3107
3107
|
const renderParams = { ...this.peers$[this.DOMSourceName] };
|
|
3108
3108
|
const enhancedState = state && state.isolateSource(state, { get: (state) => this.addCalculated(state) });
|
|
3109
|
-
const stateStream = (enhancedState && enhancedState.stream) || xs.never();
|
|
3109
|
+
const stateStream = (enhancedState && enhancedState.stream) || xs$1.never();
|
|
3110
3110
|
renderParams.state = stateStream.compose(dropRepeats(objIsEqual));
|
|
3111
3111
|
if (this.sources.props$) {
|
|
3112
3112
|
renderParams.props = this.sources.props$.compose(dropRepeats(propsIsEqual));
|
|
@@ -3130,7 +3130,7 @@ class Component {
|
|
|
3130
3130
|
names.push(name);
|
|
3131
3131
|
streams.push(stream);
|
|
3132
3132
|
});
|
|
3133
|
-
const combined = xs.combine(...streams)
|
|
3133
|
+
const combined = xs$1.combine(...streams)
|
|
3134
3134
|
.compose(debounce(1))
|
|
3135
3135
|
// map the streams from an array back to an object with the render parameter names as the keys
|
|
3136
3136
|
.map((arr) => {
|
|
@@ -3189,8 +3189,8 @@ class Component {
|
|
|
3189
3189
|
addSinks(entry.sink$);
|
|
3190
3190
|
return acc;
|
|
3191
3191
|
}
|
|
3192
|
-
const props$ = xs.create().startWith(props);
|
|
3193
|
-
const children$ = xs.create().startWith(children);
|
|
3192
|
+
const props$ = xs$1.create().startWith(props);
|
|
3193
|
+
const children$ = xs$1.create().startWith(children);
|
|
3194
3194
|
let instantiator;
|
|
3195
3195
|
if (isCollection) {
|
|
3196
3196
|
instantiator = this.instantiateCollection.bind(this);
|
|
@@ -3218,9 +3218,9 @@ class Component {
|
|
|
3218
3218
|
console.error(`[${this.name}] Error in onError handler:`, fallbackErr);
|
|
3219
3219
|
}
|
|
3220
3220
|
}
|
|
3221
|
-
sink$ = { [this.DOMSourceName]: xs.of(fallbackVNode) };
|
|
3221
|
+
sink$ = { [this.DOMSourceName]: xs$1.of(fallbackVNode) };
|
|
3222
3222
|
}
|
|
3223
|
-
sink$[this.DOMSourceName] = sink$[this.DOMSourceName] ? this.makeCoordinatedSubComponentDomSink(sink$[this.DOMSourceName]) : xs.never();
|
|
3223
|
+
sink$[this.DOMSourceName] = sink$[this.DOMSourceName] ? this.makeCoordinatedSubComponentDomSink(sink$[this.DOMSourceName]) : xs$1.never();
|
|
3224
3224
|
acc[id] = { sink$, props$, children$ };
|
|
3225
3225
|
this._activeSubComponents.set(id, acc[id]);
|
|
3226
3226
|
addSinks(sink$);
|
|
@@ -3229,7 +3229,7 @@ class Component {
|
|
|
3229
3229
|
const mergedSinksByType = Object.entries(sinkArrsByType).reduce((acc, [name, streamArr]) => {
|
|
3230
3230
|
if (streamArr.length === 0)
|
|
3231
3231
|
return acc;
|
|
3232
|
-
acc[name] = streamArr.length === 1 ? streamArr[0] : xs.merge(...streamArr);
|
|
3232
|
+
acc[name] = streamArr.length === 1 ? streamArr[0] : xs$1.merge(...streamArr);
|
|
3233
3233
|
return acc;
|
|
3234
3234
|
}, {});
|
|
3235
3235
|
// Dispose removed sub-components
|
|
@@ -3268,7 +3268,7 @@ class Component {
|
|
|
3268
3268
|
filter,
|
|
3269
3269
|
sort
|
|
3270
3270
|
};
|
|
3271
|
-
const state$ = xs.combine(this.sources[this.stateSourceName].stream.startWith(this.currentState), props$.startWith(props))
|
|
3271
|
+
const state$ = xs$1.combine(this.sources[this.stateSourceName].stream.startWith(this.currentState), props$.startWith(props))
|
|
3272
3272
|
// this debounce is important. it forces state and prop updates to happen at the same time
|
|
3273
3273
|
// without this, changes to sort or filter won't happen properly
|
|
3274
3274
|
.compose(debounce(1))
|
|
@@ -3570,14 +3570,14 @@ class Component {
|
|
|
3570
3570
|
return sink$;
|
|
3571
3571
|
}
|
|
3572
3572
|
renderVdom(componentInstances$) {
|
|
3573
|
-
return xs.combine(this.subComponentsRendered$, componentInstances$, this._readyChanged$.startWith(null))
|
|
3573
|
+
return xs$1.combine(this.subComponentsRendered$, componentInstances$, this._readyChanged$.startWith(null))
|
|
3574
3574
|
.compose(debounce(1))
|
|
3575
3575
|
.map(([_, components]) => {
|
|
3576
3576
|
const componentNames = Object.keys(this.components);
|
|
3577
3577
|
const root = components['::ROOT::'];
|
|
3578
3578
|
const entries = Object.entries(components).filter(([id]) => id !== '::ROOT::');
|
|
3579
3579
|
if (entries.length === 0) {
|
|
3580
|
-
return xs.of(processSuspensePost(root));
|
|
3580
|
+
return xs$1.of(processSuspensePost(root));
|
|
3581
3581
|
}
|
|
3582
3582
|
const ids = [];
|
|
3583
3583
|
const vdom$ = entries
|
|
@@ -3586,7 +3586,7 @@ class Component {
|
|
|
3586
3586
|
return val.sink$[this.DOMSourceName].startWith(undefined);
|
|
3587
3587
|
});
|
|
3588
3588
|
if (vdom$.length === 0)
|
|
3589
|
-
return xs.of(root);
|
|
3589
|
+
return xs$1.of(root);
|
|
3590
3590
|
// Track READY state on the component instance (persists across folds)
|
|
3591
3591
|
for (const [id, val] of entries) {
|
|
3592
3592
|
if (this._childReadyState[id] !== undefined)
|
|
@@ -3619,7 +3619,7 @@ class Component {
|
|
|
3619
3619
|
this._childReadyState[id] = true;
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
|
-
return xs.combine(...vdom$)
|
|
3622
|
+
return xs$1.combine(...vdom$)
|
|
3623
3623
|
.compose(debounce(1))
|
|
3624
3624
|
.map((vdoms) => {
|
|
3625
3625
|
const withIds = vdoms.reduce((acc, vdom, index) => {
|
|
@@ -5900,7 +5900,7 @@ function createRef() {
|
|
|
5900
5900
|
}
|
|
5901
5901
|
function createRef$() {
|
|
5902
5902
|
const listener = { next: () => { } };
|
|
5903
|
-
const stream = xs.createWithMemory({
|
|
5903
|
+
const stream = xs$1.createWithMemory({
|
|
5904
5904
|
start(l) { listener.next = (val) => l.next(val); },
|
|
5905
5905
|
stop() { listener.next = () => { }; },
|
|
5906
5906
|
});
|
|
@@ -5945,7 +5945,7 @@ function renderComponent(componentDef, options = {}) {
|
|
|
5945
5945
|
// The component's intent function will receive this as a source,
|
|
5946
5946
|
// and we merge test actions with any real intent streams.
|
|
5947
5947
|
const testActionListener = { next: () => { } };
|
|
5948
|
-
const testAction$ = xs.create({
|
|
5948
|
+
const testAction$ = xs$1.create({
|
|
5949
5949
|
start(listener) {
|
|
5950
5950
|
testActionListener.next = (val) => listener.next(val);
|
|
5951
5951
|
},
|
|
@@ -6041,7 +6041,7 @@ function renderComponent(componentDef, options = {}) {
|
|
|
6041
6041
|
// Collect state values
|
|
6042
6042
|
const states = [];
|
|
6043
6043
|
let stateListener = null;
|
|
6044
|
-
const stateStream = sources.STATE && sources.STATE.stream ? sources.STATE.stream : xs.never();
|
|
6044
|
+
const stateStream = sources.STATE && sources.STATE.stream ? sources.STATE.stream : xs$1.never();
|
|
6045
6045
|
stateListener = {
|
|
6046
6046
|
next: (s) => states.push(s),
|
|
6047
6047
|
error: () => { },
|
|
@@ -6112,8 +6112,8 @@ function renderComponent(componentDef, options = {}) {
|
|
|
6112
6112
|
};
|
|
6113
6113
|
return {
|
|
6114
6114
|
state$: stateStream,
|
|
6115
|
-
dom$: sinks.DOM || xs.never(),
|
|
6116
|
-
events$: sources.EVENTS || { select: () => xs.never() },
|
|
6115
|
+
dom$: sinks.DOM || xs$1.never(),
|
|
6116
|
+
events$: sources.EVENTS || { select: () => xs$1.never() },
|
|
6117
6117
|
sinks,
|
|
6118
6118
|
sources,
|
|
6119
6119
|
simulateAction,
|
|
@@ -6180,6 +6180,7 @@ function emit(type, data) {
|
|
|
6180
6180
|
};
|
|
6181
6181
|
}
|
|
6182
6182
|
|
|
6183
|
+
const xs = xs$1;
|
|
6183
6184
|
// ── makeServiceWorkerDriver ──────────────────────────────────
|
|
6184
6185
|
function trackWorker(worker, events) {
|
|
6185
6186
|
const emit = (type, data) => events.dispatchEvent(new CustomEvent('data', { detail: { type, data } }));
|
|
@@ -6246,7 +6247,7 @@ function makeServiceWorkerDriver(scriptUrl, options = {}) {
|
|
|
6246
6247
|
return {
|
|
6247
6248
|
select(type) {
|
|
6248
6249
|
let cb;
|
|
6249
|
-
const in$ =
|
|
6250
|
+
const in$ = xs.create({
|
|
6250
6251
|
start: (listener) => {
|
|
6251
6252
|
cb = ({ detail }) => {
|
|
6252
6253
|
if (!type || detail.type === type)
|
|
@@ -6265,30 +6266,30 @@ function makeServiceWorkerDriver(scriptUrl, options = {}) {
|
|
|
6265
6266
|
};
|
|
6266
6267
|
}
|
|
6267
6268
|
// ── onlineStatus$ ────────────────────────────────────────────
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
}
|
|
6291
|
-
|
|
6269
|
+
// Lazy — the real stream is created on first subscribe so importing
|
|
6270
|
+
// sygnal in SSR doesn't eagerly reference window/navigator.
|
|
6271
|
+
let _onlineCleanup;
|
|
6272
|
+
const onlineStatus$ = xs.create({
|
|
6273
|
+
start(listener) {
|
|
6274
|
+
if (typeof window === 'undefined') {
|
|
6275
|
+
listener.next(true);
|
|
6276
|
+
return;
|
|
6277
|
+
}
|
|
6278
|
+
listener.next(navigator.onLine);
|
|
6279
|
+
const on = () => listener.next(true);
|
|
6280
|
+
const off = () => listener.next(false);
|
|
6281
|
+
window.addEventListener('online', on);
|
|
6282
|
+
window.addEventListener('offline', off);
|
|
6283
|
+
_onlineCleanup = () => {
|
|
6284
|
+
window.removeEventListener('online', on);
|
|
6285
|
+
window.removeEventListener('offline', off);
|
|
6286
|
+
};
|
|
6287
|
+
},
|
|
6288
|
+
stop() {
|
|
6289
|
+
_onlineCleanup?.();
|
|
6290
|
+
_onlineCleanup = undefined;
|
|
6291
|
+
},
|
|
6292
|
+
});
|
|
6292
6293
|
// ── createInstallPrompt ──────────────────────────────────────
|
|
6293
6294
|
function createInstallPrompt() {
|
|
6294
6295
|
let deferredPrompt = null;
|
|
@@ -6307,7 +6308,7 @@ function createInstallPrompt() {
|
|
|
6307
6308
|
return {
|
|
6308
6309
|
select(type) {
|
|
6309
6310
|
let cb;
|
|
6310
|
-
const in$ =
|
|
6311
|
+
const in$ = xs.create({
|
|
6311
6312
|
start: (listener) => {
|
|
6312
6313
|
cb = ({ detail }) => {
|
|
6313
6314
|
if (detail.type === type)
|
|
@@ -6995,4 +6996,4 @@ function buildAttributes(data, selectorId, selectorClasses) {
|
|
|
6995
6996
|
return result;
|
|
6996
6997
|
}
|
|
6997
6998
|
|
|
6998
|
-
export { ABORT, Collection, MainDOMSource, MockedDOMSource, Portal, Slot, Suspense, Switchable, Transition, classes, collection, component, createCommand, createElement, createInstallPrompt, createRef, createRef$, driverFromAsync, emit, enableHMR, exactState, getDevTools, lazy, makeDOMDriver, makeDragDriver, makeServiceWorkerDriver, mockDOMSource, onlineStatus$, Portal as portal, processDrag, processForm, renderComponent, renderToString, run, set, switchable, thunk, toggle, xs };
|
|
6999
|
+
export { ABORT, Collection, MainDOMSource, MockedDOMSource, Portal, Slot, Suspense, Switchable, Transition, classes, collection, component, createCommand, createElement, createInstallPrompt, createRef, createRef$, driverFromAsync, emit, enableHMR, exactState, getDevTools, lazy, makeDOMDriver, makeDragDriver, makeServiceWorkerDriver, mockDOMSource, onlineStatus$, Portal as portal, processDrag, processForm, renderComponent, renderToString, run, set, switchable, thunk, toggle, xs$1 as xs };
|