@builder.io/sdk-qwik 0.12.5 → 0.12.6
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/lib/browser/index.qwik.cjs +22 -11
- package/lib/browser/index.qwik.mjs +22 -11
- package/lib/edge/index.qwik.cjs +22 -11
- package/lib/edge/index.qwik.mjs +22 -11
- package/lib/node/index.qwik.cjs +22 -11
- package/lib/node/index.qwik.mjs +22 -11
- package/package.json +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/evaluate/browser-runtime/browser.d.ts +5 -1
|
@@ -182,24 +182,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
182
182
|
builder,
|
|
183
183
|
context,
|
|
184
184
|
event,
|
|
185
|
-
state: flattenState(
|
|
185
|
+
state: flattenState({
|
|
186
|
+
rootState,
|
|
187
|
+
localState,
|
|
188
|
+
rootSetState
|
|
189
|
+
})
|
|
186
190
|
});
|
|
187
191
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
188
192
|
};
|
|
189
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
190
|
-
if (rootState === localState)
|
|
191
|
-
throw new Error("rootState === localState");
|
|
193
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
192
194
|
return new Proxy(rootState, {
|
|
193
|
-
get: (
|
|
195
|
+
get: (target, prop) => {
|
|
194
196
|
if (localState && prop in localState)
|
|
195
197
|
return localState[prop];
|
|
196
|
-
|
|
198
|
+
const val = target[prop];
|
|
199
|
+
if (typeof val === "object")
|
|
200
|
+
return flattenState({
|
|
201
|
+
rootState: val,
|
|
202
|
+
localState: void 0,
|
|
203
|
+
rootSetState: rootSetState ? (subState) => {
|
|
204
|
+
target[prop] = subState;
|
|
205
|
+
rootSetState(target);
|
|
206
|
+
} : void 0
|
|
207
|
+
});
|
|
208
|
+
return val;
|
|
197
209
|
},
|
|
198
|
-
set: (
|
|
210
|
+
set: (target, prop, value) => {
|
|
199
211
|
if (localState && prop in localState)
|
|
200
212
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
201
|
-
|
|
202
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
213
|
+
target[prop] = value;
|
|
214
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
203
215
|
return true;
|
|
204
216
|
}
|
|
205
217
|
});
|
|
@@ -3343,7 +3355,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3343
3355
|
}
|
|
3344
3356
|
};
|
|
3345
3357
|
};
|
|
3346
|
-
const SDK_VERSION = "0.12.
|
|
3358
|
+
const SDK_VERSION = "0.12.6";
|
|
3347
3359
|
const registry = {};
|
|
3348
3360
|
function register(type, info) {
|
|
3349
3361
|
let typeList = registry[type];
|
|
@@ -3738,7 +3750,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3738
3750
|
var _a2, _b2;
|
|
3739
3751
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
3740
3752
|
});
|
|
3741
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
3742
3753
|
evaluateJsCode(props2);
|
|
3743
3754
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
3744
3755
|
elementRef,
|
|
@@ -180,24 +180,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
180
180
|
builder,
|
|
181
181
|
context,
|
|
182
182
|
event,
|
|
183
|
-
state: flattenState(
|
|
183
|
+
state: flattenState({
|
|
184
|
+
rootState,
|
|
185
|
+
localState,
|
|
186
|
+
rootSetState
|
|
187
|
+
})
|
|
184
188
|
});
|
|
185
189
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
186
190
|
};
|
|
187
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
188
|
-
if (rootState === localState)
|
|
189
|
-
throw new Error("rootState === localState");
|
|
191
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
190
192
|
return new Proxy(rootState, {
|
|
191
|
-
get: (
|
|
193
|
+
get: (target, prop) => {
|
|
192
194
|
if (localState && prop in localState)
|
|
193
195
|
return localState[prop];
|
|
194
|
-
|
|
196
|
+
const val = target[prop];
|
|
197
|
+
if (typeof val === "object")
|
|
198
|
+
return flattenState({
|
|
199
|
+
rootState: val,
|
|
200
|
+
localState: void 0,
|
|
201
|
+
rootSetState: rootSetState ? (subState) => {
|
|
202
|
+
target[prop] = subState;
|
|
203
|
+
rootSetState(target);
|
|
204
|
+
} : void 0
|
|
205
|
+
});
|
|
206
|
+
return val;
|
|
195
207
|
},
|
|
196
|
-
set: (
|
|
208
|
+
set: (target, prop, value) => {
|
|
197
209
|
if (localState && prop in localState)
|
|
198
210
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
199
|
-
|
|
200
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
211
|
+
target[prop] = value;
|
|
212
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
201
213
|
return true;
|
|
202
214
|
}
|
|
203
215
|
});
|
|
@@ -3341,7 +3353,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3341
3353
|
}
|
|
3342
3354
|
};
|
|
3343
3355
|
};
|
|
3344
|
-
const SDK_VERSION = "0.12.
|
|
3356
|
+
const SDK_VERSION = "0.12.6";
|
|
3345
3357
|
const registry = {};
|
|
3346
3358
|
function register(type, info) {
|
|
3347
3359
|
let typeList = registry[type];
|
|
@@ -3736,7 +3748,6 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
3736
3748
|
var _a2, _b2;
|
|
3737
3749
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
3738
3750
|
});
|
|
3739
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
3740
3751
|
evaluateJsCode(props2);
|
|
3741
3752
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
3742
3753
|
elementRef,
|
package/lib/edge/index.qwik.cjs
CHANGED
|
@@ -182,24 +182,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
182
182
|
builder,
|
|
183
183
|
context,
|
|
184
184
|
event,
|
|
185
|
-
state: flattenState(
|
|
185
|
+
state: flattenState({
|
|
186
|
+
rootState,
|
|
187
|
+
localState,
|
|
188
|
+
rootSetState
|
|
189
|
+
})
|
|
186
190
|
});
|
|
187
191
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
188
192
|
};
|
|
189
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
190
|
-
if (rootState === localState)
|
|
191
|
-
throw new Error("rootState === localState");
|
|
193
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
192
194
|
return new Proxy(rootState, {
|
|
193
|
-
get: (
|
|
195
|
+
get: (target, prop) => {
|
|
194
196
|
if (localState && prop in localState)
|
|
195
197
|
return localState[prop];
|
|
196
|
-
|
|
198
|
+
const val = target[prop];
|
|
199
|
+
if (typeof val === "object")
|
|
200
|
+
return flattenState({
|
|
201
|
+
rootState: val,
|
|
202
|
+
localState: void 0,
|
|
203
|
+
rootSetState: rootSetState ? (subState) => {
|
|
204
|
+
target[prop] = subState;
|
|
205
|
+
rootSetState(target);
|
|
206
|
+
} : void 0
|
|
207
|
+
});
|
|
208
|
+
return val;
|
|
197
209
|
},
|
|
198
|
-
set: (
|
|
210
|
+
set: (target, prop, value) => {
|
|
199
211
|
if (localState && prop in localState)
|
|
200
212
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
201
|
-
|
|
202
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
213
|
+
target[prop] = value;
|
|
214
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
203
215
|
return true;
|
|
204
216
|
}
|
|
205
217
|
});
|
|
@@ -6574,7 +6586,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
6574
6586
|
}
|
|
6575
6587
|
};
|
|
6576
6588
|
};
|
|
6577
|
-
const SDK_VERSION = "0.12.
|
|
6589
|
+
const SDK_VERSION = "0.12.6";
|
|
6578
6590
|
const registry = {};
|
|
6579
6591
|
function register(type, info) {
|
|
6580
6592
|
let typeList = registry[type];
|
|
@@ -6969,7 +6981,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
6969
6981
|
var _a2, _b2;
|
|
6970
6982
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
6971
6983
|
});
|
|
6972
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
6973
6984
|
evaluateJsCode(props2);
|
|
6974
6985
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
6975
6986
|
elementRef,
|
package/lib/edge/index.qwik.mjs
CHANGED
|
@@ -180,24 +180,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
180
180
|
builder,
|
|
181
181
|
context,
|
|
182
182
|
event,
|
|
183
|
-
state: flattenState(
|
|
183
|
+
state: flattenState({
|
|
184
|
+
rootState,
|
|
185
|
+
localState,
|
|
186
|
+
rootSetState
|
|
187
|
+
})
|
|
184
188
|
});
|
|
185
189
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
186
190
|
};
|
|
187
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
188
|
-
if (rootState === localState)
|
|
189
|
-
throw new Error("rootState === localState");
|
|
191
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
190
192
|
return new Proxy(rootState, {
|
|
191
|
-
get: (
|
|
193
|
+
get: (target, prop) => {
|
|
192
194
|
if (localState && prop in localState)
|
|
193
195
|
return localState[prop];
|
|
194
|
-
|
|
196
|
+
const val = target[prop];
|
|
197
|
+
if (typeof val === "object")
|
|
198
|
+
return flattenState({
|
|
199
|
+
rootState: val,
|
|
200
|
+
localState: void 0,
|
|
201
|
+
rootSetState: rootSetState ? (subState) => {
|
|
202
|
+
target[prop] = subState;
|
|
203
|
+
rootSetState(target);
|
|
204
|
+
} : void 0
|
|
205
|
+
});
|
|
206
|
+
return val;
|
|
195
207
|
},
|
|
196
|
-
set: (
|
|
208
|
+
set: (target, prop, value) => {
|
|
197
209
|
if (localState && prop in localState)
|
|
198
210
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
199
|
-
|
|
200
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
211
|
+
target[prop] = value;
|
|
212
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
201
213
|
return true;
|
|
202
214
|
}
|
|
203
215
|
});
|
|
@@ -6572,7 +6584,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
6572
6584
|
}
|
|
6573
6585
|
};
|
|
6574
6586
|
};
|
|
6575
|
-
const SDK_VERSION = "0.12.
|
|
6587
|
+
const SDK_VERSION = "0.12.6";
|
|
6576
6588
|
const registry = {};
|
|
6577
6589
|
function register(type, info) {
|
|
6578
6590
|
let typeList = registry[type];
|
|
@@ -6967,7 +6979,6 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
6967
6979
|
var _a2, _b2;
|
|
6968
6980
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
6969
6981
|
});
|
|
6970
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
6971
6982
|
evaluateJsCode(props2);
|
|
6972
6983
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
6973
6984
|
elementRef,
|
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -184,24 +184,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
184
184
|
builder,
|
|
185
185
|
context,
|
|
186
186
|
event,
|
|
187
|
-
state: flattenState(
|
|
187
|
+
state: flattenState({
|
|
188
|
+
rootState,
|
|
189
|
+
localState,
|
|
190
|
+
rootSetState
|
|
191
|
+
})
|
|
188
192
|
});
|
|
189
193
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
190
194
|
};
|
|
191
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
192
|
-
if (rootState === localState)
|
|
193
|
-
throw new Error("rootState === localState");
|
|
195
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
194
196
|
return new Proxy(rootState, {
|
|
195
|
-
get: (
|
|
197
|
+
get: (target, prop) => {
|
|
196
198
|
if (localState && prop in localState)
|
|
197
199
|
return localState[prop];
|
|
198
|
-
|
|
200
|
+
const val = target[prop];
|
|
201
|
+
if (typeof val === "object")
|
|
202
|
+
return flattenState({
|
|
203
|
+
rootState: val,
|
|
204
|
+
localState: void 0,
|
|
205
|
+
rootSetState: rootSetState ? (subState) => {
|
|
206
|
+
target[prop] = subState;
|
|
207
|
+
rootSetState(target);
|
|
208
|
+
} : void 0
|
|
209
|
+
});
|
|
210
|
+
return val;
|
|
199
211
|
},
|
|
200
|
-
set: (
|
|
212
|
+
set: (target, prop, value) => {
|
|
201
213
|
if (localState && prop in localState)
|
|
202
214
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
203
|
-
|
|
204
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
215
|
+
target[prop] = value;
|
|
216
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
205
217
|
return true;
|
|
206
218
|
}
|
|
207
219
|
});
|
|
@@ -3444,7 +3456,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3444
3456
|
}
|
|
3445
3457
|
};
|
|
3446
3458
|
};
|
|
3447
|
-
const SDK_VERSION = "0.12.
|
|
3459
|
+
const SDK_VERSION = "0.12.6";
|
|
3448
3460
|
const registry = {};
|
|
3449
3461
|
function register(type, info) {
|
|
3450
3462
|
let typeList = registry[type];
|
|
@@ -3839,7 +3851,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3839
3851
|
var _a2, _b2;
|
|
3840
3852
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
3841
3853
|
});
|
|
3842
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
3843
3854
|
evaluateJsCode(props2);
|
|
3844
3855
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
3845
3856
|
elementRef,
|
package/lib/node/index.qwik.mjs
CHANGED
|
@@ -182,24 +182,36 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
182
182
|
builder,
|
|
183
183
|
context,
|
|
184
184
|
event,
|
|
185
|
-
state: flattenState(
|
|
185
|
+
state: flattenState({
|
|
186
|
+
rootState,
|
|
187
|
+
localState,
|
|
188
|
+
rootSetState
|
|
189
|
+
})
|
|
186
190
|
});
|
|
187
191
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
188
192
|
};
|
|
189
|
-
function flattenState(rootState, localState, rootSetState) {
|
|
190
|
-
if (rootState === localState)
|
|
191
|
-
throw new Error("rootState === localState");
|
|
193
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
192
194
|
return new Proxy(rootState, {
|
|
193
|
-
get: (
|
|
195
|
+
get: (target, prop) => {
|
|
194
196
|
if (localState && prop in localState)
|
|
195
197
|
return localState[prop];
|
|
196
|
-
|
|
198
|
+
const val = target[prop];
|
|
199
|
+
if (typeof val === "object")
|
|
200
|
+
return flattenState({
|
|
201
|
+
rootState: val,
|
|
202
|
+
localState: void 0,
|
|
203
|
+
rootSetState: rootSetState ? (subState) => {
|
|
204
|
+
target[prop] = subState;
|
|
205
|
+
rootSetState(target);
|
|
206
|
+
} : void 0
|
|
207
|
+
});
|
|
208
|
+
return val;
|
|
197
209
|
},
|
|
198
|
-
set: (
|
|
210
|
+
set: (target, prop, value) => {
|
|
199
211
|
if (localState && prop in localState)
|
|
200
212
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
201
|
-
|
|
202
|
-
rootSetState == null ? void 0 : rootSetState(
|
|
213
|
+
target[prop] = value;
|
|
214
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
203
215
|
return true;
|
|
204
216
|
}
|
|
205
217
|
});
|
|
@@ -3442,7 +3454,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3442
3454
|
}
|
|
3443
3455
|
};
|
|
3444
3456
|
};
|
|
3445
|
-
const SDK_VERSION = "0.12.
|
|
3457
|
+
const SDK_VERSION = "0.12.6";
|
|
3446
3458
|
const registry = {};
|
|
3447
3459
|
function register(type, info) {
|
|
3448
3460
|
let typeList = registry[type];
|
|
@@ -3837,7 +3849,6 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
3837
3849
|
var _a2, _b2;
|
|
3838
3850
|
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
3839
3851
|
});
|
|
3840
|
-
track2(() => props2.builderContextSignal.rootState);
|
|
3841
3852
|
evaluateJsCode(props2);
|
|
3842
3853
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
3843
3854
|
elementRef,
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.12.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.6";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { BuilderRenderState } from '../../../context/types.js';
|
|
2
2
|
import type { ExecutorArgs } from '../helpers.js';
|
|
3
3
|
export declare const runInBrowser: ({ code, builder, context, event, localState, rootSetState, rootState }: ExecutorArgs) => any;
|
|
4
|
-
export declare function flattenState(rootState
|
|
4
|
+
export declare function flattenState({ rootState, localState, rootSetState }: {
|
|
5
|
+
rootState: Record<string | symbol, any>;
|
|
6
|
+
localState: Record<string | symbol, any> | undefined;
|
|
7
|
+
rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
|
|
8
|
+
}): BuilderRenderState;
|