@widget-js/core 24.1.1-beta.87 → 24.1.1-beta.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -844,7 +844,9 @@ var DefaultThemeDark = {
844
844
  destructiveForeground: "#fff",
845
845
  border: "hsl(0 0% 30%)",
846
846
  input: "hsl(0 0% 25%)",
847
- ring: "hsl(210 100% 60%)"
847
+ ring: "hsl(210 100% 60%)",
848
+ shadow: "0 0% 0%",
849
+ innerShadow: "0 0% 0%"
848
850
  },
849
851
  radius: {
850
852
  sm: "6px",
@@ -857,9 +859,9 @@ var DefaultThemeDark = {
857
859
  fontSize: "14px"
858
860
  },
859
861
  shadow: {
860
- sm: "0 1px 2px rgba(0,0,0,0.2)",
861
- md: "0 4px 6px rgba(0,0,0,0.3)",
862
- lg: "0 10px 20px rgba(0,0,0,0.4)"
862
+ sm: { offsetX: "0", offsetY: "1px", blur: "2px" },
863
+ md: { offsetX: "0", offsetY: "4px", blur: "6px" },
864
+ lg: { offsetX: "0", offsetY: "10px", blur: "20px" }
863
865
  },
864
866
  spacing: "0.5rem"
865
867
  };
@@ -885,12 +887,14 @@ var DefaultThemeLight = {
885
887
  destructiveForeground: "#fff",
886
888
  border: "hsl(0 0% 90%)",
887
889
  input: "hsl(0 0% 85%)",
888
- ring: "hsl(210 100% 56%)"
890
+ ring: "hsl(210 100% 56%)",
891
+ shadow: "0 0% 0%",
892
+ innerShadow: "0 0% 0%"
889
893
  },
890
894
  shadow: {
891
- sm: "0 1px 2px rgba(0,0,0,0.05)",
892
- md: "0 4px 6px rgba(0,0,0,0.1)",
893
- lg: "0 10px 20px rgba(0,0,0,0.15)"
895
+ sm: { offsetX: "0", offsetY: "1px", blur: "2px" },
896
+ md: { offsetX: "0", offsetY: "4px", blur: "6px" },
897
+ lg: { offsetX: "0", offsetY: "10px", blur: "20px" }
894
898
  }
895
899
  };
896
900
  var DefaultTheme = DefaultThemeDark;
@@ -942,9 +946,11 @@ var AppTheme = class _AppTheme {
942
946
  result[`${prefix}-divider-color`] = this.colors.border;
943
947
  result[`${prefix}-background-border-color`] = this.colors.border;
944
948
  }
945
- if (this.colors.ring) {
946
- result[`${prefix}-shadow-color`] = this.colors.ring;
947
- result[`${prefix}-background-box-shadow-color`] = this.colors.ring;
949
+ if (this.colors.shadow) {
950
+ result[`${prefix}-shadow-color`] = this.colors.shadow;
951
+ }
952
+ if (this.colors.innerShadow) {
953
+ result[`${prefix}-background-box-shadow-color`] = this.colors.innerShadow;
948
954
  }
949
955
  }
