@number10/phaserjsx 0.1.0 → 0.3.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/{TransformOriginView-CO-tJCmV.js → TransformOriginView-CzVjS16F.js} +987 -527
- package/dist/TransformOriginView-CzVjS16F.js.map +1 -0
- package/dist/{TransformOriginView-BYPbRH8N.cjs → TransformOriginView-KcTgaYRi.cjs} +929 -469
- package/dist/TransformOriginView-KcTgaYRi.cjs.map +1 -0
- package/dist/colors/index.d.ts +1 -1
- package/dist/colors/index.d.ts.map +1 -1
- package/dist/colors/preset-manager.d.ts +11 -7
- package/dist/colors/preset-manager.d.ts.map +1 -1
- package/dist/components/custom/Modal.d.ts.map +1 -1
- package/dist/components/custom/Portal.d.ts.map +1 -1
- package/dist/components/custom/ScrollSlider.d.ts +4 -0
- package/dist/components/custom/ScrollSlider.d.ts.map +1 -1
- package/dist/components/custom/ScrollView.d.ts +16 -0
- package/dist/components/custom/ScrollView.d.ts.map +1 -1
- package/dist/components/custom/Sidebar.d.ts.map +1 -1
- package/dist/components/custom/index.cjs +29 -29
- package/dist/components/custom/index.js +1 -1
- package/dist/gestures/gesture-manager.d.ts.map +1 -1
- package/dist/index.cjs +231 -226
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +82 -77
- package/dist/index.js.map +1 -1
- package/dist/layout/utils/size-resolver.d.ts.map +1 -1
- package/dist/theme-defaults.d.ts +7 -1
- package/dist/theme-defaults.d.ts.map +1 -1
- package/dist/theme.d.ts +6 -4
- package/dist/theme.d.ts.map +1 -1
- package/dist/vdom.d.ts +21 -2
- package/dist/vdom.d.ts.map +1 -1
- package/package.json +4 -5
- package/dist/TransformOriginView-BYPbRH8N.cjs.map +0 -1
- package/dist/TransformOriginView-CO-tJCmV.js.map +0 -1
|
@@ -1443,7 +1443,7 @@ function requireLodash() {
|
|
|
1443
1443
|
var reIsNative = RegExp2(
|
|
1444
1444
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1445
1445
|
);
|
|
1446
|
-
var Buffer = moduleExports ? context.Buffer : undefined$1,
|
|
1446
|
+
var Buffer = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
|
|
1447
1447
|
var defineProperty = (function() {
|
|
1448
1448
|
try {
|
|
1449
1449
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -1458,7 +1458,7 @@ function requireLodash() {
|
|
|
1458
1458
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
1459
1459
|
var realNames = {};
|
|
1460
1460
|
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
|
|
1461
|
-
var symbolProto =
|
|
1461
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
1462
1462
|
function lodash2(value) {
|
|
1463
1463
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
1464
1464
|
if (value instanceof LodashWrapper) {
|
|
@@ -6643,10 +6643,6 @@ function resolveCalcOperand(operand, parentSize, viewportSize) {
|
|
|
6643
6643
|
}
|
|
6644
6644
|
if (operand.type === "percent") {
|
|
6645
6645
|
if (parentSize === void 0) {
|
|
6646
|
-
DebugLogger.warn(
|
|
6647
|
-
"Size",
|
|
6648
|
-
"Cannot resolve percentage in calc() without parent size. Using 0."
|
|
6649
|
-
);
|
|
6650
6646
|
return 0;
|
|
6651
6647
|
}
|
|
6652
6648
|
return parentSize * operand.value / 100;
|
|
@@ -7054,6 +7050,9 @@ class GestureManager {
|
|
|
7054
7050
|
this.activePointerDown = null;
|
|
7055
7051
|
}
|
|
7056
7052
|
this.hoveredContainers.delete(container);
|
|
7053
|
+
for (const hitContainers of this.activeContainersForMove.values()) {
|
|
7054
|
+
hitContainers.delete(container);
|
|
7055
|
+
}
|
|
7057
7056
|
}
|
|
7058
7057
|
/**
|
|
7059
7058
|
* Check if a container is registered
|
|
@@ -9695,6 +9694,18 @@ function getPresetWithMode(name, mode) {
|
|
|
9695
9694
|
const preset2 = getPreset(name);
|
|
9696
9695
|
return mode === "light" ? applyLightMode(preset2) : applyDarkMode(preset2);
|
|
9697
9696
|
}
|
|
9697
|
+
const colorPresets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9698
|
+
__proto__: null,
|
|
9699
|
+
applyDarkMode,
|
|
9700
|
+
applyLightMode,
|
|
9701
|
+
forestGreenPreset,
|
|
9702
|
+
generateColorScale,
|
|
9703
|
+
getPreset,
|
|
9704
|
+
getPresetWithMode,
|
|
9705
|
+
midnightPreset,
|
|
9706
|
+
oceanBluePreset,
|
|
9707
|
+
presets
|
|
9708
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9698
9709
|
const defaultSpacingTokens = {
|
|
9699
9710
|
xs: 4,
|
|
9700
9711
|
sm: 8,
|
|
@@ -9768,460 +9779,466 @@ function createTextStyleTokens(textColor) {
|
|
|
9768
9779
|
};
|
|
9769
9780
|
}
|
|
9770
9781
|
const defaultTextStyleTokens = createTextStyleTokens("#ffffff");
|
|
9771
|
-
|
|
9772
|
-
const
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
visible: true
|
|
9779
|
-
},
|
|
9780
|
-
Icon: {
|
|
9781
|
-
size: 24,
|
|
9782
|
-
tint: colors.border.dark.toNumber()
|
|
9783
|
-
},
|
|
9784
|
-
text: {
|
|
9785
|
-
text: "",
|
|
9786
|
-
alpha: 1,
|
|
9787
|
-
visible: true,
|
|
9788
|
-
style: textStyles.DEFAULT
|
|
9789
|
-
},
|
|
9790
|
-
nineslice: {
|
|
9791
|
-
alpha: 1,
|
|
9792
|
-
visible: true
|
|
9793
|
-
},
|
|
9794
|
-
sprite: {
|
|
9795
|
-
alpha: 1,
|
|
9796
|
-
visible: true
|
|
9797
|
-
},
|
|
9798
|
-
image: {
|
|
9799
|
-
alpha: 1,
|
|
9800
|
-
visible: true
|
|
9801
|
-
},
|
|
9802
|
-
graphics: {
|
|
9803
|
-
alpha: 1,
|
|
9804
|
-
visible: true
|
|
9805
|
-
},
|
|
9806
|
-
tilesprite: {
|
|
9807
|
-
alpha: 1,
|
|
9808
|
-
visible: true
|
|
9809
|
-
},
|
|
9810
|
-
// Public API (uppercase)
|
|
9811
|
-
View: {
|
|
9812
|
-
alpha: 1,
|
|
9813
|
-
visible: true
|
|
9814
|
-
},
|
|
9815
|
-
Text: {
|
|
9816
|
-
text: "",
|
|
9817
|
-
alpha: 1,
|
|
9818
|
-
visible: true,
|
|
9819
|
-
style: textStyles.DEFAULT
|
|
9820
|
-
},
|
|
9821
|
-
NineSlice: {
|
|
9822
|
-
alpha: 1,
|
|
9823
|
-
visible: true
|
|
9824
|
-
},
|
|
9825
|
-
Sprite: {
|
|
9826
|
-
alpha: 1,
|
|
9827
|
-
visible: true
|
|
9828
|
-
},
|
|
9829
|
-
Image: {
|
|
9830
|
-
alpha: 1,
|
|
9831
|
-
visible: true
|
|
9832
|
-
},
|
|
9833
|
-
Graphics: {
|
|
9834
|
-
alpha: 1,
|
|
9835
|
-
visible: true
|
|
9836
|
-
},
|
|
9837
|
-
TileSprite: {
|
|
9838
|
-
alpha: 1,
|
|
9839
|
-
visible: true
|
|
9840
|
-
},
|
|
9841
|
-
RadioButton: {
|
|
9842
|
-
selectedColor: colors.primary.DEFAULT.toNumber(),
|
|
9843
|
-
color: colors.border.medium.toNumber(),
|
|
9844
|
-
gap: 8,
|
|
9845
|
-
size: 16,
|
|
9846
|
-
innerSize: 12,
|
|
9847
|
-
labelStyle: {
|
|
9848
|
-
color: colors.text.DEFAULT.toString(),
|
|
9849
|
-
fontSize: "14px"
|
|
9850
|
-
}
|
|
9851
|
-
},
|
|
9852
|
-
ScrollSlider: {
|
|
9853
|
-
borderColor: colors.border.medium.toNumber(),
|
|
9854
|
-
trackColor: colors.surface.dark.toNumber(),
|
|
9855
|
-
thumbColor: colors.primary.light.toNumber(),
|
|
9856
|
-
borderWidth: 1,
|
|
9857
|
-
size: 12,
|
|
9858
|
-
minThumbSize: 20
|
|
9859
|
-
},
|
|
9860
|
-
Button: {
|
|
9861
|
-
disabledColor: colors.background.DEFAULT.toNumber(),
|
|
9862
|
-
iconSize: 24,
|
|
9863
|
-
backgroundColor: colors.primary.DEFAULT.toNumber(),
|
|
9864
|
-
backgroundAlpha: 1,
|
|
9865
|
-
borderColor: colors.primary.dark.toNumber(),
|
|
9866
|
-
borderWidth: 1,
|
|
9867
|
-
cornerRadius: 6,
|
|
9868
|
-
padding: 8,
|
|
9869
|
-
gap: 8,
|
|
9870
|
-
justifyContent: "center",
|
|
9871
|
-
alignItems: "center",
|
|
9872
|
-
primary: {
|
|
9873
|
-
backgroundColor: colors.primary.medium.toNumber(),
|
|
9874
|
-
borderColor: colors.primary.dark.toNumber()
|
|
9782
|
+
function buildDefaultTheme(colors) {
|
|
9783
|
+
const textStyles = createTextStyleTokens(colors.text.DEFAULT.toString());
|
|
9784
|
+
return {
|
|
9785
|
+
// Primitives (lowercase) - share same defaults as uppercase
|
|
9786
|
+
view: {
|
|
9787
|
+
alpha: 1,
|
|
9788
|
+
visible: true
|
|
9875
9789
|
},
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
effect: "press",
|
|
9880
|
-
effectConfig: { intensity: 0.9, time: 200 }
|
|
9790
|
+
Icon: {
|
|
9791
|
+
size: 24,
|
|
9792
|
+
tint: colors.border.dark.toNumber()
|
|
9881
9793
|
},
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
effect: "flash",
|
|
9888
|
-
effectConfig: { intensity: 1.15, time: 200 }
|
|
9794
|
+
text: {
|
|
9795
|
+
text: "",
|
|
9796
|
+
alpha: 1,
|
|
9797
|
+
visible: true,
|
|
9798
|
+
style: textStyles.DEFAULT
|
|
9889
9799
|
},
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9800
|
+
nineslice: {
|
|
9801
|
+
alpha: 1,
|
|
9802
|
+
visible: true
|
|
9893
9803
|
},
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9804
|
+
sprite: {
|
|
9805
|
+
alpha: 1,
|
|
9806
|
+
visible: true
|
|
9897
9807
|
},
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
}
|
|
9902
|
-
},
|
|
9903
|
-
Sidebar: {
|
|
9904
|
-
variant: "solid",
|
|
9905
|
-
size: "md",
|
|
9906
|
-
backgroundColor: colors.surface.light.toNumber(),
|
|
9907
|
-
backgroundAlpha: 1,
|
|
9908
|
-
padding: 16,
|
|
9909
|
-
gap: 8,
|
|
9910
|
-
dividerColor: colors.border.light.toNumber(),
|
|
9911
|
-
itemGap: 8,
|
|
9912
|
-
sectionGap: 10,
|
|
9913
|
-
headerStyle: {
|
|
9914
|
-
gap: 10,
|
|
9915
|
-
padding: { bottom: 6 },
|
|
9916
|
-
width: "fill"
|
|
9808
|
+
image: {
|
|
9809
|
+
alpha: 1,
|
|
9810
|
+
visible: true
|
|
9917
9811
|
},
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
width: "fill"
|
|
9812
|
+
graphics: {
|
|
9813
|
+
alpha: 1,
|
|
9814
|
+
visible: true
|
|
9922
9815
|
},
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9816
|
+
tilesprite: {
|
|
9817
|
+
alpha: 1,
|
|
9818
|
+
visible: true
|
|
9819
|
+
},
|
|
9820
|
+
// Public API (uppercase)
|
|
9821
|
+
View: {
|
|
9822
|
+
alpha: 1,
|
|
9823
|
+
visible: true
|
|
9824
|
+
},
|
|
9825
|
+
Text: {
|
|
9826
|
+
text: "",
|
|
9827
|
+
alpha: 1,
|
|
9828
|
+
visible: true,
|
|
9829
|
+
style: textStyles.DEFAULT
|
|
9830
|
+
},
|
|
9831
|
+
NineSlice: {
|
|
9832
|
+
alpha: 1,
|
|
9833
|
+
visible: true
|
|
9834
|
+
},
|
|
9835
|
+
Sprite: {
|
|
9836
|
+
alpha: 1,
|
|
9837
|
+
visible: true
|
|
9838
|
+
},
|
|
9839
|
+
Image: {
|
|
9840
|
+
alpha: 1,
|
|
9841
|
+
visible: true
|
|
9842
|
+
},
|
|
9843
|
+
Graphics: {
|
|
9844
|
+
alpha: 1,
|
|
9845
|
+
visible: true
|
|
9846
|
+
},
|
|
9847
|
+
TileSprite: {
|
|
9848
|
+
alpha: 1,
|
|
9849
|
+
visible: true
|
|
9850
|
+
},
|
|
9851
|
+
RadioButton: {
|
|
9852
|
+
selectedColor: colors.primary.DEFAULT.toNumber(),
|
|
9853
|
+
color: colors.border.medium.toNumber(),
|
|
9854
|
+
gap: 10,
|
|
9855
|
+
size: 16,
|
|
9856
|
+
innerSize: 16,
|
|
9857
|
+
labelStyle: {
|
|
9858
|
+
color: colors.text.DEFAULT.toString(),
|
|
9859
|
+
fontSize: "14px"
|
|
9931
9860
|
}
|
|
9932
9861
|
},
|
|
9933
|
-
|
|
9862
|
+
ScrollSlider: {
|
|
9863
|
+
borderColor: colors.border.dark.toNumber(),
|
|
9864
|
+
trackColor: colors.surface.dark.toNumber(),
|
|
9865
|
+
thumbColor: colors.primary.dark.toNumber(),
|
|
9866
|
+
borderWidth: 2,
|
|
9867
|
+
minThumbSize: 30,
|
|
9868
|
+
size: 24
|
|
9869
|
+
},
|
|
9870
|
+
Button: {
|
|
9871
|
+
disabledColor: colors.background.DEFAULT.toNumber(),
|
|
9872
|
+
iconSize: 24,
|
|
9873
|
+
backgroundColor: colors.primary.DEFAULT.toNumber(),
|
|
9874
|
+
backgroundAlpha: 1,
|
|
9875
|
+
borderColor: colors.primary.dark.toNumber(),
|
|
9876
|
+
borderWidth: 1,
|
|
9877
|
+
cornerRadius: 6,
|
|
9878
|
+
padding: 8,
|
|
9934
9879
|
gap: 8,
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
...textStyles.medium,
|
|
9941
|
-
color: colors.text.dark.toString()
|
|
9880
|
+
justifyContent: "center",
|
|
9881
|
+
alignItems: "center",
|
|
9882
|
+
primary: {
|
|
9883
|
+
backgroundColor: colors.primary.medium.toNumber(),
|
|
9884
|
+
borderColor: colors.primary.dark.toNumber()
|
|
9942
9885
|
},
|
|
9943
|
-
|
|
9944
|
-
backgroundColor: colors.
|
|
9945
|
-
borderColor: colors.
|
|
9946
|
-
|
|
9947
|
-
|
|
9886
|
+
secondary: {
|
|
9887
|
+
backgroundColor: colors.secondary.DEFAULT.toNumber(),
|
|
9888
|
+
borderColor: colors.secondary.dark.toNumber(),
|
|
9889
|
+
effect: "press",
|
|
9890
|
+
effectConfig: { intensity: 0.9, time: 200 }
|
|
9948
9891
|
},
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9892
|
+
outline: {
|
|
9893
|
+
backgroundColor: 0,
|
|
9894
|
+
backgroundAlpha: 0,
|
|
9895
|
+
borderColor: colors.accent.DEFAULT.toNumber(),
|
|
9896
|
+
borderWidth: 2,
|
|
9897
|
+
effect: "flash",
|
|
9898
|
+
effectConfig: { intensity: 1.15, time: 200 }
|
|
9899
|
+
},
|
|
9900
|
+
small: {
|
|
9901
|
+
padding: 6,
|
|
9902
|
+
cornerRadius: 4
|
|
9903
|
+
},
|
|
9904
|
+
medium: {
|
|
9905
|
+
padding: 8,
|
|
9906
|
+
cornerRadius: 6
|
|
9907
|
+
},
|
|
9908
|
+
large: {
|
|
9909
|
+
padding: { top: 12, bottom: 12, left: 8, right: 8 },
|
|
9910
|
+
cornerRadius: 8
|
|
9960
9911
|
}
|
|
9961
9912
|
},
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9913
|
+
Sidebar: {
|
|
9914
|
+
variant: "solid",
|
|
9915
|
+
size: "md",
|
|
9916
|
+
backgroundColor: colors.surface.light.toNumber(),
|
|
9917
|
+
backgroundAlpha: 1,
|
|
9918
|
+
padding: 16,
|
|
9919
|
+
gap: 8,
|
|
9920
|
+
dividerColor: colors.border.light.toNumber(),
|
|
9921
|
+
itemGap: 8,
|
|
9922
|
+
sectionGap: 10,
|
|
9923
|
+
headerStyle: {
|
|
9924
|
+
gap: 10,
|
|
9925
|
+
padding: { bottom: 6 },
|
|
9926
|
+
width: "fill"
|
|
9967
9927
|
},
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
borderWidth: 1
|
|
9928
|
+
footerStyle: {
|
|
9929
|
+
gap: 8,
|
|
9930
|
+
padding: { top: 6 },
|
|
9931
|
+
width: "fill"
|
|
9973
9932
|
},
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9933
|
+
sectionStyle: {
|
|
9934
|
+
gap: 8,
|
|
9935
|
+
padding: { top: 4, bottom: 8 },
|
|
9936
|
+
width: "fill",
|
|
9937
|
+
titleStyle: {
|
|
9938
|
+
...textStyles.medium,
|
|
9939
|
+
color: colors.text.dark.toString(),
|
|
9940
|
+
fontStyle: "bold"
|
|
9941
|
+
}
|
|
9978
9942
|
},
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9943
|
+
itemStyle: {
|
|
9944
|
+
gap: 8,
|
|
9945
|
+
padding: { top: 8, bottom: 8, left: 10, right: 10 },
|
|
9946
|
+
width: "fill",
|
|
9947
|
+
cornerRadius: 8,
|
|
9948
|
+
backgroundColor: colors.surface.lightest.toNumber(),
|
|
9949
|
+
textStyle: {
|
|
9950
|
+
...textStyles.medium,
|
|
9951
|
+
color: colors.text.dark.toString()
|
|
9952
|
+
},
|
|
9953
|
+
active: {
|
|
9954
|
+
backgroundColor: colors.primary.lightest.toNumber(),
|
|
9955
|
+
borderColor: colors.primary.light.toNumber(),
|
|
9956
|
+
borderWidth: 1,
|
|
9957
|
+
backgroundAlpha: 0.9
|
|
9958
|
+
},
|
|
9959
|
+
disabledAlpha: 0.5
|
|
9960
|
+
},
|
|
9961
|
+
badgeStyle: {
|
|
9962
|
+
backgroundColor: colors.primary.light.toNumber(),
|
|
9963
|
+
backgroundAlpha: 0.15,
|
|
9964
|
+
cornerRadius: 6,
|
|
9965
|
+
padding: { top: 4, bottom: 4, left: 8, right: 8 },
|
|
9966
|
+
textStyle: {
|
|
9967
|
+
...textStyles.small,
|
|
9968
|
+
color: colors.primary.dark.toString(),
|
|
9969
|
+
fontStyle: "bold"
|
|
9970
|
+
}
|
|
9971
|
+
},
|
|
9972
|
+
variants: {
|
|
9973
|
+
solid: {
|
|
9974
|
+
backgroundColor: colors.surface.light.toNumber(),
|
|
9975
|
+
borderColor: colors.border.light.toNumber(),
|
|
9976
|
+
borderWidth: 1
|
|
9977
|
+
},
|
|
9978
|
+
muted: {
|
|
9979
|
+
backgroundColor: colors.surface.medium.toNumber(),
|
|
9980
|
+
backgroundAlpha: 0.85,
|
|
9981
|
+
borderColor: colors.border.light.toNumber(),
|
|
9982
|
+
borderWidth: 1
|
|
9983
|
+
},
|
|
9984
|
+
ghost: {
|
|
9985
|
+
backgroundColor: colors.background.lightest.toNumber(),
|
|
9986
|
+
backgroundAlpha: 0.6,
|
|
9987
|
+
borderWidth: 0
|
|
9988
|
+
},
|
|
9989
|
+
inset: {
|
|
9990
|
+
backgroundColor: colors.surface.dark.toNumber(),
|
|
9991
|
+
backgroundAlpha: 1,
|
|
9992
|
+
borderColor: colors.border.medium.toNumber(),
|
|
9993
|
+
borderWidth: 1
|
|
9994
|
+
}
|
|
9995
|
+
},
|
|
9996
|
+
sizes: {
|
|
9997
|
+
sm: {
|
|
9998
|
+
padding: 10,
|
|
9999
|
+
gap: 6
|
|
10000
|
+
},
|
|
10001
|
+
md: {
|
|
10002
|
+
padding: 16,
|
|
10003
|
+
gap: 8
|
|
10004
|
+
},
|
|
10005
|
+
lg: {
|
|
10006
|
+
padding: { top: 20, bottom: 20, left: 16, right: 16 },
|
|
10007
|
+
gap: 12
|
|
10008
|
+
}
|
|
9984
10009
|
}
|
|
9985
10010
|
},
|
|
9986
|
-
|
|
9987
|
-
|
|
10011
|
+
Accordion: {
|
|
10012
|
+
effect: "none",
|
|
10013
|
+
effectConfig: { magnitude: 0.02, time: 150 },
|
|
10014
|
+
headerStyle: {
|
|
10015
|
+
backgroundColor: colors.surface.dark.toNumber(),
|
|
10016
|
+
padding: 10,
|
|
10017
|
+
gap: 10,
|
|
10018
|
+
cornerRadius: 5,
|
|
10019
|
+
width: "fill"
|
|
10020
|
+
},
|
|
10021
|
+
contentStyle: {
|
|
10022
|
+
backgroundColor: colors.surface.light.toNumber(),
|
|
9988
10023
|
padding: 10,
|
|
9989
|
-
|
|
10024
|
+
cornerRadius: 5,
|
|
10025
|
+
width: "fill"
|
|
9990
10026
|
},
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
gap: 8
|
|
10027
|
+
Icon: {
|
|
10028
|
+
size: 24
|
|
9994
10029
|
},
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
10030
|
+
textStyle: {
|
|
10031
|
+
color: colors.text.DEFAULT.toString(),
|
|
10032
|
+
fontSize: "18px"
|
|
9998
10033
|
}
|
|
9999
|
-
}
|
|
10000
|
-
},
|
|
10001
|
-
Accordion: {
|
|
10002
|
-
effect: "none",
|
|
10003
|
-
effectConfig: { magnitude: 0.02, time: 150 },
|
|
10004
|
-
headerStyle: {
|
|
10005
|
-
backgroundColor: colors.surface.dark.toNumber(),
|
|
10006
|
-
padding: 10,
|
|
10007
|
-
gap: 10,
|
|
10008
|
-
cornerRadius: 5,
|
|
10009
|
-
width: "fill"
|
|
10010
10034
|
},
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10035
|
+
NineSliceButton: {},
|
|
10036
|
+
CharText: {
|
|
10037
|
+
charSpacing: 0,
|
|
10038
|
+
cursorColor: colors.secondary.DEFAULT.toNumber(),
|
|
10039
|
+
cursorWidth: 3,
|
|
10040
|
+
cursorBlinkSpeed: 200,
|
|
10041
|
+
selectionAlpha: 0.3,
|
|
10042
|
+
lineHeight: 1.2,
|
|
10043
|
+
wordWrap: true,
|
|
10044
|
+
textStyle: textStyles.DEFAULT,
|
|
10045
|
+
borderColor: colors.border.medium.toNumber(),
|
|
10046
|
+
borderWidth: 2,
|
|
10047
|
+
cornerRadius: 6,
|
|
10048
|
+
padding: 10
|
|
10019
10049
|
},
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
selectionAlpha: 0.3,
|
|
10032
|
-
lineHeight: 1.2,
|
|
10033
|
-
wordWrap: true,
|
|
10034
|
-
textStyle: textStyles.DEFAULT,
|
|
10035
|
-
borderColor: colors.border.medium.toNumber(),
|
|
10036
|
-
borderWidth: 2,
|
|
10037
|
-
cornerRadius: 6,
|
|
10038
|
-
padding: 10
|
|
10039
|
-
},
|
|
10040
|
-
CharTextInput: {
|
|
10041
|
-
charSpacing: 2,
|
|
10042
|
-
cursorColor: colors.accent.DEFAULT.toNumber(),
|
|
10043
|
-
cursorWidth: 3,
|
|
10044
|
-
cursorBlinkSpeed: 200,
|
|
10045
|
-
selectionColor: colors.accent.light.toNumber(),
|
|
10046
|
-
selectionAlpha: 0.5,
|
|
10047
|
-
lineHeight: 1.2,
|
|
10048
|
-
wordWrap: false,
|
|
10049
|
-
disabledColor: colors.border.dark.toNumber(),
|
|
10050
|
-
focusedBorderColor: colors.accent.lightest.toNumber(),
|
|
10051
|
-
backgroundColor: colors.surface.medium.toNumber(),
|
|
10052
|
-
borderColor: colors.border.medium.toNumber(),
|
|
10053
|
-
borderWidth: 1,
|
|
10054
|
-
padding: 8,
|
|
10055
|
-
textStyle: textStyles.DEFAULT
|
|
10056
|
-
},
|
|
10057
|
-
Dropdown: {
|
|
10058
|
-
trigger: {
|
|
10050
|
+
CharTextInput: {
|
|
10051
|
+
charSpacing: 2,
|
|
10052
|
+
cursorColor: colors.secondary.DEFAULT.toNumber(),
|
|
10053
|
+
cursorWidth: 3,
|
|
10054
|
+
cursorBlinkSpeed: 200,
|
|
10055
|
+
selectionColor: colors.accent.light.toNumber(),
|
|
10056
|
+
selectionAlpha: 0.5,
|
|
10057
|
+
lineHeight: 1.2,
|
|
10058
|
+
wordWrap: false,
|
|
10059
|
+
disabledColor: colors.border.dark.toNumber(),
|
|
10060
|
+
focusedBorderColor: colors.accent.lightest.toNumber(),
|
|
10059
10061
|
backgroundColor: colors.surface.medium.toNumber(),
|
|
10060
10062
|
borderColor: colors.border.medium.toNumber(),
|
|
10061
10063
|
borderWidth: 1,
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
width: "fill"
|
|
10064
|
+
padding: 8,
|
|
10065
|
+
textStyle: textStyles.DEFAULT
|
|
10065
10066
|
},
|
|
10066
|
-
|
|
10067
|
-
|
|
10067
|
+
Dropdown: {
|
|
10068
|
+
trigger: {
|
|
10069
|
+
backgroundColor: colors.surface.medium.toNumber(),
|
|
10070
|
+
borderColor: colors.border.medium.toNumber(),
|
|
10071
|
+
borderWidth: 1,
|
|
10072
|
+
cornerRadius: 4,
|
|
10073
|
+
padding: { left: 12, right: 12, top: 8, bottom: 8 },
|
|
10074
|
+
width: "fill"
|
|
10075
|
+
},
|
|
10076
|
+
triggerHover: {
|
|
10077
|
+
borderColor: colors.primary.DEFAULT.toNumber()
|
|
10078
|
+
},
|
|
10079
|
+
triggerOpen: {
|
|
10080
|
+
borderColor: colors.primary.DEFAULT.toNumber(),
|
|
10081
|
+
backgroundColor: colors.surface.dark.toNumber()
|
|
10082
|
+
},
|
|
10083
|
+
triggerDisabled: {
|
|
10084
|
+
backgroundColor: colors.surface.light.toNumber(),
|
|
10085
|
+
alpha: 0.5
|
|
10086
|
+
},
|
|
10087
|
+
arrow: {
|
|
10088
|
+
color: colors.text.DEFAULT.toNumber(),
|
|
10089
|
+
size: 12
|
|
10090
|
+
},
|
|
10091
|
+
overlay: {
|
|
10092
|
+
backgroundColor: colors.surface.medium.toNumber(),
|
|
10093
|
+
borderColor: colors.border.medium.toNumber(),
|
|
10094
|
+
borderWidth: 1,
|
|
10095
|
+
cornerRadius: 4,
|
|
10096
|
+
maxHeight: 300,
|
|
10097
|
+
padding: 4
|
|
10098
|
+
},
|
|
10099
|
+
option: {
|
|
10100
|
+
padding: { left: 12, right: 12, top: 8, bottom: 8 }
|
|
10101
|
+
},
|
|
10102
|
+
optionSelected: {
|
|
10103
|
+
backgroundColor: colors.primary.light.toNumber(),
|
|
10104
|
+
Text: {
|
|
10105
|
+
style: textStyles.DEFAULT
|
|
10106
|
+
}
|
|
10107
|
+
},
|
|
10108
|
+
optionDisabled: {
|
|
10109
|
+
alpha: 0.3
|
|
10110
|
+
},
|
|
10111
|
+
textStyle: textStyles.DEFAULT,
|
|
10112
|
+
placeholderStyle: textStyles.DEFAULT,
|
|
10113
|
+
filterInput: {
|
|
10114
|
+
backgroundColor: colors.surface.lightest.toNumber(),
|
|
10115
|
+
borderColor: colors.border.medium.toNumber()
|
|
10116
|
+
//height: 32,
|
|
10117
|
+
},
|
|
10118
|
+
animationConfig: "stiff",
|
|
10119
|
+
optionGap: 2
|
|
10068
10120
|
},
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10121
|
+
Slider: {
|
|
10122
|
+
// Track styling
|
|
10123
|
+
trackColor: colors.surface.dark.toNumber(),
|
|
10124
|
+
trackFilledColor: colors.primary.dark.toNumber(),
|
|
10125
|
+
trackHeight: 6,
|
|
10126
|
+
trackBorderRadius: 3,
|
|
10127
|
+
trackLength: 200,
|
|
10128
|
+
trackHoverColor: colors.surface.dark.toNumber(),
|
|
10129
|
+
// Thumb styling
|
|
10130
|
+
thumbColor: colors.primary.light.toNumber(),
|
|
10131
|
+
thumbSize: 20,
|
|
10132
|
+
thumbBorderColor: colors.border.light.toNumber(),
|
|
10133
|
+
thumbBorderWidth: 2,
|
|
10134
|
+
thumbHoverColor: colors.primary.light.toNumber(),
|
|
10135
|
+
thumbActiveColor: colors.primary.dark.toNumber(),
|
|
10136
|
+
thumbDragScale: 1.1,
|
|
10137
|
+
// Marks/Ticks
|
|
10138
|
+
markColor: colors.border.medium.toNumber(),
|
|
10139
|
+
markHeight: 8,
|
|
10140
|
+
markWidth: 2,
|
|
10141
|
+
// Value label
|
|
10142
|
+
labelStyle: textStyles.small,
|
|
10143
|
+
labelOffset: 10,
|
|
10144
|
+
valueLabel: {
|
|
10145
|
+
backgroundColor: colors.background.dark.toNumber(),
|
|
10146
|
+
textStyle: { ...textStyles.small, color: colors.text.light.toString() },
|
|
10147
|
+
padding: { left: 6, right: 6, top: 4, bottom: 4 },
|
|
10148
|
+
cornerRadius: 4,
|
|
10149
|
+
offset: 8
|
|
10150
|
+
},
|
|
10151
|
+
// RangeSlider specific
|
|
10152
|
+
minDistance: 0,
|
|
10153
|
+
// States
|
|
10154
|
+
disabledAlpha: 0.4,
|
|
10155
|
+
// Animation & Effects
|
|
10156
|
+
animationConfig: { tension: 300, friction: 30 }
|
|
10072
10157
|
},
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10158
|
+
Toggle: {
|
|
10159
|
+
width: 50,
|
|
10160
|
+
height: 28,
|
|
10161
|
+
thumbSize: 24,
|
|
10162
|
+
trackColorOff: colors.surface.dark.toNumber(),
|
|
10163
|
+
trackColorOn: colors.success.DEFAULT.toNumber(),
|
|
10164
|
+
thumbColor: colors.surface.lightest.toNumber(),
|
|
10165
|
+
disabledColor: colors.border.medium.toNumber(),
|
|
10166
|
+
padding: 2,
|
|
10167
|
+
duration: 200,
|
|
10168
|
+
gap: 8,
|
|
10169
|
+
labelStyle: textStyles.DEFAULT,
|
|
10170
|
+
labelPosition: "right"
|
|
10076
10171
|
},
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10172
|
+
Modal: {
|
|
10173
|
+
backdropColor: 0,
|
|
10174
|
+
backdropOpacity: 0.5
|
|
10080
10175
|
},
|
|
10081
|
-
|
|
10082
|
-
backgroundColor: colors.surface.
|
|
10083
|
-
borderColor: colors.border.
|
|
10176
|
+
Dialog: {
|
|
10177
|
+
backgroundColor: colors.surface.DEFAULT.toNumber(),
|
|
10178
|
+
borderColor: colors.border.light.toNumber(),
|
|
10084
10179
|
borderWidth: 1,
|
|
10085
|
-
cornerRadius:
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10180
|
+
cornerRadius: 8,
|
|
10181
|
+
padding: 0,
|
|
10182
|
+
maxWidth: 600,
|
|
10183
|
+
showClose: true,
|
|
10184
|
+
Header: {
|
|
10185
|
+
padding: { left: 24, right: 24, top: 20, bottom: 16 },
|
|
10186
|
+
gap: 12,
|
|
10187
|
+
textStyle: textStyles.heading,
|
|
10188
|
+
closeButton: {
|
|
10189
|
+
size: 32,
|
|
10190
|
+
cornerRadius: 4,
|
|
10191
|
+
backgroundColor: colors.surface.dark.toNumber(),
|
|
10192
|
+
borderColor: colors.border.light.toNumber(),
|
|
10193
|
+
borderWidth: 1
|
|
10194
|
+
}
|
|
10195
|
+
},
|
|
10196
|
+
Content: {
|
|
10197
|
+
padding: { left: 24, right: 24, top: 16, bottom: 16 },
|
|
10198
|
+
gap: 12
|
|
10199
|
+
},
|
|
10200
|
+
Actions: {
|
|
10201
|
+
padding: { left: 24, right: 24, top: 16, bottom: 20 },
|
|
10202
|
+
gap: 12,
|
|
10203
|
+
justifyContent: "end"
|
|
10096
10204
|
}
|
|
10097
10205
|
},
|
|
10098
|
-
|
|
10099
|
-
|
|
10206
|
+
AlertDialog: {
|
|
10207
|
+
maxWidth: 500
|
|
10100
10208
|
},
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
borderColor: colors.border.medium.toNumber()
|
|
10106
|
-
//height: 32,
|
|
10209
|
+
WrapText: {
|
|
10210
|
+
wrap: true,
|
|
10211
|
+
paddingOffset: 0,
|
|
10212
|
+
textStyle: textStyles.DEFAULT
|
|
10107
10213
|
},
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
thumbDragScale: 1.1,
|
|
10127
|
-
// Marks/Ticks
|
|
10128
|
-
markColor: colors.border.medium.toNumber(),
|
|
10129
|
-
markHeight: 8,
|
|
10130
|
-
markWidth: 2,
|
|
10131
|
-
// Value label
|
|
10132
|
-
labelStyle: textStyles.small,
|
|
10133
|
-
labelOffset: 10,
|
|
10134
|
-
valueLabel: {
|
|
10135
|
-
backgroundColor: colors.surface.darkest.toNumber(),
|
|
10136
|
-
textStyle: { ...textStyles.small, color: colors.text.light.toString() },
|
|
10137
|
-
padding: { left: 6, right: 6, top: 4, bottom: 4 },
|
|
10138
|
-
cornerRadius: 4,
|
|
10139
|
-
offset: 8
|
|
10140
|
-
},
|
|
10141
|
-
// RangeSlider specific
|
|
10142
|
-
minDistance: 0,
|
|
10143
|
-
// States
|
|
10144
|
-
disabledAlpha: 0.4,
|
|
10145
|
-
// Animation & Effects
|
|
10146
|
-
animationConfig: { tension: 300, friction: 30 }
|
|
10147
|
-
},
|
|
10148
|
-
Toggle: {
|
|
10149
|
-
width: 50,
|
|
10150
|
-
height: 28,
|
|
10151
|
-
thumbSize: 24,
|
|
10152
|
-
trackColorOff: colors.surface.dark.toNumber(),
|
|
10153
|
-
trackColorOn: colors.success.DEFAULT.toNumber(),
|
|
10154
|
-
thumbColor: colors.surface.lightest.toNumber(),
|
|
10155
|
-
disabledColor: colors.border.medium.toNumber(),
|
|
10156
|
-
padding: 2,
|
|
10157
|
-
duration: 200,
|
|
10158
|
-
gap: 8,
|
|
10159
|
-
labelStyle: textStyles.DEFAULT,
|
|
10160
|
-
labelPosition: "right"
|
|
10161
|
-
},
|
|
10162
|
-
Modal: {
|
|
10163
|
-
backdropColor: 0,
|
|
10164
|
-
backdropOpacity: 0.5
|
|
10165
|
-
},
|
|
10166
|
-
Dialog: {
|
|
10167
|
-
backgroundColor: colors.surface.DEFAULT.toNumber(),
|
|
10168
|
-
borderColor: colors.border.light.toNumber(),
|
|
10169
|
-
borderWidth: 1,
|
|
10170
|
-
cornerRadius: 8,
|
|
10171
|
-
padding: 0,
|
|
10172
|
-
maxWidth: 600,
|
|
10173
|
-
showClose: true,
|
|
10174
|
-
Header: {
|
|
10175
|
-
padding: { left: 24, right: 24, top: 20, bottom: 16 },
|
|
10176
|
-
gap: 12,
|
|
10177
|
-
textStyle: textStyles.heading,
|
|
10178
|
-
closeButton: {
|
|
10179
|
-
size: 32,
|
|
10180
|
-
cornerRadius: 4,
|
|
10181
|
-
backgroundColor: colors.surface.dark.toNumber(),
|
|
10182
|
-
borderColor: colors.border.light.toNumber(),
|
|
10183
|
-
borderWidth: 1
|
|
10214
|
+
Tooltip: {
|
|
10215
|
+
position: "top",
|
|
10216
|
+
showDelay: 1e3,
|
|
10217
|
+
hideDelay: 500,
|
|
10218
|
+
offset: 8,
|
|
10219
|
+
textStyle: {
|
|
10220
|
+
fontSize: "12px",
|
|
10221
|
+
fontFamily: "Arial",
|
|
10222
|
+
color: colors.text.dark.toString(),
|
|
10223
|
+
backgroundColor: colors.warning.medium.toString(),
|
|
10224
|
+
padding: { x: 2, y: 2 }
|
|
10225
|
+
},
|
|
10226
|
+
cornerRadius: 8,
|
|
10227
|
+
animation: {
|
|
10228
|
+
fadeIn: 200,
|
|
10229
|
+
fadeOut: 200,
|
|
10230
|
+
move: { dx: 0, dy: -20 },
|
|
10231
|
+
pulse: false
|
|
10184
10232
|
}
|
|
10185
|
-
},
|
|
10186
|
-
Content: {
|
|
10187
|
-
padding: { left: 24, right: 24, top: 16, bottom: 16 },
|
|
10188
|
-
gap: 12
|
|
10189
|
-
},
|
|
10190
|
-
Actions: {
|
|
10191
|
-
padding: { left: 24, right: 24, top: 16, bottom: 20 },
|
|
10192
|
-
gap: 12,
|
|
10193
|
-
justifyContent: "end"
|
|
10194
10233
|
}
|
|
10195
|
-
}
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
},
|
|
10204
|
-
Tooltip: {
|
|
10205
|
-
position: "top",
|
|
10206
|
-
showDelay: 1e3,
|
|
10207
|
-
hideDelay: 500,
|
|
10208
|
-
offset: 8,
|
|
10209
|
-
textStyle: {
|
|
10210
|
-
fontSize: "12px",
|
|
10211
|
-
fontFamily: "Arial",
|
|
10212
|
-
color: colors.text.dark.toString(),
|
|
10213
|
-
backgroundColor: colors.warning.medium.toString(),
|
|
10214
|
-
padding: { x: 2, y: 2 }
|
|
10215
|
-
},
|
|
10216
|
-
cornerRadius: 8,
|
|
10217
|
-
animation: {
|
|
10218
|
-
fadeIn: 200,
|
|
10219
|
-
fadeOut: 200,
|
|
10220
|
-
move: { dx: 0, dy: -20 },
|
|
10221
|
-
pulse: false
|
|
10222
|
-
}
|
|
10223
|
-
}
|
|
10224
|
-
};
|
|
10234
|
+
};
|
|
10235
|
+
}
|
|
10236
|
+
const preset = getPresetWithMode("oceanBlue", "light");
|
|
10237
|
+
const defaultTheme = buildDefaultTheme(preset.colors);
|
|
10238
|
+
function createDefaultTheme(presetName = "oceanBlue", mode = "light") {
|
|
10239
|
+
const presetForMode = getPresetWithMode(presetName, mode);
|
|
10240
|
+
return buildDefaultTheme(presetForMode.colors);
|
|
10241
|
+
}
|
|
10225
10242
|
class ThemeRegistry {
|
|
10226
10243
|
globalTheme = { ...defaultTheme };
|
|
10227
10244
|
customThemes = /* @__PURE__ */ new Map();
|
|
@@ -10302,8 +10319,8 @@ class ThemeRegistry {
|
|
|
10302
10319
|
* Set color tokens for the global theme
|
|
10303
10320
|
* @param colors - ColorTokens to use globally
|
|
10304
10321
|
*/
|
|
10305
|
-
setColorTokens(
|
|
10306
|
-
this.colorTokens =
|
|
10322
|
+
setColorTokens(colors) {
|
|
10323
|
+
this.colorTokens = colors;
|
|
10307
10324
|
}
|
|
10308
10325
|
/**
|
|
10309
10326
|
* Get current color tokens
|
|
@@ -10320,15 +10337,28 @@ class ThemeRegistry {
|
|
|
10320
10337
|
return this.colorMode;
|
|
10321
10338
|
}
|
|
10322
10339
|
/**
|
|
10323
|
-
* Set color mode and
|
|
10340
|
+
* Set color mode and trigger complete remount
|
|
10324
10341
|
* Updates color tokens if a preset is active
|
|
10342
|
+
* Triggers complete remount of all active mountJSX instances
|
|
10325
10343
|
* @param mode - Color mode to set
|
|
10326
10344
|
*/
|
|
10327
10345
|
setColorMode(mode) {
|
|
10328
10346
|
if (this.colorMode !== mode) {
|
|
10329
10347
|
this.colorMode = mode;
|
|
10330
|
-
if (this.currentPresetName
|
|
10331
|
-
|
|
10348
|
+
if (this.currentPresetName) {
|
|
10349
|
+
Promise.resolve().then(() => colorPresets).then(({ getPresetWithMode: getPresetWithMode2 }) => {
|
|
10350
|
+
const preset2 = getPresetWithMode2(
|
|
10351
|
+
this.currentPresetName,
|
|
10352
|
+
mode
|
|
10353
|
+
);
|
|
10354
|
+
this.colorTokens = preset2.colors;
|
|
10355
|
+
});
|
|
10356
|
+
}
|
|
10357
|
+
setTimeout(() => {
|
|
10358
|
+
Promise.resolve().then(() => vdom).then(({ remountAll: remountAll2 }) => {
|
|
10359
|
+
remountAll2();
|
|
10360
|
+
});
|
|
10361
|
+
}, 0);
|
|
10332
10362
|
}
|
|
10333
10363
|
}
|
|
10334
10364
|
/**
|
|
@@ -10341,11 +10371,14 @@ class ThemeRegistry {
|
|
|
10341
10371
|
/**
|
|
10342
10372
|
* Set current preset name
|
|
10343
10373
|
* @param name - Preset name
|
|
10374
|
+
* @param skipNotify - If true, skip notifying listeners (used during remount)
|
|
10344
10375
|
*/
|
|
10345
|
-
setCurrentPresetName(name) {
|
|
10376
|
+
setCurrentPresetName(name, skipNotify = false) {
|
|
10346
10377
|
if (this.currentPresetName !== name) {
|
|
10347
10378
|
this.currentPresetName = name;
|
|
10348
|
-
|
|
10379
|
+
if (!skipNotify) {
|
|
10380
|
+
this.notifyListeners();
|
|
10381
|
+
}
|
|
10349
10382
|
}
|
|
10350
10383
|
}
|
|
10351
10384
|
/**
|
|
@@ -11204,6 +11237,129 @@ class PortalRegistry {
|
|
|
11204
11237
|
}
|
|
11205
11238
|
}
|
|
11206
11239
|
const portalRegistry = new PortalRegistry();
|
|
11240
|
+
class MountRegistry {
|
|
11241
|
+
entries = /* @__PURE__ */ new Map();
|
|
11242
|
+
nextId = 1;
|
|
11243
|
+
/**
|
|
11244
|
+
* Register a new mountJSX instance
|
|
11245
|
+
* @param parent - Parent container or scene
|
|
11246
|
+
* @param type - Component type or node type
|
|
11247
|
+
* @param props - Mount props
|
|
11248
|
+
* @param rootNode - Root game object
|
|
11249
|
+
* @returns Registry ID for this mount
|
|
11250
|
+
*/
|
|
11251
|
+
register(parent, type, props, rootNode, vnode) {
|
|
11252
|
+
const id = this.nextId++;
|
|
11253
|
+
this.entries.set(id, { id, parent, type, props, rootNode, vnode });
|
|
11254
|
+
DebugLogger.log("vdom", `Registered mount ${id}`);
|
|
11255
|
+
return id;
|
|
11256
|
+
}
|
|
11257
|
+
/**
|
|
11258
|
+
* Unregister a mountJSX instance
|
|
11259
|
+
* @param id - Registry ID
|
|
11260
|
+
*/
|
|
11261
|
+
unregister(id) {
|
|
11262
|
+
const entry = this.entries.get(id);
|
|
11263
|
+
if (entry) {
|
|
11264
|
+
DebugLogger.log("vdom", `Unregistered mount ${id}`);
|
|
11265
|
+
this.entries.delete(id);
|
|
11266
|
+
}
|
|
11267
|
+
}
|
|
11268
|
+
/**
|
|
11269
|
+
* Get a specific mount entry by registry ID
|
|
11270
|
+
* @param id - Registry ID
|
|
11271
|
+
* @returns Mount entry or undefined if not found
|
|
11272
|
+
*/
|
|
11273
|
+
getEntry(id) {
|
|
11274
|
+
return this.entries.get(id);
|
|
11275
|
+
}
|
|
11276
|
+
/**
|
|
11277
|
+
* Get all active mount entries
|
|
11278
|
+
* @returns Array of mount entries
|
|
11279
|
+
*/
|
|
11280
|
+
getAllEntries() {
|
|
11281
|
+
return Array.from(this.entries.values());
|
|
11282
|
+
}
|
|
11283
|
+
/**
|
|
11284
|
+
* Clear all entries (for testing)
|
|
11285
|
+
*/
|
|
11286
|
+
clear() {
|
|
11287
|
+
this.entries.clear();
|
|
11288
|
+
this.nextId = 1;
|
|
11289
|
+
}
|
|
11290
|
+
}
|
|
11291
|
+
const mountRegistry = new MountRegistry();
|
|
11292
|
+
function remountAll() {
|
|
11293
|
+
const entries = mountRegistry.getAllEntries();
|
|
11294
|
+
if (entries.length === 0) {
|
|
11295
|
+
DebugLogger.log("vdom", "No mounts to remount");
|
|
11296
|
+
return;
|
|
11297
|
+
}
|
|
11298
|
+
console.log(`[REMOUNT] Starting remount of ${entries.length} root(s)`);
|
|
11299
|
+
entries.forEach((entry) => {
|
|
11300
|
+
try {
|
|
11301
|
+
const scene = entry.parent instanceof Phaser$1.Scene ? entry.parent : entry.parent.scene;
|
|
11302
|
+
if (!scene || !scene.sys) {
|
|
11303
|
+
console.warn("[REMOUNT] Scene is invalid, skipping remount");
|
|
11304
|
+
return;
|
|
11305
|
+
}
|
|
11306
|
+
const currentVNode = scene.__rootVNode;
|
|
11307
|
+
if (entry.rootNode instanceof Phaser$1.GameObjects.Container) {
|
|
11308
|
+
const children = entry.rootNode.getAll();
|
|
11309
|
+
children.forEach((child) => {
|
|
11310
|
+
;
|
|
11311
|
+
entry.rootNode.remove(child, true);
|
|
11312
|
+
});
|
|
11313
|
+
}
|
|
11314
|
+
if (currentVNode) {
|
|
11315
|
+
const flatChildren = flattenChildren(currentVNode.children);
|
|
11316
|
+
flatChildren.forEach(unmount);
|
|
11317
|
+
if (currentVNode.__ctx) {
|
|
11318
|
+
disposeCtx(currentVNode.__ctx);
|
|
11319
|
+
delete currentVNode.__ctx;
|
|
11320
|
+
}
|
|
11321
|
+
}
|
|
11322
|
+
const { width, height, disableAutoSize = false, ...componentProps } = entry.props;
|
|
11323
|
+
const renderContext = getRenderContext(entry.parent);
|
|
11324
|
+
renderContext.setViewport(width, height, scene);
|
|
11325
|
+
portalRegistry.setViewportSize(scene, width, height);
|
|
11326
|
+
let vnode;
|
|
11327
|
+
if (disableAutoSize) {
|
|
11328
|
+
vnode = { type: entry.type, props: { ...componentProps, width, height }, children: [] };
|
|
11329
|
+
} else {
|
|
11330
|
+
const componentVNode = {
|
|
11331
|
+
type: entry.type,
|
|
11332
|
+
props: componentProps,
|
|
11333
|
+
children: []
|
|
11334
|
+
};
|
|
11335
|
+
vnode = {
|
|
11336
|
+
type: SceneWrapper,
|
|
11337
|
+
props: {
|
|
11338
|
+
width,
|
|
11339
|
+
height,
|
|
11340
|
+
children: componentVNode
|
|
11341
|
+
},
|
|
11342
|
+
children: []
|
|
11343
|
+
};
|
|
11344
|
+
}
|
|
11345
|
+
;
|
|
11346
|
+
scene.__rootVNode = vnode;
|
|
11347
|
+
const rootNode = mount(entry.parent, vnode);
|
|
11348
|
+
if (rootNode instanceof Phaser$1.GameObjects.Container) {
|
|
11349
|
+
;
|
|
11350
|
+
rootNode.__mountRootId = generateMountRootId();
|
|
11351
|
+
}
|
|
11352
|
+
entry.rootNode = rootNode;
|
|
11353
|
+
entry.vnode = vnode;
|
|
11354
|
+
rootNode.__registryId = entry.id;
|
|
11355
|
+
rootNode.__rootVNode = vnode;
|
|
11356
|
+
console.log("[REMOUNT] Successfully remounted entry", entry.id);
|
|
11357
|
+
} catch (error) {
|
|
11358
|
+
console.error("[REMOUNT] Failed to remount entry", entry.id, error);
|
|
11359
|
+
}
|
|
11360
|
+
});
|
|
11361
|
+
console.log("[REMOUNT] Remount complete");
|
|
11362
|
+
}
|
|
11207
11363
|
function flattenChildren(children) {
|
|
11208
11364
|
if (!children) return [];
|
|
11209
11365
|
return children.flat(Infinity);
|
|
@@ -11596,6 +11752,11 @@ function unmount(vnode) {
|
|
|
11596
11752
|
attachRef(ref, null);
|
|
11597
11753
|
const flatChildren = flattenChildren(vnode.children);
|
|
11598
11754
|
flatChildren.forEach(unmount);
|
|
11755
|
+
const node = vnode.__node;
|
|
11756
|
+
if (node?.__registryId !== void 0) {
|
|
11757
|
+
mountRegistry.unregister(node.__registryId);
|
|
11758
|
+
delete node.__registryId;
|
|
11759
|
+
}
|
|
11599
11760
|
const parent = vnode.__parent;
|
|
11600
11761
|
if (parent) host.remove(parent, vnode.__node);
|
|
11601
11762
|
}
|
|
@@ -11871,8 +12032,47 @@ function mountJSX(parentOrScene, type, props = { width: 0, height: 0 }) {
|
|
|
11871
12032
|
if (rootNode instanceof Phaser$1.GameObjects.Container) {
|
|
11872
12033
|
rootNode.__mountRootId = generateMountRootId();
|
|
11873
12034
|
}
|
|
11874
|
-
|
|
12035
|
+
rootNode.__rootVNode = vnode;
|
|
12036
|
+
const registryId = mountRegistry.register(parentOrScene, type, props, rootNode, vnode);
|
|
12037
|
+
rootNode.__registryId = registryId;
|
|
12038
|
+
const handle = rootNode;
|
|
12039
|
+
handle.unmount = () => unmountJSX(handle);
|
|
12040
|
+
return handle;
|
|
11875
12041
|
}
|
|
12042
|
+
function unmountJSX(target) {
|
|
12043
|
+
const scene = target instanceof Phaser$1.Scene ? target : target.scene;
|
|
12044
|
+
const targetWithVNode = target;
|
|
12045
|
+
const sceneWithVNode = scene;
|
|
12046
|
+
const rootVNode = targetWithVNode.__rootVNode ?? sceneWithVNode?.__rootVNode;
|
|
12047
|
+
if (rootVNode) {
|
|
12048
|
+
unmount(rootVNode);
|
|
12049
|
+
if (targetWithVNode.__rootVNode === rootVNode) {
|
|
12050
|
+
delete targetWithVNode.__rootVNode;
|
|
12051
|
+
}
|
|
12052
|
+
if (sceneWithVNode?.__rootVNode === rootVNode) {
|
|
12053
|
+
delete sceneWithVNode.__rootVNode;
|
|
12054
|
+
}
|
|
12055
|
+
return;
|
|
12056
|
+
}
|
|
12057
|
+
if (targetWithVNode.__registryId !== void 0) {
|
|
12058
|
+
const entry = mountRegistry.getEntry(targetWithVNode.__registryId);
|
|
12059
|
+
if (entry?.vnode) {
|
|
12060
|
+
unmount(entry.vnode);
|
|
12061
|
+
return;
|
|
12062
|
+
}
|
|
12063
|
+
}
|
|
12064
|
+
DebugLogger.log("vdom", "unmountJSX called but no root VNode found on target");
|
|
12065
|
+
}
|
|
12066
|
+
const vdom = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12067
|
+
__proto__: null,
|
|
12068
|
+
createElement,
|
|
12069
|
+
mount,
|
|
12070
|
+
mountJSX,
|
|
12071
|
+
patchVNode,
|
|
12072
|
+
remountAll,
|
|
12073
|
+
unmount,
|
|
12074
|
+
unmountJSX
|
|
12075
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11876
12076
|
function getCurrent() {
|
|
11877
12077
|
return _currentCtx;
|
|
11878
12078
|
}
|
|
@@ -13834,6 +14034,8 @@ function Portal(props) {
|
|
|
13834
14034
|
const depth = props.depth ?? 1e3;
|
|
13835
14035
|
const scene = useScene();
|
|
13836
14036
|
const blockEvents = props.blockEvents ?? true;
|
|
14037
|
+
const mountedNodesRef = useRef([]);
|
|
14038
|
+
const previousChildrenRef = useRef([]);
|
|
13837
14039
|
useEffect(() => {
|
|
13838
14040
|
const portalContainer = portalRegistry.register(
|
|
13839
14041
|
portalId,
|
|
@@ -13849,14 +14051,18 @@ function Portal(props) {
|
|
|
13849
14051
|
blockerContainer.setDepth(-1);
|
|
13850
14052
|
}
|
|
13851
14053
|
const children = Array.isArray(props.children) ? props.children : [props.children];
|
|
14054
|
+
const mountedNodes = [];
|
|
13852
14055
|
for (const child of children) {
|
|
13853
14056
|
if (child) {
|
|
13854
14057
|
const mountedNode = mount(portalContainer, child);
|
|
13855
14058
|
if (mountedNode) {
|
|
13856
14059
|
portalContainer.add(mountedNode);
|
|
14060
|
+
mountedNodes.push(mountedNode);
|
|
13857
14061
|
}
|
|
13858
14062
|
}
|
|
13859
14063
|
}
|
|
14064
|
+
mountedNodesRef.current = mountedNodes;
|
|
14065
|
+
previousChildrenRef.current = children;
|
|
13860
14066
|
const gestureManager = getGestureManager(scene);
|
|
13861
14067
|
if (blockEvents && blockerContainer) {
|
|
13862
14068
|
const blocker = blockerContainer;
|
|
@@ -13903,7 +14109,31 @@ function Portal(props) {
|
|
|
13903
14109
|
}
|
|
13904
14110
|
portalRegistry.unregister(portalId);
|
|
13905
14111
|
};
|
|
13906
|
-
}, [portalId, depth, scene,
|
|
14112
|
+
}, [portalId, depth, scene, blockEvents]);
|
|
14113
|
+
useEffect(() => {
|
|
14114
|
+
const portal = portalRegistry.get(portalId);
|
|
14115
|
+
if (!portal) return;
|
|
14116
|
+
const portalContainer = portal.container;
|
|
14117
|
+
const newChildren = Array.isArray(props.children) ? props.children : [props.children];
|
|
14118
|
+
const oldChildren = previousChildrenRef.current;
|
|
14119
|
+
const maxLen = Math.max(oldChildren.length, newChildren.length);
|
|
14120
|
+
for (let i = 0; i < maxLen; i++) {
|
|
14121
|
+
const oldChild = oldChildren[i];
|
|
14122
|
+
const newChild = newChildren[i];
|
|
14123
|
+
if (oldChild && newChild) {
|
|
14124
|
+
patchVNode(portalContainer, oldChild, newChild);
|
|
14125
|
+
} else if (!oldChild && newChild) {
|
|
14126
|
+
const mountedNode = mount(portalContainer, newChild);
|
|
14127
|
+
if (mountedNode) {
|
|
14128
|
+
portalContainer.add(mountedNode);
|
|
14129
|
+
mountedNodesRef.current.push(mountedNode);
|
|
14130
|
+
}
|
|
14131
|
+
} else if (oldChild && !newChild) {
|
|
14132
|
+
unmount(oldChild);
|
|
14133
|
+
}
|
|
14134
|
+
}
|
|
14135
|
+
previousChildrenRef.current = newChildren;
|
|
14136
|
+
}, [props.children, portalId]);
|
|
13907
14137
|
return null;
|
|
13908
14138
|
}
|
|
13909
14139
|
function Modal(props) {
|
|
@@ -13990,19 +14220,7 @@ function Modal(props) {
|
|
|
13990
14220
|
view.setVisible(false);
|
|
13991
14221
|
backdrop.setVisible(false);
|
|
13992
14222
|
}
|
|
13993
|
-
}, [
|
|
13994
|
-
backdropAnimation,
|
|
13995
|
-
closeDurationMs,
|
|
13996
|
-
isVisible,
|
|
13997
|
-
openDurationMs,
|
|
13998
|
-
props.onClosed,
|
|
13999
|
-
props.onOpen,
|
|
14000
|
-
props.onRequestClose,
|
|
14001
|
-
props.show,
|
|
14002
|
-
stopBackdropEffects,
|
|
14003
|
-
stopViewEffects,
|
|
14004
|
-
viewAnimation
|
|
14005
|
-
]);
|
|
14223
|
+
}, [props.show]);
|
|
14006
14224
|
useEffect(() => {
|
|
14007
14225
|
if (!closeOnEscape || !props.show) return;
|
|
14008
14226
|
const handleKeyDown = (e) => {
|
|
@@ -15308,11 +15526,22 @@ function calculateSliderSize(size) {
|
|
|
15308
15526
|
return { border, outer, dimension };
|
|
15309
15527
|
}
|
|
15310
15528
|
function ScrollSlider(props) {
|
|
15311
|
-
const {
|
|
15529
|
+
const {
|
|
15530
|
+
direction,
|
|
15531
|
+
scrollPosition,
|
|
15532
|
+
viewportSize,
|
|
15533
|
+
contentSize,
|
|
15534
|
+
onScroll,
|
|
15535
|
+
momentum = true,
|
|
15536
|
+
onMomentumEnd
|
|
15537
|
+
} = props;
|
|
15312
15538
|
const { props: themed } = getThemedProps("ScrollSlider", void 0, {});
|
|
15313
15539
|
const sliderRef = useRef(null);
|
|
15314
15540
|
const isDraggingRef = useRef(false);
|
|
15315
15541
|
const trackContainerRef = useRef(null);
|
|
15542
|
+
const velocityRef = useRef(0);
|
|
15543
|
+
const lastTimeRef = useRef(0);
|
|
15544
|
+
const tweenRef = useRef(null);
|
|
15316
15545
|
const isVertical = direction === "vertical";
|
|
15317
15546
|
const { border, outer, dimension } = calculateSliderSize(props.size);
|
|
15318
15547
|
const containerWithLayout = trackContainerRef.current;
|
|
@@ -15328,18 +15557,60 @@ function ScrollSlider(props) {
|
|
|
15328
15557
|
data.stopPropagation();
|
|
15329
15558
|
if (data.state === "start") {
|
|
15330
15559
|
isDraggingRef.current = true;
|
|
15560
|
+
velocityRef.current = 0;
|
|
15561
|
+
lastTimeRef.current = Date.now();
|
|
15562
|
+
if (tweenRef.current) {
|
|
15563
|
+
tweenRef.current.stop();
|
|
15564
|
+
tweenRef.current = null;
|
|
15565
|
+
}
|
|
15331
15566
|
return;
|
|
15332
15567
|
}
|
|
15333
15568
|
if (data.state === "end") {
|
|
15334
15569
|
isDraggingRef.current = false;
|
|
15570
|
+
if (momentum && Math.abs(velocityRef.current) > 0.1) {
|
|
15571
|
+
startMomentum(scrollPosition);
|
|
15572
|
+
} else if (onMomentumEnd) {
|
|
15573
|
+
onMomentumEnd();
|
|
15574
|
+
}
|
|
15335
15575
|
return;
|
|
15336
15576
|
}
|
|
15337
15577
|
if (!isDraggingRef.current) return;
|
|
15338
15578
|
const delta = isVertical ? data.dy ?? 0 : data.dx ?? 0;
|
|
15579
|
+
const now = Date.now();
|
|
15580
|
+
const deltaTime = now - lastTimeRef.current;
|
|
15581
|
+
if (deltaTime > 0) {
|
|
15582
|
+
velocityRef.current = delta / deltaTime * 1e3;
|
|
15583
|
+
lastTimeRef.current = now;
|
|
15584
|
+
}
|
|
15339
15585
|
const newThumbPos = Math.max(0, Math.min(thumbRange, thumbPosition + delta));
|
|
15340
15586
|
const newScrollPos = thumbRange > 0 ? newThumbPos / thumbRange * maxScroll : 0;
|
|
15341
15587
|
onScroll(newScrollPos);
|
|
15342
15588
|
};
|
|
15589
|
+
const startMomentum = (startPos) => {
|
|
15590
|
+
if (!sliderRef.current?.scene) return;
|
|
15591
|
+
const scene = sliderRef.current.scene;
|
|
15592
|
+
const duration = Math.min(1e3, Math.max(200, Math.abs(velocityRef.current)));
|
|
15593
|
+
const targetScrollPos = Math.max(
|
|
15594
|
+
0,
|
|
15595
|
+
Math.min(maxScroll, startPos + velocityRef.current * (duration / 1e3))
|
|
15596
|
+
);
|
|
15597
|
+
tweenRef.current = scene.tweens.add({
|
|
15598
|
+
targets: { pos: startPos },
|
|
15599
|
+
pos: targetScrollPos,
|
|
15600
|
+
duration,
|
|
15601
|
+
ease: "Quad.easeOut",
|
|
15602
|
+
onUpdate: (tween) => {
|
|
15603
|
+
const target = tween.targets[0];
|
|
15604
|
+
onScroll(target.pos);
|
|
15605
|
+
},
|
|
15606
|
+
onComplete: () => {
|
|
15607
|
+
tweenRef.current = null;
|
|
15608
|
+
if (onMomentumEnd) {
|
|
15609
|
+
onMomentumEnd();
|
|
15610
|
+
}
|
|
15611
|
+
}
|
|
15612
|
+
});
|
|
15613
|
+
};
|
|
15343
15614
|
const handleBackgroundTouch = (data) => {
|
|
15344
15615
|
data.stopPropagation();
|
|
15345
15616
|
const localPos = isVertical ? data.localY ?? 0 : data.localX ?? 0;
|
|
@@ -15405,13 +15676,23 @@ function ScrollView(props) {
|
|
|
15405
15676
|
showVerticalSlider = "auto",
|
|
15406
15677
|
showHorizontalSlider = "auto",
|
|
15407
15678
|
scroll: initialScroll,
|
|
15408
|
-
onScrollInfoChange
|
|
15679
|
+
onScrollInfoChange,
|
|
15680
|
+
snap = false,
|
|
15681
|
+
snapAlignment = "start",
|
|
15682
|
+
snapThreshold = 20,
|
|
15683
|
+
momentum = true
|
|
15409
15684
|
} = props;
|
|
15410
15685
|
const [scroll, setScroll] = useState(initialScroll ?? { dx: 0, dy: 0 });
|
|
15686
|
+
const scrollRef = useRef(scroll);
|
|
15411
15687
|
const contentRef = useRef(null);
|
|
15412
15688
|
const viewportRef = useRef(null);
|
|
15413
15689
|
const [contentHeight, setContentHeight] = useState(0);
|
|
15414
15690
|
const [contentWidth, setContentWidth] = useState(0);
|
|
15691
|
+
const [velocity, setVelocity] = useState({ vx: 0, vy: 0 });
|
|
15692
|
+
const [lastTime, setLastTime] = useState(0);
|
|
15693
|
+
const tweenRef = useRef(null);
|
|
15694
|
+
const wheelSnapTimeoutRef = useRef(null);
|
|
15695
|
+
const WHEEL_SNAP_DELAY = 200;
|
|
15415
15696
|
const { outer: sliderSize } = calculateSliderSize(props.sliderSize);
|
|
15416
15697
|
const viewportHeight = viewportRef.current?.height ?? 0;
|
|
15417
15698
|
const viewportWidth = viewportRef.current?.width ?? 0;
|
|
@@ -15424,9 +15705,24 @@ function ScrollView(props) {
|
|
|
15424
15705
|
const showHorizontalSliderActual = showHorizontalSlider === true || needsHorizontalScroll && showHorizontalSlider === "auto";
|
|
15425
15706
|
const maxScrollY = Math.max(0, effectiveContentHeight - viewportHeight);
|
|
15426
15707
|
const maxScrollX = Math.max(0, effectiveContentWidth - viewportWidth);
|
|
15708
|
+
const updateScroll = (value) => {
|
|
15709
|
+
setScroll((prev) => {
|
|
15710
|
+
const next = typeof value === "function" ? value(prev) : value;
|
|
15711
|
+
scrollRef.current = next;
|
|
15712
|
+
return next;
|
|
15713
|
+
});
|
|
15714
|
+
};
|
|
15715
|
+
const stopActiveTween = () => {
|
|
15716
|
+
if (tweenRef.current) {
|
|
15717
|
+
tweenRef.current.stop();
|
|
15718
|
+
tweenRef.current = null;
|
|
15719
|
+
}
|
|
15720
|
+
};
|
|
15721
|
+
const resolvedSnapThreshold = typeof snap === "object" && "positions" in snap ? snap.threshold ?? snapThreshold : snapThreshold;
|
|
15722
|
+
const effectiveSnapThreshold = resolvedSnapThreshold === void 0 || resolvedSnapThreshold < 0 ? Infinity : resolvedSnapThreshold;
|
|
15427
15723
|
useEffect(() => {
|
|
15428
15724
|
if (initialScroll) {
|
|
15429
|
-
|
|
15725
|
+
updateScroll(initialScroll);
|
|
15430
15726
|
}
|
|
15431
15727
|
}, [initialScroll]);
|
|
15432
15728
|
useEffect(() => {
|
|
@@ -15481,27 +15777,168 @@ function ScrollView(props) {
|
|
|
15481
15777
|
const maxScrollX2 = Math.max(0, contentWidth2 - viewportWidth2);
|
|
15482
15778
|
const newScrollY = Math.max(0, Math.min(maxScrollY2, scroll.dy - deltaY));
|
|
15483
15779
|
const newScrollX = Math.max(0, Math.min(maxScrollX2, scroll.dx - deltaX));
|
|
15484
|
-
|
|
15780
|
+
updateScroll({ dx: newScrollX, dy: newScrollY });
|
|
15781
|
+
};
|
|
15782
|
+
const startMomentum = () => {
|
|
15783
|
+
if (!contentRef.current?.scene) return;
|
|
15784
|
+
const scene = contentRef.current.scene;
|
|
15785
|
+
const duration = Math.min(1e3, Math.max(200, Math.abs(velocity.vx) + Math.abs(velocity.vy)));
|
|
15786
|
+
const currentScroll = scrollRef.current;
|
|
15787
|
+
const baseTargetDx = Math.max(
|
|
15788
|
+
0,
|
|
15789
|
+
Math.min(maxScrollX, currentScroll.dx - velocity.vx * (duration / 1e3))
|
|
15790
|
+
);
|
|
15791
|
+
const baseTargetDy = Math.max(
|
|
15792
|
+
0,
|
|
15793
|
+
Math.min(maxScrollY, currentScroll.dy - velocity.vy * (duration / 1e3))
|
|
15794
|
+
);
|
|
15795
|
+
const snappedTarget = snap ? calculateSnapDestination(baseTargetDx, baseTargetDy) : null;
|
|
15796
|
+
stopActiveTween();
|
|
15797
|
+
tweenRef.current = scene.tweens.add({
|
|
15798
|
+
targets: { dx: currentScroll.dx, dy: currentScroll.dy },
|
|
15799
|
+
dx: snappedTarget?.dx ?? baseTargetDx,
|
|
15800
|
+
dy: snappedTarget?.dy ?? baseTargetDy,
|
|
15801
|
+
duration,
|
|
15802
|
+
ease: "Quad.easeOut",
|
|
15803
|
+
onUpdate: (tween) => {
|
|
15804
|
+
const target = tween.targets[0];
|
|
15805
|
+
updateScroll({ dx: target.dx, dy: target.dy });
|
|
15806
|
+
},
|
|
15807
|
+
onComplete: () => {
|
|
15808
|
+
tweenRef.current = null;
|
|
15809
|
+
}
|
|
15810
|
+
});
|
|
15811
|
+
};
|
|
15812
|
+
const getSnapTargets = () => {
|
|
15813
|
+
const viewportHeightCurrent = viewportRef.current?.height ?? viewportHeight;
|
|
15814
|
+
const viewportWidthCurrent = viewportRef.current?.width ?? viewportWidth;
|
|
15815
|
+
if (typeof snap === "object" && "positions" in snap) {
|
|
15816
|
+
const sorted = [...snap.positions].sort((a, b) => a - b);
|
|
15817
|
+
const inferredSizeY = sorted.length > 1 ? Math.max(0, (sorted[1] ?? 0) - (sorted[0] ?? 0)) : viewportHeightCurrent || 0;
|
|
15818
|
+
const inferredSizeX = sorted.length > 1 ? Math.max(0, (sorted[1] ?? 0) - (sorted[0] ?? 0)) : viewportWidthCurrent || 0;
|
|
15819
|
+
const targetsX = sorted.map((position, index) => {
|
|
15820
|
+
const next = sorted[index + 1];
|
|
15821
|
+
const size = next !== void 0 ? Math.max(0, next - position) : inferredSizeX > 0 ? inferredSizeX : viewportWidthCurrent || 0;
|
|
15822
|
+
return { position, size };
|
|
15823
|
+
});
|
|
15824
|
+
const targetsY = sorted.map((position, index) => {
|
|
15825
|
+
const next = sorted[index + 1];
|
|
15826
|
+
const size = next !== void 0 ? Math.max(0, next - position) : inferredSizeY > 0 ? inferredSizeY : viewportHeightCurrent || 0;
|
|
15827
|
+
return { position, size };
|
|
15828
|
+
});
|
|
15829
|
+
return { x: targetsX, y: targetsY };
|
|
15830
|
+
}
|
|
15831
|
+
return { x: [], y: [] };
|
|
15832
|
+
};
|
|
15833
|
+
const findNearestSnap = (current, targets, viewportSize, maxScroll) => {
|
|
15834
|
+
if (targets.length === 0) return current;
|
|
15835
|
+
let nearest = current;
|
|
15836
|
+
let minDistance = Infinity;
|
|
15837
|
+
for (const { position, size } of targets) {
|
|
15838
|
+
let adjustedPos = position;
|
|
15839
|
+
if (snapAlignment === "center") {
|
|
15840
|
+
adjustedPos = position + size / 2 - viewportSize / 2;
|
|
15841
|
+
} else if (snapAlignment === "end") {
|
|
15842
|
+
adjustedPos = position + size - viewportSize;
|
|
15843
|
+
}
|
|
15844
|
+
adjustedPos = Math.max(0, Math.min(maxScroll, adjustedPos));
|
|
15845
|
+
const distance = Math.abs(current - adjustedPos);
|
|
15846
|
+
if (distance < minDistance && distance <= effectiveSnapThreshold) {
|
|
15847
|
+
minDistance = distance;
|
|
15848
|
+
nearest = adjustedPos;
|
|
15849
|
+
} else if (distance < minDistance && effectiveSnapThreshold === Infinity) {
|
|
15850
|
+
minDistance = distance;
|
|
15851
|
+
nearest = adjustedPos;
|
|
15852
|
+
}
|
|
15853
|
+
}
|
|
15854
|
+
return nearest;
|
|
15855
|
+
};
|
|
15856
|
+
const calculateSnapDestination = (baseDx, baseDy) => {
|
|
15857
|
+
const { x: xTargets, y: yTargets } = getSnapTargets();
|
|
15858
|
+
const viewportHeightLocal = viewportRef.current?.height ?? 0;
|
|
15859
|
+
const viewportWidthLocal = viewportRef.current?.width ?? 0;
|
|
15860
|
+
const targetDx = findNearestSnap(baseDx, xTargets, viewportWidthLocal, maxScrollX);
|
|
15861
|
+
const targetDy = findNearestSnap(baseDy, yTargets, viewportHeightLocal, maxScrollY);
|
|
15862
|
+
return { dx: targetDx, dy: targetDy };
|
|
15863
|
+
};
|
|
15864
|
+
const applySnap = () => {
|
|
15865
|
+
if (!contentRef.current?.scene || !snap) return;
|
|
15866
|
+
const currentScroll = scrollRef.current;
|
|
15867
|
+
const { dx: targetDx, dy: targetDy } = calculateSnapDestination(
|
|
15868
|
+
currentScroll.dx,
|
|
15869
|
+
currentScroll.dy
|
|
15870
|
+
);
|
|
15871
|
+
if (targetDx === currentScroll.dx && targetDy === currentScroll.dy) return;
|
|
15872
|
+
const scene = contentRef.current.scene;
|
|
15873
|
+
stopActiveTween();
|
|
15874
|
+
tweenRef.current = scene.tweens.add({
|
|
15875
|
+
targets: { dx: currentScroll.dx, dy: currentScroll.dy },
|
|
15876
|
+
dx: targetDx,
|
|
15877
|
+
dy: targetDy,
|
|
15878
|
+
duration: 250,
|
|
15879
|
+
ease: "Quad.easeOut",
|
|
15880
|
+
onUpdate: (tween) => {
|
|
15881
|
+
const target = tween.targets[0];
|
|
15882
|
+
updateScroll({ dx: target.dx, dy: target.dy });
|
|
15883
|
+
},
|
|
15884
|
+
onComplete: () => {
|
|
15885
|
+
tweenRef.current = null;
|
|
15886
|
+
}
|
|
15887
|
+
});
|
|
15485
15888
|
};
|
|
15486
15889
|
const handleVerticalScroll = (scrollPos) => {
|
|
15487
15890
|
const clampedScrollPos = Math.max(0, Math.min(maxScrollY, scrollPos));
|
|
15488
|
-
|
|
15891
|
+
updateScroll((prev) => ({ ...prev, dy: clampedScrollPos }));
|
|
15489
15892
|
};
|
|
15490
15893
|
const handleHorizontalScroll = (scrollPos) => {
|
|
15491
15894
|
const clampedScrollPos = Math.max(0, Math.min(maxScrollX, scrollPos));
|
|
15492
|
-
|
|
15895
|
+
updateScroll((prev) => ({ ...prev, dx: clampedScrollPos }));
|
|
15896
|
+
};
|
|
15897
|
+
const handleSliderMomentumEnd = () => {
|
|
15898
|
+
if (snap) {
|
|
15899
|
+
applySnap();
|
|
15900
|
+
}
|
|
15493
15901
|
};
|
|
15494
15902
|
const handleTouchMove = (data) => {
|
|
15495
|
-
if (data.state === "end")
|
|
15903
|
+
if (data.state === "end") {
|
|
15904
|
+
if (momentum && (Math.abs(velocity.vx) > 0.1 || Math.abs(velocity.vy) > 0.1)) {
|
|
15905
|
+
startMomentum();
|
|
15906
|
+
} else if (snap) {
|
|
15907
|
+
applySnap();
|
|
15908
|
+
}
|
|
15909
|
+
return;
|
|
15910
|
+
}
|
|
15911
|
+
if (data.state === "start") {
|
|
15912
|
+
stopActiveTween();
|
|
15913
|
+
setVelocity({ vx: 0, vy: 0 });
|
|
15914
|
+
setLastTime(Date.now());
|
|
15915
|
+
data.stopPropagation();
|
|
15916
|
+
return;
|
|
15917
|
+
}
|
|
15496
15918
|
data.stopPropagation();
|
|
15497
15919
|
const deltaX = data.dx ?? 0;
|
|
15498
15920
|
const deltaY = data.dy ?? 0;
|
|
15921
|
+
const now = Date.now();
|
|
15922
|
+
const deltaTime = now - lastTime;
|
|
15923
|
+
if (deltaTime > 0) {
|
|
15924
|
+
const newVx = deltaX / deltaTime * 1e3;
|
|
15925
|
+
const newVy = deltaY / deltaTime * 1e3;
|
|
15926
|
+
setVelocity({ vx: newVx, vy: newVy });
|
|
15927
|
+
setLastTime(now);
|
|
15928
|
+
}
|
|
15499
15929
|
calc(deltaX, deltaY);
|
|
15500
15930
|
};
|
|
15501
15931
|
const handleWheel = (data) => {
|
|
15502
15932
|
data.stopPropagation();
|
|
15503
15933
|
data.preventDefault();
|
|
15934
|
+
stopActiveTween();
|
|
15504
15935
|
calc(-data.deltaX, -data.deltaY);
|
|
15936
|
+
if (snap) {
|
|
15937
|
+
if (wheelSnapTimeoutRef.current) {
|
|
15938
|
+
clearTimeout(wheelSnapTimeoutRef.current);
|
|
15939
|
+
}
|
|
15940
|
+
wheelSnapTimeoutRef.current = setTimeout(() => applySnap(), WHEEL_SNAP_DELAY);
|
|
15941
|
+
}
|
|
15505
15942
|
};
|
|
15506
15943
|
const redraw = useRedraw();
|
|
15507
15944
|
const [visible, setVisible] = useState(false);
|
|
@@ -15511,6 +15948,10 @@ function ScrollView(props) {
|
|
|
15511
15948
|
return () => {
|
|
15512
15949
|
clearTimeout(timer1);
|
|
15513
15950
|
clearTimeout(timer2);
|
|
15951
|
+
if (wheelSnapTimeoutRef.current) {
|
|
15952
|
+
clearTimeout(wheelSnapTimeoutRef.current);
|
|
15953
|
+
}
|
|
15954
|
+
stopActiveTween();
|
|
15514
15955
|
};
|
|
15515
15956
|
}, [showVerticalSliderActual, showHorizontalSliderActual]);
|
|
15516
15957
|
return /* @__PURE__ */ jsx(View, { visible, children: /* @__PURE__ */ jsxs(View, { direction: "row", width: "100%", height: "100%", gap: 0, padding: 0, children: [
|
|
@@ -15567,7 +16008,9 @@ function ScrollView(props) {
|
|
|
15567
16008
|
scrollPosition: scroll.dx,
|
|
15568
16009
|
viewportSize: viewportWidth,
|
|
15569
16010
|
contentSize: contentWidth,
|
|
15570
|
-
onScroll: handleHorizontalScroll
|
|
16011
|
+
onScroll: handleHorizontalScroll,
|
|
16012
|
+
momentum,
|
|
16013
|
+
onMomentumEnd: handleSliderMomentumEnd
|
|
15571
16014
|
}
|
|
15572
16015
|
) })
|
|
15573
16016
|
] }),
|
|
@@ -15580,7 +16023,9 @@ function ScrollView(props) {
|
|
|
15580
16023
|
scrollPosition: scroll.dy,
|
|
15581
16024
|
viewportSize: viewportHeight,
|
|
15582
16025
|
contentSize: effectiveContentHeight,
|
|
15583
|
-
onScroll: handleVerticalScroll
|
|
16026
|
+
onScroll: handleVerticalScroll,
|
|
16027
|
+
momentum,
|
|
16028
|
+
onMomentumEnd: handleSliderMomentumEnd
|
|
15584
16029
|
}
|
|
15585
16030
|
) }),
|
|
15586
16031
|
showHorizontalSliderActual && // Placeholder corner for potential icon - matches slider dimensions
|
|
@@ -16202,23 +16647,34 @@ function Sidebar(props) {
|
|
|
16202
16647
|
const primaryContent = sectionsContent ?? (!hasSections ? props.children : null) ?? null;
|
|
16203
16648
|
const extraContent = hasSections ? props.children ?? null : null;
|
|
16204
16649
|
const contentNodes = [...normalizeChildren(primaryContent), ...normalizeChildren(extraContent)];
|
|
16205
|
-
return /* @__PURE__ */ jsxs(
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16650
|
+
return /* @__PURE__ */ jsxs(
|
|
16651
|
+
View,
|
|
16652
|
+
{
|
|
16653
|
+
...combinedProps,
|
|
16654
|
+
theme: nestedTheme,
|
|
16655
|
+
backgroundColor: themed.backgroundColor,
|
|
16656
|
+
backgroundAlpha: themed.backgroundAlpha,
|
|
16657
|
+
padding: themed.padding,
|
|
16658
|
+
gap: themed.gap,
|
|
16659
|
+
children: [
|
|
16660
|
+
props.header ? /* @__PURE__ */ jsx(View, { ...headerStyle, children: props.header }) : null,
|
|
16661
|
+
scrollable ? /* @__PURE__ */ jsx(
|
|
16662
|
+
ScrollView,
|
|
16663
|
+
{
|
|
16664
|
+
flex: 1,
|
|
16665
|
+
width: "fill",
|
|
16666
|
+
height: "fill",
|
|
16667
|
+
showVerticalSlider: "auto",
|
|
16668
|
+
showHorizontalSlider: false,
|
|
16669
|
+
sliderSize: "tiny",
|
|
16670
|
+
theme: nestedTheme,
|
|
16671
|
+
children: /* @__PURE__ */ jsx(View, { direction: "column", gap: effectiveGap, width: "fill", children: contentNodes })
|
|
16672
|
+
}
|
|
16673
|
+
) : contentNodes,
|
|
16674
|
+
props.footer ? /* @__PURE__ */ jsx(View, { ...footerStyle, children: props.footer }) : null
|
|
16675
|
+
]
|
|
16676
|
+
}
|
|
16677
|
+
);
|
|
16222
16678
|
}
|
|
16223
16679
|
function DefaultThumb(props) {
|
|
16224
16680
|
const { size, color, borderColor, borderWidth = 0, isDragging, dragScale = 1.1 } = props;
|
|
@@ -16917,7 +17373,7 @@ export {
|
|
|
16917
17373
|
svgToTexture as Z,
|
|
16918
17374
|
useGameObjectEffect as _,
|
|
16919
17375
|
AlertDialog as a,
|
|
16920
|
-
|
|
17376
|
+
nineSlicePatcher as a$,
|
|
16921
17377
|
EFFECT_REGISTRY as a0,
|
|
16922
17378
|
applyEffectByName as a1,
|
|
16923
17379
|
resolveEffect as a2,
|
|
@@ -16934,27 +17390,27 @@ export {
|
|
|
16934
17390
|
nodeRegistry as aD,
|
|
16935
17391
|
register as aE,
|
|
16936
17392
|
host as aF,
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
17393
|
+
createDefaultTheme as aG,
|
|
17394
|
+
defaultTheme as aH,
|
|
17395
|
+
mergeThemes as aI,
|
|
17396
|
+
createTheme as aJ,
|
|
17397
|
+
getThemedProps as aK,
|
|
17398
|
+
remountAll as aL,
|
|
17399
|
+
createElement as aM,
|
|
17400
|
+
mount as aN,
|
|
17401
|
+
unmount as aO,
|
|
17402
|
+
patchVNode as aP,
|
|
17403
|
+
unmountJSX as aQ,
|
|
17404
|
+
Sprite as aR,
|
|
17405
|
+
Graphics as aS,
|
|
17406
|
+
TileSprite as aT,
|
|
17407
|
+
Text as aU,
|
|
17408
|
+
View as aV,
|
|
17409
|
+
textCreator as aW,
|
|
17410
|
+
textPatcher as aX,
|
|
17411
|
+
viewCreator as aY,
|
|
17412
|
+
viewPatcher as aZ,
|
|
17413
|
+
nineSliceCreator as a_,
|
|
16958
17414
|
createJelloEffect as aa,
|
|
16959
17415
|
createNoneEffect as ab,
|
|
16960
17416
|
createPressEffect as ac,
|
|
@@ -16982,42 +17438,46 @@ export {
|
|
|
16982
17438
|
releaseSVGTexture as ay,
|
|
16983
17439
|
releaseSVGTextures as az,
|
|
16984
17440
|
CharTextInput as b,
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17441
|
+
spriteCreator as b0,
|
|
17442
|
+
spritePatcher as b1,
|
|
17443
|
+
imageCreator as b2,
|
|
17444
|
+
imagePatcher as b3,
|
|
17445
|
+
graphicsCreator as b4,
|
|
17446
|
+
graphicsPatcher as b5,
|
|
17447
|
+
tileSpriteCreator as b6,
|
|
17448
|
+
tileSpritePatcher as b7,
|
|
17449
|
+
portalRegistry as b8,
|
|
17450
|
+
animatedSignal as b9,
|
|
17451
|
+
oceanBluePreset as bA,
|
|
17452
|
+
presets as bB,
|
|
17453
|
+
defaultTextStyleTokens as bC,
|
|
17454
|
+
vdom as bD,
|
|
17455
|
+
isAnimatedSignal as ba,
|
|
17456
|
+
unwrapSignal as bb,
|
|
17457
|
+
DEFAULT_SPRING_CONFIG as bc,
|
|
17458
|
+
SPRING_PRESETS as bd,
|
|
17459
|
+
SpringPhysics as be,
|
|
17460
|
+
useSpring as bf,
|
|
17461
|
+
useSprings as bg,
|
|
17462
|
+
HexColor as bh,
|
|
17463
|
+
hexToNumber as bi,
|
|
17464
|
+
numberToHex as bj,
|
|
17465
|
+
numberToRgb as bk,
|
|
17466
|
+
rgbToNumber as bl,
|
|
17467
|
+
darken as bm,
|
|
17468
|
+
darkenHex as bn,
|
|
17469
|
+
hex as bo,
|
|
17470
|
+
lighten as bp,
|
|
17471
|
+
lightenHex as bq,
|
|
17472
|
+
createTextStyle as br,
|
|
17473
|
+
ensureContrast as bs,
|
|
17474
|
+
getContrastRatio as bt,
|
|
17475
|
+
applyDarkMode as bu,
|
|
17476
|
+
applyLightMode as bv,
|
|
17477
|
+
forestGreenPreset as bw,
|
|
17478
|
+
generateColorScale as bx,
|
|
17479
|
+
getPreset as by,
|
|
17480
|
+
midnightPreset as bz,
|
|
17021
17481
|
Divider as c,
|
|
17022
17482
|
Dropdown as d,
|
|
17023
17483
|
createIconComponent as e,
|
|
@@ -17043,4 +17503,4 @@ export {
|
|
|
17043
17503
|
defaultSizeTokens as y,
|
|
17044
17504
|
defaultSpacingTokens as z
|
|
17045
17505
|
};
|
|
17046
|
-
//# sourceMappingURL=TransformOriginView-
|
|
17506
|
+
//# sourceMappingURL=TransformOriginView-CzVjS16F.js.map
|