@timeax/digital-service-engine 0.1.0 → 0.2.1
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/core/index.cjs +64 -22
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +9 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.js +64 -22
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.cjs +66 -22
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +9 -0
- package/dist/react/index.d.ts +9 -0
- package/dist/react/index.js +66 -22
- package/dist/react/index.js.map +1 -1
- package/dist/schema/index.d.cts +5 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/workspace/index.cjs +145 -86
- package/dist/workspace/index.cjs.map +1 -1
- package/dist/workspace/index.d.cts +15 -0
- package/dist/workspace/index.d.ts +15 -0
- package/dist/workspace/index.js +145 -86
- package/dist/workspace/index.js.map +1 -1
- package/package.json +1 -1
package/dist/schema/index.d.cts
CHANGED
|
@@ -224,6 +224,11 @@ type ValidatorOptions = {
|
|
|
224
224
|
selectedOptionKeys?: string[];
|
|
225
225
|
globalUtilityGuard?: boolean;
|
|
226
226
|
policies?: DynamicRule[];
|
|
227
|
+
/**
|
|
228
|
+
* Global/base rate policy used by validation and service filtering.
|
|
229
|
+
* This is intentionally separate from fallbackSettings.ratePolicy.
|
|
230
|
+
*/
|
|
231
|
+
ratePolicy?: RatePolicy;
|
|
227
232
|
fallbackSettings?: FallbackSettings;
|
|
228
233
|
};
|
|
229
234
|
type RatePolicy = {
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -224,6 +224,11 @@ type ValidatorOptions = {
|
|
|
224
224
|
selectedOptionKeys?: string[];
|
|
225
225
|
globalUtilityGuard?: boolean;
|
|
226
226
|
policies?: DynamicRule[];
|
|
227
|
+
/**
|
|
228
|
+
* Global/base rate policy used by validation and service filtering.
|
|
229
|
+
* This is intentionally separate from fallbackSettings.ratePolicy.
|
|
230
|
+
*/
|
|
231
|
+
ratePolicy?: RatePolicy;
|
|
227
232
|
fallbackSettings?: FallbackSettings;
|
|
228
233
|
};
|
|
229
234
|
type RatePolicy = {
|
package/dist/workspace/index.cjs
CHANGED
|
@@ -4764,15 +4764,13 @@ function rateOk(svcMap, candidate, primary, policy) {
|
|
|
4764
4764
|
|
|
4765
4765
|
// src/core/validate/steps/rates.ts
|
|
4766
4766
|
function validateRates(v) {
|
|
4767
|
-
var _a, _b, _c
|
|
4768
|
-
const ratePolicy = normalizeRatePolicy(
|
|
4769
|
-
(_a = v.options.fallbackSettings) == null ? void 0 : _a.ratePolicy
|
|
4770
|
-
);
|
|
4767
|
+
var _a, _b, _c;
|
|
4768
|
+
const ratePolicy = normalizeRatePolicy(v.options.ratePolicy);
|
|
4771
4769
|
for (const f of v.fields) {
|
|
4772
4770
|
if (!isMultiField(f)) continue;
|
|
4773
4771
|
const baseRates = [];
|
|
4774
|
-
for (const o of (
|
|
4775
|
-
const role = (
|
|
4772
|
+
for (const o of (_a = f.options) != null ? _a : []) {
|
|
4773
|
+
const role = (_c = (_b = o.pricing_role) != null ? _b : f.pricing_role) != null ? _c : "base";
|
|
4776
4774
|
if (role !== "base") continue;
|
|
4777
4775
|
const sid = o.service_id;
|
|
4778
4776
|
if (!isServiceIdRef(sid)) continue;
|
|
@@ -5546,6 +5544,38 @@ function applyPolicies(errors, props, serviceMap, policies, fieldsVisibleUnder,
|
|
|
5546
5544
|
}
|
|
5547
5545
|
}
|
|
5548
5546
|
|
|
5547
|
+
// src/core/governance.ts
|
|
5548
|
+
var DEFAULT_FALLBACK_SETTINGS = {
|
|
5549
|
+
requireConstraintFit: true,
|
|
5550
|
+
ratePolicy: { kind: "lte_primary", pct: 5 },
|
|
5551
|
+
selectionStrategy: "priority",
|
|
5552
|
+
mode: "strict"
|
|
5553
|
+
};
|
|
5554
|
+
function resolveGlobalRatePolicy(options) {
|
|
5555
|
+
return normalizeRatePolicy(options.ratePolicy);
|
|
5556
|
+
}
|
|
5557
|
+
function resolveFallbackSettings(options) {
|
|
5558
|
+
var _a;
|
|
5559
|
+
return {
|
|
5560
|
+
...DEFAULT_FALLBACK_SETTINGS,
|
|
5561
|
+
...(_a = options.fallbackSettings) != null ? _a : {}
|
|
5562
|
+
};
|
|
5563
|
+
}
|
|
5564
|
+
function mergeValidatorOptions(defaults = {}, overrides = {}) {
|
|
5565
|
+
var _a, _b, _c, _d;
|
|
5566
|
+
const mergedFallbackSettings = {
|
|
5567
|
+
...(_a = defaults.fallbackSettings) != null ? _a : {},
|
|
5568
|
+
...(_b = overrides.fallbackSettings) != null ? _b : {}
|
|
5569
|
+
};
|
|
5570
|
+
return {
|
|
5571
|
+
...defaults,
|
|
5572
|
+
...overrides,
|
|
5573
|
+
policies: (_c = overrides.policies) != null ? _c : defaults.policies,
|
|
5574
|
+
ratePolicy: (_d = overrides.ratePolicy) != null ? _d : defaults.ratePolicy,
|
|
5575
|
+
fallbackSettings: Object.keys(mergedFallbackSettings).length > 0 ? mergedFallbackSettings : void 0
|
|
5576
|
+
};
|
|
5577
|
+
}
|
|
5578
|
+
|
|
5549
5579
|
// src/core/builder.ts
|
|
5550
5580
|
var import_lodash_es2 = require("lodash-es");
|
|
5551
5581
|
function createBuilder(opts = {}) {
|
|
@@ -5788,7 +5818,7 @@ var BuilderImpl = class {
|
|
|
5788
5818
|
return out;
|
|
5789
5819
|
}
|
|
5790
5820
|
errors() {
|
|
5791
|
-
return validate(this.props, this.options);
|
|
5821
|
+
return validate(this.props, mergeValidatorOptions({}, this.options));
|
|
5792
5822
|
}
|
|
5793
5823
|
getOptions() {
|
|
5794
5824
|
return (0, import_lodash_es2.cloneDeep)(this.options);
|
|
@@ -6075,11 +6105,14 @@ function readVisibilitySimOpts(ctx) {
|
|
|
6075
6105
|
};
|
|
6076
6106
|
}
|
|
6077
6107
|
function validate(props, ctx = {}) {
|
|
6078
|
-
var _a, _b, _c
|
|
6108
|
+
var _a, _b, _c;
|
|
6109
|
+
const options = mergeValidatorOptions({}, ctx);
|
|
6110
|
+
const fallbackSettings = resolveFallbackSettings(options);
|
|
6111
|
+
const ratePolicy = resolveGlobalRatePolicy(options);
|
|
6079
6112
|
const errors = [];
|
|
6080
|
-
const serviceMap = (_a =
|
|
6113
|
+
const serviceMap = (_a = options.serviceMap) != null ? _a : {};
|
|
6081
6114
|
const selectedKeys = new Set(
|
|
6082
|
-
(_b =
|
|
6115
|
+
(_b = options.selectedOptionKeys) != null ? _b : []
|
|
6083
6116
|
);
|
|
6084
6117
|
const tags = Array.isArray(props.filters) ? props.filters : [];
|
|
6085
6118
|
const fields = Array.isArray(props.fields) ? props.fields : [];
|
|
@@ -6089,8 +6122,12 @@ function validate(props, ctx = {}) {
|
|
|
6089
6122
|
for (const f of fields) fieldById.set(f.id, f);
|
|
6090
6123
|
const v = {
|
|
6091
6124
|
props,
|
|
6092
|
-
nodeMap: (_c =
|
|
6093
|
-
options:
|
|
6125
|
+
nodeMap: (_c = options.nodeMap) != null ? _c : buildNodeMap(props),
|
|
6126
|
+
options: {
|
|
6127
|
+
...options,
|
|
6128
|
+
ratePolicy,
|
|
6129
|
+
fallbackSettings
|
|
6130
|
+
},
|
|
6094
6131
|
errors,
|
|
6095
6132
|
serviceMap,
|
|
6096
6133
|
selectedKeys,
|
|
@@ -6105,7 +6142,7 @@ function validate(props, ctx = {}) {
|
|
|
6105
6142
|
validateIdentity(v);
|
|
6106
6143
|
validateOptionMaps(v);
|
|
6107
6144
|
v.fieldsVisibleUnder = createFieldsVisibleUnder(v);
|
|
6108
|
-
const visSim = readVisibilitySimOpts(
|
|
6145
|
+
const visSim = readVisibilitySimOpts(options);
|
|
6109
6146
|
validateVisibility(v, visSim);
|
|
6110
6147
|
applyPolicies(
|
|
6111
6148
|
v.errors,
|
|
@@ -6126,7 +6163,7 @@ function validate(props, ctx = {}) {
|
|
|
6126
6163
|
builder,
|
|
6127
6164
|
services: serviceMap,
|
|
6128
6165
|
tagId: tag.id,
|
|
6129
|
-
ratePolicy
|
|
6166
|
+
ratePolicy,
|
|
6130
6167
|
invalidFieldIds: v.invalidRateFieldIds
|
|
6131
6168
|
});
|
|
6132
6169
|
for (const diag of diags) {
|
|
@@ -6695,18 +6732,23 @@ function createNodeIndex(builder) {
|
|
|
6695
6732
|
|
|
6696
6733
|
// src/core/service-filter.ts
|
|
6697
6734
|
function filterServicesForVisibleGroup(input, deps) {
|
|
6698
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6735
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
6699
6736
|
const svcMap = (_c = (_b = (_a = deps.builder).getServiceMap) == null ? void 0 : _b.call(_a)) != null ? _c : {};
|
|
6737
|
+
const builderOptions = (_e = (_d = deps.builder).getOptions) == null ? void 0 : _e.call(_d);
|
|
6700
6738
|
const { context } = input;
|
|
6701
6739
|
const usedSet = new Set(context.usedServiceIds.map(String));
|
|
6702
6740
|
const primary = context.usedServiceIds[0];
|
|
6741
|
+
const explicitFallbackSettings = (_f = context.fallbackSettings) != null ? _f : context.fallback;
|
|
6742
|
+
const resolvedRatePolicy = normalizeRatePolicy(
|
|
6743
|
+
(_h = (_g = context.ratePolicy) != null ? _g : explicitFallbackSettings == null ? void 0 : explicitFallbackSettings.ratePolicy) != null ? _h : builderOptions == null ? void 0 : builderOptions.ratePolicy
|
|
6744
|
+
);
|
|
6745
|
+
const fallbackSettingsSource = explicitFallbackSettings != null ? explicitFallbackSettings : builderOptions == null ? void 0 : builderOptions.fallbackSettings;
|
|
6703
6746
|
const fb = {
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
mode: "strict",
|
|
6708
|
-
...(_d = context.fallback) != null ? _d : {}
|
|
6747
|
+
...DEFAULT_FALLBACK_SETTINGS,
|
|
6748
|
+
...fallbackSettingsSource != null ? fallbackSettingsSource : {},
|
|
6749
|
+
ratePolicy: resolvedRatePolicy
|
|
6709
6750
|
};
|
|
6751
|
+
const policySource = (_j = (_i = context.policies) != null ? _i : builderOptions == null ? void 0 : builderOptions.policies) != null ? _j : [];
|
|
6710
6752
|
const visibleServiceIds = context.selectedButtons === void 0 ? void 0 : collectVisibleServiceIds(
|
|
6711
6753
|
deps.builder,
|
|
6712
6754
|
context.tagId,
|
|
@@ -6731,11 +6773,11 @@ function filterServicesForVisibleGroup(input, deps) {
|
|
|
6731
6773
|
const fitsConstraints = constraintFitOk(
|
|
6732
6774
|
svcMap,
|
|
6733
6775
|
cap.id,
|
|
6734
|
-
(
|
|
6776
|
+
(_k = context.effectiveConstraints) != null ? _k : {}
|
|
6735
6777
|
);
|
|
6736
6778
|
const passesRate2 = primary == null ? true : rateOk(svcMap, id, primary, fb);
|
|
6737
6779
|
const polRes = evaluatePoliciesRaw(
|
|
6738
|
-
|
|
6780
|
+
policySource,
|
|
6739
6781
|
[...context.usedServiceIds, id],
|
|
6740
6782
|
svcMap,
|
|
6741
6783
|
context.tagId,
|
|
@@ -8419,6 +8461,8 @@ function filterServicesForVisibleGroup2(ctx, candidates, input) {
|
|
|
8419
8461
|
usedServiceIds: input.usedServiceIds,
|
|
8420
8462
|
effectiveConstraints: input.effectiveConstraints,
|
|
8421
8463
|
policies: input.policies,
|
|
8464
|
+
ratePolicy: input.ratePolicy,
|
|
8465
|
+
fallbackSettings: input.fallbackSettings,
|
|
8422
8466
|
fallback: input.fallback
|
|
8423
8467
|
}
|
|
8424
8468
|
};
|
|
@@ -9840,6 +9884,8 @@ function CanvasProviderWorkspaceRuntime({
|
|
|
9840
9884
|
children,
|
|
9841
9885
|
builderOpts,
|
|
9842
9886
|
canvasOpts,
|
|
9887
|
+
ratePolicy,
|
|
9888
|
+
fallbackSettings,
|
|
9843
9889
|
attachToWorkspace = true
|
|
9844
9890
|
}) {
|
|
9845
9891
|
const ws = useWorkspaceMaybe();
|
|
@@ -9858,11 +9904,23 @@ function CanvasProviderWorkspaceRuntime({
|
|
|
9858
9904
|
const resolvedBuilderOpts = (0, import_react2.useMemo)(() => {
|
|
9859
9905
|
const svc = ws.services.data;
|
|
9860
9906
|
const hasMap = svc != null && typeof svc === "object" && !Array.isArray(svc);
|
|
9861
|
-
|
|
9907
|
+
const policies = ws.policies.policies.data;
|
|
9908
|
+
return {
|
|
9862
9909
|
...builderOpts != null ? builderOpts : {},
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9910
|
+
...hasMap ? {
|
|
9911
|
+
serviceMap: svc
|
|
9912
|
+
} : {},
|
|
9913
|
+
policies: policies != null ? policies : void 0,
|
|
9914
|
+
ratePolicy: ratePolicy != null ? ratePolicy : builderOpts == null ? void 0 : builderOpts.ratePolicy,
|
|
9915
|
+
fallbackSettings: fallbackSettings != null ? fallbackSettings : builderOpts == null ? void 0 : builderOpts.fallbackSettings
|
|
9916
|
+
};
|
|
9917
|
+
}, [
|
|
9918
|
+
builderOpts,
|
|
9919
|
+
fallbackSettings,
|
|
9920
|
+
ratePolicy,
|
|
9921
|
+
ws.policies.policies.data,
|
|
9922
|
+
ws.services.data
|
|
9923
|
+
]);
|
|
9866
9924
|
if (canMountCanvas) {
|
|
9867
9925
|
hasMountedOnceRef.current = true;
|
|
9868
9926
|
}
|
|
@@ -9936,68 +9994,43 @@ function useCanvasFromExisting(api) {
|
|
|
9936
9994
|
}
|
|
9937
9995
|
var NO_SNAPSHOT_HYDRATION_KEY = "__no_snapshot__";
|
|
9938
9996
|
function useHydrateEditorSnapshot(api, snapshot) {
|
|
9939
|
-
const
|
|
9997
|
+
const fallbackIdentityRef = (0, import_react2.useRef)(
|
|
9998
|
+
`snapshot:fallback:${Math.random().toString(36).slice(2)}`
|
|
9999
|
+
);
|
|
10000
|
+
const hydratedIdentityRef = (0, import_react2.useRef)(NO_SNAPSHOT_HYDRATION_KEY);
|
|
10001
|
+
const [hydrationReady, setHydrationReady] = (0, import_react2.useState)(false);
|
|
10002
|
+
const targetHydrationIdentity = (0, import_react2.useMemo)(() => {
|
|
9940
10003
|
if (!(snapshot == null ? void 0 : snapshot.props)) return NO_SNAPSHOT_HYDRATION_KEY;
|
|
9941
|
-
return
|
|
10004
|
+
return getSnapshotHydrationIdentity(snapshot, fallbackIdentityRef.current);
|
|
9942
10005
|
}, [snapshot]);
|
|
9943
|
-
const [hydratedKey, setHydratedKey] = (0, import_react2.useState)(
|
|
9944
|
-
NO_SNAPSHOT_HYDRATION_KEY
|
|
9945
|
-
);
|
|
9946
10006
|
(0, import_react2.useLayoutEffect)(() => {
|
|
9947
|
-
if (hydratedKey === targetHydrationKey) return;
|
|
9948
10007
|
if (snapshot == null ? void 0 : snapshot.props) {
|
|
9949
|
-
|
|
10008
|
+
const shouldHydrate = hydratedIdentityRef.current !== targetHydrationIdentity;
|
|
10009
|
+
if (shouldHydrate) {
|
|
10010
|
+
hydrateEditorFromSnapshot(api, snapshot);
|
|
10011
|
+
hydratedIdentityRef.current = targetHydrationIdentity;
|
|
10012
|
+
}
|
|
9950
10013
|
}
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
10014
|
+
if (!hydrationReady) {
|
|
10015
|
+
setHydrationReady(true);
|
|
10016
|
+
}
|
|
10017
|
+
}, [api, hydrationReady, snapshot, targetHydrationIdentity]);
|
|
10018
|
+
return hydrationReady;
|
|
9954
10019
|
}
|
|
9955
|
-
function
|
|
9956
|
-
var _a, _b, _c
|
|
10020
|
+
function getSnapshotHydrationIdentity(snapshot, fallbackIdentity) {
|
|
10021
|
+
var _a, _b, _c;
|
|
9957
10022
|
const meta = snapshot.meta;
|
|
9958
|
-
const
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
const catalogKey = serializeForHydration(snapshot.catalog);
|
|
9968
|
-
return [
|
|
9969
|
-
metaKey,
|
|
9970
|
-
String(((_i = (_h = snapshot.props) == null ? void 0 : _h.fields) != null ? _i : []).length),
|
|
9971
|
-
String(((_k = (_j = snapshot.props) == null ? void 0 : _j.filters) != null ? _k : []).length),
|
|
9972
|
-
positionKeys,
|
|
9973
|
-
viewport,
|
|
9974
|
-
selection,
|
|
9975
|
-
catalogKey
|
|
9976
|
-
].join("::");
|
|
9977
|
-
}
|
|
9978
|
-
function serializeForHydration(value) {
|
|
9979
|
-
if (value == null) return "";
|
|
9980
|
-
try {
|
|
9981
|
-
return JSON.stringify(sortForHydration(value));
|
|
9982
|
-
} catch {
|
|
9983
|
-
return "__unserializable__";
|
|
9984
|
-
}
|
|
9985
|
-
}
|
|
9986
|
-
function sortForHydration(value) {
|
|
9987
|
-
if (Array.isArray(value)) {
|
|
9988
|
-
return value.map((entry) => sortForHydration(entry));
|
|
9989
|
-
}
|
|
9990
|
-
if (value && typeof value === "object") {
|
|
9991
|
-
const entries = Object.entries(value).sort(
|
|
9992
|
-
([a], [b]) => a.localeCompare(b)
|
|
9993
|
-
);
|
|
9994
|
-
const next = {};
|
|
9995
|
-
for (const [key, entry] of entries) {
|
|
9996
|
-
next[key] = sortForHydration(entry);
|
|
9997
|
-
}
|
|
9998
|
-
return next;
|
|
10023
|
+
const snapshotId = (_a = meta == null ? void 0 : meta.snapshot_id) != null ? _a : meta == null ? void 0 : meta.snapshotId;
|
|
10024
|
+
const versionId = (_b = meta == null ? void 0 : meta.version_id) != null ? _b : meta == null ? void 0 : meta.versionId;
|
|
10025
|
+
const branchId = (_c = meta == null ? void 0 : meta.branch_id) != null ? _c : meta == null ? void 0 : meta.branchId;
|
|
10026
|
+
if (snapshotId != null || versionId != null || branchId != null) {
|
|
10027
|
+
return [
|
|
10028
|
+
String(snapshotId != null ? snapshotId : ""),
|
|
10029
|
+
String(versionId != null ? versionId : ""),
|
|
10030
|
+
String(branchId != null ? branchId : "")
|
|
10031
|
+
].join("|");
|
|
9999
10032
|
}
|
|
10000
|
-
return
|
|
10033
|
+
return fallbackIdentity;
|
|
10001
10034
|
}
|
|
10002
10035
|
function hydrateEditorFromSnapshot(api, snapshot) {
|
|
10003
10036
|
var _a;
|
|
@@ -10225,7 +10258,7 @@ function useCanvasOwned(initialProps, canvasOpts, builderOpts) {
|
|
|
10225
10258
|
} else if (((_a = window.SITE) == null ? void 0 : _a.env) !== "production") {
|
|
10226
10259
|
if (builderOptsRef.current !== builderOpts) {
|
|
10227
10260
|
console.warn(
|
|
10228
|
-
"[useCanvasOwned] builderOpts changed after init
|
|
10261
|
+
"[useCanvasOwned] builderOpts changed after init. Reactive keys (serviceMap/policies/ratePolicy/fallbackSettings/selectedOptionKeys) are applied via setOptions(); other keys may still require remounting to fully reinitialize."
|
|
10229
10262
|
);
|
|
10230
10263
|
builderOptsRef.current = builderOpts;
|
|
10231
10264
|
}
|
|
@@ -10237,6 +10270,23 @@ function useCanvasOwned(initialProps, canvasOpts, builderOpts) {
|
|
|
10237
10270
|
loadedOnceRef.current = true;
|
|
10238
10271
|
}
|
|
10239
10272
|
}, [initialProps]);
|
|
10273
|
+
(0, import_react2.useEffect)(() => {
|
|
10274
|
+
if (!builderOpts) return;
|
|
10275
|
+
builder.setOptions({
|
|
10276
|
+
serviceMap: builderOpts.serviceMap,
|
|
10277
|
+
policies: builderOpts.policies,
|
|
10278
|
+
ratePolicy: builderOpts.ratePolicy,
|
|
10279
|
+
fallbackSettings: builderOpts.fallbackSettings,
|
|
10280
|
+
selectedOptionKeys: builderOpts.selectedOptionKeys
|
|
10281
|
+
});
|
|
10282
|
+
}, [
|
|
10283
|
+
builder,
|
|
10284
|
+
builderOpts == null ? void 0 : builderOpts.fallbackSettings,
|
|
10285
|
+
builderOpts == null ? void 0 : builderOpts.policies,
|
|
10286
|
+
builderOpts == null ? void 0 : builderOpts.ratePolicy,
|
|
10287
|
+
builderOpts == null ? void 0 : builderOpts.selectedOptionKeys,
|
|
10288
|
+
builderOpts == null ? void 0 : builderOpts.serviceMap
|
|
10289
|
+
]);
|
|
10240
10290
|
const lastCanvasOptsRef = (0, import_react2.useRef)();
|
|
10241
10291
|
const stableCanvasOpts = (0, import_react2.useMemo)(() => {
|
|
10242
10292
|
var _a2;
|
|
@@ -10562,18 +10612,18 @@ function useErrors(opts = {}) {
|
|
|
10562
10612
|
setValidating(true);
|
|
10563
10613
|
schedule(
|
|
10564
10614
|
() => {
|
|
10565
|
-
var _a2, _b2;
|
|
10615
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
10566
10616
|
if (token !== runTokenRef.current) return;
|
|
10567
10617
|
try {
|
|
10568
10618
|
const props = api.editor.getProps();
|
|
10569
|
-
const res = validate(props);
|
|
10619
|
+
const res = validate(props, (_c2 = (_b2 = (_a2 = api.builder).getOptions) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : {});
|
|
10570
10620
|
if (token !== runTokenRef.current) return;
|
|
10571
10621
|
setValidation(toValidationRows(res != null ? res : []));
|
|
10572
10622
|
} catch (err) {
|
|
10573
10623
|
if (token !== runTokenRef.current) return;
|
|
10574
10624
|
pushLog({
|
|
10575
|
-
message: (
|
|
10576
|
-
code: (
|
|
10625
|
+
message: (_d2 = err == null ? void 0 : err.message) != null ? _d2 : "validate() threw",
|
|
10626
|
+
code: (_e2 = err == null ? void 0 : err.code) != null ? _e2 : "validate_throw",
|
|
10577
10627
|
meta: err
|
|
10578
10628
|
});
|
|
10579
10629
|
setValidation([]);
|
|
@@ -12035,6 +12085,8 @@ function Workspace(props) {
|
|
|
12035
12085
|
liveDebounceMs,
|
|
12036
12086
|
autosaveMs,
|
|
12037
12087
|
autoAutosave,
|
|
12088
|
+
ratePolicy,
|
|
12089
|
+
fallbackSettings,
|
|
12038
12090
|
tools,
|
|
12039
12091
|
children
|
|
12040
12092
|
} = props;
|
|
@@ -12050,7 +12102,14 @@ function Workspace(props) {
|
|
|
12050
12102
|
liveDebounceMs,
|
|
12051
12103
|
autosaveMs,
|
|
12052
12104
|
autoAutosave,
|
|
12053
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
12105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
12106
|
+
CanvasProvider,
|
|
12107
|
+
{
|
|
12108
|
+
ratePolicy,
|
|
12109
|
+
fallbackSettings,
|
|
12110
|
+
children: children(tools)
|
|
12111
|
+
}
|
|
12112
|
+
)
|
|
12054
12113
|
}
|
|
12055
12114
|
);
|
|
12056
12115
|
}
|