950
956
  if (this.typography) {
@@ -984,6 +990,10 @@ var AppTheme = class _AppTheme {
984
990
  }
985
991
  const newPath = [...path, key];
986
992
  if (typeof value === "object") {
993
+ if ("offsetX" in value && "offsetY" in value && "blur" in value) {
994
+ const varName = `${prefix}-${newPath.map(import_kebabCase.default).join("-")}`;
995
+ result[varName] = `${value.offsetX} ${value.offsetY} ${value.blur} var(${prefix}-colors-shadow)`;
996
+ }
987
997
  walk(value, newPath);
988
998
  } else {
989
999
  const varName = `${prefix}-${newPath.map(import_kebabCase.default).join("-")}`;
@@ -1054,11 +1064,42 @@ ${body}
1054
1064
  const value = cssNode.value.value?.trim() || "";
1055
1065
  if (firstDashIndex !== -1) {
1056
1066
  const category = propStr.substring(0, firstDashIndex);
1057
- const property = (0, import_camelCase.default)(propStr.substring(firstDashIndex + 1));
1067
+ const restStr = propStr.substring(firstDashIndex + 1);
1058
1068
  if (!themeOptions[category]) {
1059
1069
  themeOptions[category] = {};
1060
1070
  }
1061
- themeOptions[category][property] = value;
1071
+ if (category === "shadow") {
1072
+ const dashIndex = restStr.indexOf("-");
1073
+ if (dashIndex === -1) {
1074
+ const shadowSize = restStr;
1075
+ if (!themeOptions.shadow[shadowSize]) {
1076
+ themeOptions.shadow[shadowSize] = {};
1077
+ }
1078
+ const match = value.match(/^(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/);
1079
+ if (match) {
1080
+ const obj = themeOptions.shadow[shadowSize];
1081
+ if (!obj.offsetX) {
1082
+ obj.offsetX = match[1];
1083
+ }
1084
+ if (!obj.offsetY) {
1085
+ obj.offsetY = match[2];
1086
+ }
1087
+ if (!obj.blur) {
1088
+ obj.blur = match[3];
1089
+ }
1090
+ }
1091
+ } else {
1092
+ const shadowSize = restStr.substring(0, dashIndex);
1093
+ const shadowProp = (0, import_camelCase.default)(restStr.substring(dashIndex + 1));
1094
+ if (!themeOptions.shadow[shadowSize]) {
1095
+ themeOptions.shadow[shadowSize] = {};
1096
+ }
1097
+ themeOptions.shadow[shadowSize][shadowProp] = value;
1098
+ }
1099
+ } else {
1100
+ const propName = (0, import_camelCase.default)(restStr);
1101
+ themeOptions[category][propName] = value;
1102
+ }
1062
1103
  } else {
1063
1104
  const category = (0, import_camelCase.default)(propStr);
1064
1105
  themeOptions[category] = value;
@@ -2933,6 +2974,9 @@ var DeployedWidgetApiImpl = class extends BaseApi {
2933
2974
  return Promise.resolve([]);
2934
2975
  }
2935
2976
  }
2977
+ createDesktopShortcut(widgetName) {
2978
+ return this.invokeMethod("createDesktopShortcut", widgetName);
2979
+ }
2936
2980
  /**
2937
2981
  * 通过组件名移除已添加的组件
2938
2982
  * @param name 组件名
@@ -3106,6 +3150,12 @@ var HttpApiImpl = class extends BaseApi {
3106
3150
  };
3107
3151
  var HttpApi = new HttpApiImpl();
3108
3152
 
3153
+ // src/api/interface/IAiApi.ts
3154
+ var AiApiEvent = /* @__PURE__ */ ((AiApiEvent2) => {
3155
+ AiApiEvent2["CONFIG_UPDATED"] = `channel::cn.widgetjs.core.ai.config.updated`;
3156
+ return AiApiEvent2;
3157
+ })(AiApiEvent || {});
3158
+
3109
3159
  // src/api/interface/IAppApi.ts
3110
3160
  var AppApiEvent = /* @__PURE__ */ ((AppApiEvent2) => {
3111
3161
  AppApiEvent2["CONFIG_CHANGED"] = "event::cn.widgetjs.core.app.config.changed";
@@ -3124,12 +3174,11 @@ var AppApiConstants = /* @__PURE__ */ ((AppApiConstants2) => {
3124
3174
  return AppApiConstants2;
3125
3175
  })(AppApiConstants || {});
3126
3176
 
3127
- // src/api/interface/IWidgetPackageApi.ts
3128
- var WidgetPackageApiEvent = /* @__PURE__ */ ((WidgetPackageApiEvent2) => {
3129
- WidgetPackageApiEvent2["PACKAGE_UPGRADE"] = "event::cn.widgetjs.core.widget.package.upgraded";
3130
- WidgetPackageApiEvent2["PACKAGE_INSTALLED"] = "event::cn.widgetjs.core.widget.package.installed";
3131
- return WidgetPackageApiEvent2;
3132
- })(WidgetPackageApiEvent || {});
3177
+ // src/api/interface/IDeployedWidgetApi.ts
3178
+ var DeployedWidgetApiEvent = /* @__PURE__ */ ((DeployedWidgetApiEvent2) => {
3179
+ DeployedWidgetApiEvent2["SECOND_INSTANCE"] = `channel::cn.widgetjs.core.deployed_widget.second_instance`;
3180
+ return DeployedWidgetApiEvent2;
3181
+ })(DeployedWidgetApiEvent || {});
3133
3182
 
3134
3183
  // src/api/interface/IMouseApi.ts
3135
3184
  var MouseApiEvent = /* @__PURE__ */ ((MouseApiEvent2) => {
@@ -3156,11 +3205,12 @@ var UserApiEvent = /* @__PURE__ */ ((UserApiEvent2) => {
3156
3205
  return UserApiEvent2;
3157
3206
  })(UserApiEvent || {});
3158
3207
 
3159
- // src/api/interface/IAiApi.ts
3160
- var AiApiEvent = /* @__PURE__ */ ((AiApiEvent2) => {
3161
- AiApiEvent2["CONFIG_UPDATED"] = `channel::cn.widgetjs.core.ai.config.updated`;
3162
- return AiApiEvent2;
3163
- })(AiApiEvent || {});
3208
+ // src/api/interface/IWidgetPackageApi.ts
3209
+ var WidgetPackageApiEvent = /* @__PURE__ */ ((WidgetPackageApiEvent2) => {
3210
+ WidgetPackageApiEvent2["PACKAGE_UPGRADE"] = "event::cn.widgetjs.core.widget.package.upgraded";
3211
+ WidgetPackageApiEvent2["PACKAGE_INSTALLED"] = "event::cn.widgetjs.core.widget.package.installed";
3212
+ return WidgetPackageApiEvent2;
3213
+ })(WidgetPackageApiEvent || {});
3164
3214
 
3165
3215
  // src/api/LogApi.ts
3166
3216
  var LogApiImpl = class extends BaseApi {
@@ -3804,6 +3854,7 @@ exports.DeployMode = DeployMode;
3804
3854
  exports.DeployedPage = DeployedPage;
3805
3855
  exports.DeployedWidget = DeployedWidget;
3806
3856
  exports.DeployedWidgetApi = DeployedWidgetApi;
3857
+ exports.DeployedWidgetApiEvent = DeployedWidgetApiEvent;
3807
3858
  exports.DeviceApi = DeviceApi;
3808
3859
  exports.DialogApi = DialogApi;
3809
3860
  exports.ElectronApi = ElectronApi;