@opensumi/ide-debug 2.24.6-rc-1685671765.0 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/components/floating-click-widget/index.d.ts.map +1 -1
- package/lib/browser/components/floating-click-widget/index.js +3 -2
- package/lib/browser/components/floating-click-widget/index.js.map +1 -1
- package/lib/browser/components/floating-click-widget/index.module.less +4 -0
- package/lib/browser/debug-configuration-manager.d.ts +6 -0
- package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.js +64 -17
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-contribution.d.ts.map +1 -1
- package/lib/browser/debug-contribution.js +11 -3
- package/lib/browser/debug-contribution.js.map +1 -1
- package/lib/browser/{debug-schema-updater.d.ts → debug-schema-manager.d.ts} +2 -2
- package/lib/browser/debug-schema-manager.d.ts.map +1 -0
- package/lib/browser/{debug-schema-updater.js → debug-schema-manager.js} +10 -10
- package/lib/browser/debug-schema-manager.js.map +1 -0
- package/lib/browser/debugUtils.d.ts +1 -0
- package/lib/browser/debugUtils.d.ts.map +1 -1
- package/lib/browser/debugUtils.js +22 -1
- package/lib/browser/debugUtils.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint-zone-widget.d.ts +2 -0
- package/lib/browser/editor/debug-breakpoint-zone-widget.d.ts.map +1 -1
- package/lib/browser/editor/debug-breakpoint-zone-widget.js +14 -0
- package/lib/browser/editor/debug-breakpoint-zone-widget.js.map +1 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +5 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/preferences/components/checkbox-widget.d.ts +4 -0
- package/lib/browser/preferences/components/checkbox-widget.d.ts.map +1 -0
- package/lib/browser/preferences/components/checkbox-widget.js +27 -0
- package/lib/browser/preferences/components/checkbox-widget.js.map +1 -0
- package/lib/browser/preferences/components/fields/any-of-field.d.ts +4 -0
- package/lib/browser/preferences/components/fields/any-of-field.d.ts.map +1 -0
- package/lib/browser/preferences/components/fields/any-of-field.js +28 -0
- package/lib/browser/preferences/components/fields/any-of-field.js.map +1 -0
- package/lib/browser/preferences/components/fields/array-field.d.ts +5 -0
- package/lib/browser/preferences/components/fields/array-field.d.ts.map +1 -0
- package/lib/browser/preferences/components/fields/array-field.js +19 -0
- package/lib/browser/preferences/components/fields/array-field.js.map +1 -0
- package/lib/browser/preferences/components/fields/object-filed.d.ts +5 -0
- package/lib/browser/preferences/components/fields/object-filed.d.ts.map +1 -0
- package/lib/browser/preferences/components/fields/object-filed.js +26 -0
- package/lib/browser/preferences/components/fields/object-filed.js.map +1 -0
- package/lib/browser/preferences/components/fields/title-field.d.ts +4 -0
- package/lib/browser/preferences/components/fields/title-field.d.ts.map +1 -0
- package/lib/browser/preferences/components/fields/title-field.js +12 -0
- package/lib/browser/preferences/components/fields/title-field.js.map +1 -0
- package/lib/browser/preferences/components/json-widget.module.less +36 -0
- package/lib/browser/preferences/components/select-widget.d.ts +4 -0
- package/lib/browser/preferences/components/select-widget.d.ts.map +1 -0
- package/lib/browser/preferences/components/select-widget.js +28 -0
- package/lib/browser/preferences/components/select-widget.js.map +1 -0
- package/lib/browser/preferences/components/text-widget.d.ts +4 -0
- package/lib/browser/preferences/components/text-widget.d.ts.map +1 -0
- package/lib/browser/preferences/components/text-widget.js +41 -0
- package/lib/browser/preferences/components/text-widget.js.map +1 -0
- package/lib/browser/preferences/launch-preferences-contribution.d.ts +14 -2
- package/lib/browser/preferences/launch-preferences-contribution.d.ts.map +1 -1
- package/lib/browser/preferences/launch-preferences-contribution.js +61 -2
- package/lib/browser/preferences/launch-preferences-contribution.js.map +1 -1
- package/lib/browser/preferences/launch.module.less +102 -0
- package/lib/browser/preferences/launch.service.d.ts +31 -0
- package/lib/browser/preferences/launch.service.d.ts.map +1 -0
- package/lib/browser/preferences/launch.service.js +109 -0
- package/lib/browser/preferences/launch.service.js.map +1 -0
- package/lib/browser/preferences/launch.view.d.ts +3 -0
- package/lib/browser/preferences/launch.view.d.ts.map +1 -0
- package/lib/browser/preferences/launch.view.js +287 -0
- package/lib/browser/preferences/launch.view.js.map +1 -0
- package/lib/browser/preferences/model/configuration-items.d.ts +12 -0
- package/lib/browser/preferences/model/configuration-items.d.ts.map +1 -0
- package/lib/browser/preferences/model/configuration-items.js +22 -0
- package/lib/browser/preferences/model/configuration-items.js.map +1 -0
- package/lib/browser/preferences/templates/additional-template.d.ts +4 -0
- package/lib/browser/preferences/templates/additional-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/additional-template.js +30 -0
- package/lib/browser/preferences/templates/additional-template.js.map +1 -0
- package/lib/browser/preferences/templates/array-field-item-template.d.ts +4 -0
- package/lib/browser/preferences/templates/array-field-item-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/array-field-item-template.js +31 -0
- package/lib/browser/preferences/templates/array-field-item-template.js.map +1 -0
- package/lib/browser/preferences/templates/array-field-template.d.ts +4 -0
- package/lib/browser/preferences/templates/array-field-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/array-field-template.js +31 -0
- package/lib/browser/preferences/templates/array-field-template.js.map +1 -0
- package/lib/browser/preferences/templates/base-input-template.d.ts +4 -0
- package/lib/browser/preferences/templates/base-input-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/base-input-template.js +29 -0
- package/lib/browser/preferences/templates/base-input-template.js.map +1 -0
- package/lib/browser/preferences/templates/button-template.d.ts +12 -0
- package/lib/browser/preferences/templates/button-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/button-template.js +71 -0
- package/lib/browser/preferences/templates/button-template.js.map +1 -0
- package/lib/browser/preferences/templates/description-field-template.d.ts +4 -0
- package/lib/browser/preferences/templates/description-field-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/description-field-template.js +16 -0
- package/lib/browser/preferences/templates/description-field-template.js.map +1 -0
- package/lib/browser/preferences/templates/field-template.d.ts +4 -0
- package/lib/browser/preferences/templates/field-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/field-template.js +19 -0
- package/lib/browser/preferences/templates/field-template.js.map +1 -0
- package/lib/browser/preferences/templates/json-templates.module.less +133 -0
- package/lib/browser/preferences/templates/object-field-template.d.ts +4 -0
- package/lib/browser/preferences/templates/object-field-template.d.ts.map +1 -0
- package/lib/browser/preferences/templates/object-field-template.js +74 -0
- package/lib/browser/preferences/templates/object-field-template.js.map +1 -0
- package/lib/browser/view/breakpoints/debug-breakpoints.module.less +19 -17
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js +15 -7
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.service.d.ts +1 -0
- package/lib/browser/view/configuration/debug-configuration.service.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.service.js +3 -0
- package/lib/browser/view/configuration/debug-configuration.service.js.map +1 -1
- package/lib/common/constants.d.ts +2 -0
- package/lib/common/constants.d.ts.map +1 -1
- package/lib/common/constants.js +4 -2
- package/lib/common/constants.js.map +1 -1
- package/lib/common/debug-schema.d.ts +5 -0
- package/lib/common/debug-schema.d.ts.map +1 -0
- package/lib/common/debug-schema.js +7 -0
- package/lib/common/debug-schema.js.map +1 -0
- package/lib/common/debug-service.d.ts +10 -0
- package/lib/common/debug-service.d.ts.map +1 -1
- package/lib/common/debug-service.js +8 -1
- package/lib/common/debug-service.js.map +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -1
- package/lib/common/index.js.map +1 -1
- package/package.json +26 -23
- package/src/browser/components/floating-click-widget/index.module.less +4 -0
- package/src/browser/components/floating-click-widget/index.tsx +4 -1
- package/src/browser/debug-configuration-manager.ts +82 -18
- package/src/browser/debug-contribution.ts +12 -4
- package/src/browser/{debug-schema-updater.ts → debug-schema-manager.ts} +5 -4
- package/src/browser/debugUtils.ts +23 -0
- package/src/browser/editor/debug-breakpoint-zone-widget.tsx +16 -1
- package/src/browser/index.ts +6 -0
- package/src/browser/preferences/components/checkbox-widget.tsx +78 -0
- package/src/browser/preferences/components/fields/any-of-field.tsx +90 -0
- package/src/browser/preferences/components/fields/array-field.tsx +25 -0
- package/src/browser/preferences/components/fields/object-filed.tsx +33 -0
- package/src/browser/preferences/components/fields/title-field.tsx +16 -0
- package/src/browser/preferences/components/json-widget.module.less +36 -0
- package/src/browser/preferences/components/select-widget.tsx +68 -0
- package/src/browser/preferences/components/text-widget.tsx +114 -0
- package/src/browser/preferences/launch-preferences-contribution.ts +84 -3
- package/src/browser/preferences/launch.module.less +102 -0
- package/src/browser/preferences/launch.service.ts +133 -0
- package/src/browser/preferences/launch.view.tsx +494 -0
- package/src/browser/preferences/model/configuration-items.ts +24 -0
- package/src/browser/preferences/templates/additional-template.tsx +77 -0
- package/src/browser/preferences/templates/array-field-item-template.tsx +90 -0
- package/src/browser/preferences/templates/array-field-template.tsx +92 -0
- package/src/browser/preferences/templates/base-input-template.tsx +79 -0
- package/src/browser/preferences/templates/button-template.tsx +107 -0
- package/src/browser/preferences/templates/description-field-template.tsx +29 -0
- package/src/browser/preferences/templates/field-template.tsx +71 -0
- package/src/browser/preferences/templates/json-templates.module.less +133 -0
- package/src/browser/preferences/templates/object-field-template.tsx +156 -0
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +19 -17
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +22 -10
- package/src/browser/view/configuration/debug-configuration.service.ts +4 -0
- package/src/common/constants.ts +3 -0
- package/src/common/debug-schema.ts +5 -0
- package/src/common/debug-service.ts +13 -0
- package/src/common/index.ts +1 -1
- package/lib/browser/debug-schema-updater.d.ts.map +0 -1
- package/lib/browser/debug-schema-updater.js.map +0 -1
- package/lib/common/debug-schema-updater.d.ts +0 -3
- package/lib/common/debug-schema-updater.d.ts.map +0 -1
- package/lib/common/debug-schema-updater.js +0 -5
- package/lib/common/debug-schema-updater.js.map +0 -1
- package/src/common/debug-schema-updater.ts +0 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WrapIfAdditionalTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@rjsf/utils");
|
|
6
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
8
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
9
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
10
|
+
const WrapIfAdditionalTemplate = (props) => {
|
|
11
|
+
const { children, classNames, style, disabled, id, label, onKeyChange, onDropPropertyClick, readonly, registry, schema, } = props;
|
|
12
|
+
const { readonlyAsDisabled = true } = registry.formContext;
|
|
13
|
+
const { templates } = registry;
|
|
14
|
+
const { RemoveButton } = templates.ButtonTemplates;
|
|
15
|
+
// 如果是用户手动添加 property 则存在该标识
|
|
16
|
+
const isPropertyFlag = utils_1.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
17
|
+
if (!isPropertyFlag) {
|
|
18
|
+
return (react_1.default.createElement("div", { className: classNames, style: style }, children));
|
|
19
|
+
}
|
|
20
|
+
const handleBlur = (0, react_1.useCallback)(({ target }) => onKeyChange(target.value), [onKeyChange]);
|
|
21
|
+
return (react_1.default.createElement("div", { className: classNames, style: style },
|
|
22
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.additional_field_template },
|
|
23
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.form_additional_container },
|
|
24
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.form_additional },
|
|
25
|
+
react_1.default.createElement(ide_components_1.Input, { className: json_templates_module_less_1.default.form_control, defaultValue: label, value: label, placeholder: (0, ide_core_common_1.formatLocalize)('debug.launch.view.template.input.placeholder', 'Key'), disabled: disabled || (readonlyAsDisabled && readonly), id: `${id}-key`, name: `${id}-key`, onBlur: !readonly ? handleBlur : undefined, type: 'text' })),
|
|
26
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.form_additional_children }, children),
|
|
27
|
+
react_1.default.createElement(RemoveButton, { disabled: disabled || readonly, onClick: onDropPropertyClick(label), registry: registry })))));
|
|
28
|
+
};
|
|
29
|
+
exports.WrapIfAdditionalTemplate = WrapIfAdditionalTemplate;
|
|
30
|
+
//# sourceMappingURL=additional-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additional-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/additional-template.tsx"],"names":[],"mappings":";;;;AAAA,uCAMqB;AACrB,uDAAuD;AAEvD,6DAAiD;AACjD,+DAA2D;AAE3D,sGAAkD;AAE3C,MAAM,wBAAwB,GAAG,CAKtC,KAA6C,EAC7C,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,UAAU,EACV,KAAK,EACL,QAAQ,EACR,EAAE,EACF,KAAK,EACL,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,MAAM,GACP,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC;IAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC;IAC/B,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC,eAAe,CAAC;IACnD,4BAA4B;IAC5B,MAAM,cAAc,GAAG,gCAAwB,IAAI,MAAM,CAAC;IAE1D,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,CACL,uCAAK,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,IACrC,QAAQ,CACL,CACP,CAAC;KACH;IAED,MAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EACvE,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;QACtC,uCAAK,SAAS,EAAE,oCAAM,CAAC,yBAAyB;YAC9C,uCAAK,SAAS,EAAE,oCAAM,CAAC,yBAAyB;gBAC9C,uCAAK,SAAS,EAAE,oCAAM,CAAC,eAAe;oBACpC,8BAAC,sBAAK,IACJ,SAAS,EAAE,oCAAM,CAAC,YAAY,EAC9B,YAAY,EAAE,KAAK,EACnB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,IAAA,gCAAc,EAAC,8CAA8C,EAAE,KAAK,CAAC,EAClF,QAAQ,EAAE,QAAQ,IAAI,CAAC,kBAAkB,IAAI,QAAQ,CAAC,EACtD,EAAE,EAAE,GAAG,EAAE,MAAM,EACf,IAAI,EAAE,GAAG,EAAE,MAAM,EACjB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,IAAI,EAAC,MAAM,GACX,CACE;gBACN,uCAAK,SAAS,EAAE,oCAAM,CAAC,wBAAwB,IAAG,QAAQ,CAAO;gBACjE,8BAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACrG,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA9DW,QAAA,wBAAwB,4BA8DnC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ArrayFieldTemplateItemType, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const ArrayFieldItemTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends import("@rjsf/utils").GenericObjectType = any>(props: ArrayFieldTemplateItemType<T, S, F>) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=array-field-item-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field-item-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/array-field-item-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,0BAA0B,EAG1B,UAAU,EAEX,MAAM,aAAa,CAAC;AAcrB,eAAO,MAAM,sBAAsB,yLAqElC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayFieldItemTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
6
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
8
|
+
const BTN_GRP_STYLE = {
|
|
9
|
+
width: '100%',
|
|
10
|
+
};
|
|
11
|
+
const BTN_STYLE = {
|
|
12
|
+
width: 'calc(100% / 4)',
|
|
13
|
+
};
|
|
14
|
+
const ArrayFieldItemTemplate = (props) => {
|
|
15
|
+
const { className, children, disabled, hasCopy, hasMoveDown, hasMoveUp, hasRemove, hasToolbar, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, registry, } = props;
|
|
16
|
+
const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates;
|
|
17
|
+
const onCopyClick = (0, react_1.useMemo)(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
|
|
18
|
+
const onRemoveClick = (0, react_1.useMemo)(() => onDropIndexClick(index), [index, onDropIndexClick]);
|
|
19
|
+
const onArrowUpClick = (0, react_1.useMemo)(() => onReorderClick(index, index - 1), [index, onReorderClick]);
|
|
20
|
+
const onArrowDownClick = (0, react_1.useMemo)(() => onReorderClick(index, index + 1), [index, onReorderClick]);
|
|
21
|
+
return (react_1.default.createElement("div", { key: `array-item-${index}`, className: (0, classnames_1.default)(className, json_templates_module_less_1.default.array_field_item_template) },
|
|
22
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.control_field }, react_1.default.cloneElement(children, { name: '' })),
|
|
23
|
+
hasToolbar && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.toolbar },
|
|
24
|
+
react_1.default.createElement("div", { style: BTN_GRP_STYLE },
|
|
25
|
+
(hasMoveUp || hasMoveDown) && (react_1.default.createElement(MoveUpButton, { disabled: disabled || readonly || !hasMoveUp, onClick: onArrowUpClick, style: BTN_STYLE, registry: registry })),
|
|
26
|
+
(hasMoveUp || hasMoveDown) && (react_1.default.createElement(MoveDownButton, { disabled: disabled || readonly || !hasMoveDown, onClick: onArrowDownClick, style: BTN_STYLE, registry: registry })),
|
|
27
|
+
hasCopy && (react_1.default.createElement(CopyButton, { disabled: disabled || readonly, onClick: onCopyClick, style: BTN_STYLE, registry: registry })),
|
|
28
|
+
hasRemove && (react_1.default.createElement(RemoveButton, { disabled: disabled || readonly, onClick: onRemoveClick, style: BTN_STYLE, registry: registry })))))));
|
|
29
|
+
};
|
|
30
|
+
exports.ArrayFieldItemTemplate = ArrayFieldItemTemplate;
|
|
31
|
+
//# sourceMappingURL=array-field-item-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field-item-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/array-field-item-template.tsx"],"names":[],"mappings":";;;;AAOA,oEAA6B;AAC7B,uDAAiD;AAEjD,sGAAkD;AAElD,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEK,MAAM,sBAAsB,GAAG,CAKpC,KAA0C,EAC1C,EAAE;IACF,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,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Q,EAAE,QAAQ,IAAI,QAAQ,IAAI,CAAC,SAAS,EAC5C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,GAClB,CACH;gBACA,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,CAC7B,8BAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,IAAI,QAAQ,IAAI,CAAC,WAAW,EAC9C,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,GAClB,CACH;gBACA,OAAO,IAAI,CACV,8BAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC3G;gBACA,SAAS,IAAI,CACZ,8BAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,GAClB,CACH,CACG,CACF,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,sBAAsB,0BAqEjC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ArrayFieldTemplateProps, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const ArrayFieldTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends import("@rjsf/utils").GenericObjectType = any>(props: ArrayFieldTemplateProps<T, S, F>) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=array-field-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/array-field-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,uBAAuB,EAGvB,UAAU,EAEX,MAAM,aAAa,CAAC;AAMrB,eAAO,MAAM,kBAAkB,sLA6E9B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayFieldTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@rjsf/utils");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
8
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
9
|
+
const ArrayFieldTemplate = (props) => {
|
|
10
|
+
const { canAdd, className, disabled, formContext, idSchema, items, onAddClick, readonly, registry, required, schema, title, uiSchema, } = props;
|
|
11
|
+
const uiOptions = (0, utils_1.getUiOptions)(uiSchema);
|
|
12
|
+
const ArrayFieldDescriptionTemplate = (0, utils_1.getTemplate)('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
13
|
+
const ArrayFieldItemTemplate = (0, utils_1.getTemplate)('ArrayFieldItemTemplate', registry, uiOptions);
|
|
14
|
+
const ArrayFieldTitleTemplate = (0, utils_1.getTemplate)('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
15
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
16
|
+
return (react_1.default.createElement("fieldset", { className: (0, classnames_1.default)(className), id: idSchema.$id },
|
|
17
|
+
react_1.default.createElement("div", { className: json_templates_module_less_1.default.array_field_template },
|
|
18
|
+
(uiOptions.title || title) && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.array_item_label },
|
|
19
|
+
react_1.default.createElement(ArrayFieldTitleTemplate, { idSchema: idSchema, required: required, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, registry: registry }))),
|
|
20
|
+
(uiOptions.description || schema.description) && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.array_item_description },
|
|
21
|
+
react_1.default.createElement(ArrayFieldDescriptionTemplate, { description: uiOptions.description || schema.description, idSchema: idSchema, schema: schema, uiSchema: uiSchema, registry: registry }))),
|
|
22
|
+
items &&
|
|
23
|
+
items.map((_a) => {
|
|
24
|
+
var { key } = _a, itemProps = tslib_1.__rest(_a, ["key"]);
|
|
25
|
+
return (react_1.default.createElement(ArrayFieldItemTemplate, Object.assign({ key: key }, itemProps)));
|
|
26
|
+
}),
|
|
27
|
+
canAdd && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.array_item_add },
|
|
28
|
+
react_1.default.createElement(AddButton, { disabled: disabled || readonly, onClick: onAddClick, registry: registry }))))));
|
|
29
|
+
};
|
|
30
|
+
exports.ArrayFieldTemplate = ArrayFieldTemplate;
|
|
31
|
+
//# sourceMappingURL=array-field-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/array-field-template.tsx"],"names":[],"mappings":";;;;AAAA,uCAQqB;AACrB,oEAA6B;AAC7B,0DAA0B;AAE1B,sGAAkD;AAE3C,MAAM,kBAAkB,GAAG,CAChC,KAAuC,EACvC,EAAE;IACF,MAAM,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,IAAA,mBAAW,EAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EACxC,wBAAwB,EACxB,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,uBAAuB,GAAG,IAAA,mBAAW,EACzC,yBAAyB,EACzB,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,EACJ,eA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,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAClF,CACP,CACG,CACG,CACZ,CAAC;AACJ,CAAC,CAAC;AA7EW,QAAA,kBAAkB,sBA6E7B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseInputTemplateProps, GenericObjectType, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const BaseInputTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends GenericObjectType = any>(props: BaseInputTemplateProps<T, S, F>) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=base-input-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-input-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/base-input-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,sBAAsB,EAItB,iBAAiB,EACjB,UAAU,EAEX,MAAM,aAAa,CAAC;AASrB,eAAO,MAAM,iBAAiB,+JA4D7B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseInputTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@rjsf/utils");
|
|
6
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
8
|
+
const INPUT_STYLE = {
|
|
9
|
+
width: '100%',
|
|
10
|
+
};
|
|
11
|
+
const BaseInputTemplate = (props) => {
|
|
12
|
+
const { disabled, formContext, id, onBlur, onChange, onChangeOverride, onFocus, options, placeholder, readonly, schema, value, type, } = props;
|
|
13
|
+
const inputProps = (0, utils_1.getInputProps)(schema, type, options, false);
|
|
14
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
15
|
+
const handleNumberChange = (nextValue) => onChange(nextValue);
|
|
16
|
+
const handleTextChange = onChangeOverride
|
|
17
|
+
? onChangeOverride
|
|
18
|
+
: ({ target }) => onChange(target.value === '' ? options.emptyValue : target.value);
|
|
19
|
+
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
20
|
+
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
21
|
+
const input = (react_1.default.createElement(ide_components_1.Input, Object.assign({ disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleTextChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: INPUT_STYLE, list: schema.examples ? (0, utils_1.examplesId)(id) : undefined }, inputProps, { value: value, "aria-describedby": (0, utils_1.ariaDescribedByIds)(id, !!schema.examples) })));
|
|
22
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
|
+
input,
|
|
24
|
+
Array.isArray(schema.examples) && (react_1.default.createElement("datalist", { id: (0, utils_1.examplesId)(id) }, schema.examples
|
|
25
|
+
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
26
|
+
.map((example) => react_1.default.createElement("option", { key: example, value: example }))))));
|
|
27
|
+
};
|
|
28
|
+
exports.BaseInputTemplate = BaseInputTemplate;
|
|
29
|
+
//# sourceMappingURL=base-input-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-input-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/base-input-template.tsx"],"names":[],"mappings":";;;;AAAA,uCASqB;AACrB,0DAAuD;AAEvD,6DAAiD;AAEjD,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM;CACd,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAC/B,KAAsC,EACtC,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,EAAE,EACF,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI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,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,kBAAU,EAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IACjD,UAAU,IACd,KAAK,EAAE,KAAK,sBACM,IAAA,0BAAkB,EAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAC9D,CACH,CAAC;IAEF,OAAO,CACL;QACG,KAAK;QACL,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CACjC,4CAAU,EAAE,EAAE,IAAA,kBAAU,EAAI,EAAE,CAAC,IAC3B,MAAM,CAAC,QAAqB;aAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAC;aACzG,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,0CAAQ,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAI,CAAC,CACpD,CACZ,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AA5DW,QAAA,iBAAiB,qBA4D5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconButtonProps, SubmitButtonProps } from '@rjsf/utils';
|
|
3
|
+
import { LabelMenuItemNode } from '@opensumi/ide-core-browser/lib/menu/next/menu.interface';
|
|
4
|
+
export declare const MoveUpButton: (props: IconButtonProps) => JSX.Element;
|
|
5
|
+
export declare const MoveDownButton: (props: IconButtonProps) => JSX.Element;
|
|
6
|
+
export declare const RemoveButton: (props: IconButtonProps) => JSX.Element;
|
|
7
|
+
export declare const AddButton: (props: IconButtonProps) => JSX.Element;
|
|
8
|
+
export declare const CopyButton: (props: IconButtonProps) => JSX.Element;
|
|
9
|
+
export declare const AddItemButton: (props: SubmitButtonProps<any, import("@rjsf/utils").RJSFSchema, any> & {
|
|
10
|
+
onAddClick: (item: LabelMenuItemNode) => void;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
//# sourceMappingURL=button-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/button-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAQ5F,eAAO,MAAM,YAAY,UAAW,eAAe,gBAIlD,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,eAAe,gBAIpD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,eAAe,gBAIlD,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,eAAe,gBAI/C,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,eAAe,gBAIhD,CAAC;AAEF,eAAO,MAAM,aAAa;uBAAoD,iBAAiB,KAAK,IAAI;iBA4DvG,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddItemButton = exports.CopyButton = exports.AddButton = exports.RemoveButton = exports.MoveDownButton = exports.MoveUpButton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
7
|
+
const iconMap_1 = require("@opensumi/ide-components/lib/icon/iconfont/iconMap");
|
|
8
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
9
|
+
const index_1 = require("@opensumi/ide-core-browser/lib/components/actions/index");
|
|
10
|
+
const menu_interface_1 = require("@opensumi/ide-core-browser/lib/menu/next/menu.interface");
|
|
11
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
12
|
+
const common_1 = require("../../../common");
|
|
13
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
14
|
+
const MoveUpButton = (props) => (react_1.default.createElement(ide_components_1.Button, Object.assign({}, props, { type: 'primary', icon: iconMap_1.defaultIconfont.arrowup }),
|
|
15
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont.arrowup) })));
|
|
16
|
+
exports.MoveUpButton = MoveUpButton;
|
|
17
|
+
const MoveDownButton = (props) => (react_1.default.createElement(ide_components_1.Button, Object.assign({}, props, { type: 'primary', icon: iconMap_1.defaultIconfont.arrowdown }),
|
|
18
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont.arrowdown) })));
|
|
19
|
+
exports.MoveDownButton = MoveDownButton;
|
|
20
|
+
const RemoveButton = (props) => (react_1.default.createElement(ide_components_1.Button, Object.assign({}, props, { type: 'danger', icon: iconMap_1.defaultIconfont.delete }),
|
|
21
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont.delete) })));
|
|
22
|
+
exports.RemoveButton = RemoveButton;
|
|
23
|
+
const AddButton = (props) => (react_1.default.createElement(ide_components_1.Button, Object.assign({}, props, { type: 'primary', icon: iconMap_1.defaultIconfont.plus }),
|
|
24
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont.plus) }),
|
|
25
|
+
" ",
|
|
26
|
+
(0, ide_core_common_1.localize)('debug.launch.view.template.button.addItem')));
|
|
27
|
+
exports.AddButton = AddButton;
|
|
28
|
+
const CopyButton = (props) => (react_1.default.createElement(ide_components_1.Button, Object.assign({}, props, { type: 'primary', icon: iconMap_1.defaultIconfont['file-copy'] }),
|
|
29
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont['file-copy']) })));
|
|
30
|
+
exports.CopyButton = CopyButton;
|
|
31
|
+
const AddItemButton = (props) => {
|
|
32
|
+
const { registry: { rootSchema }, onAddClick, } = props;
|
|
33
|
+
const launchService = (0, ide_core_browser_1.useInjectable)(common_1.ILaunchService);
|
|
34
|
+
const [menuOpen, setMenuOpen] = react_1.default.useState(false);
|
|
35
|
+
const [snippetMenu, setSnippetMenu] = react_1.default.useState([]);
|
|
36
|
+
const { rawSchemaProperties: schemaProperties } = launchService;
|
|
37
|
+
const handleVisibleChange = (0, react_1.useCallback)((visible) => setMenuOpen(visible), []);
|
|
38
|
+
const handleMenuItemClick = (0, react_1.useCallback)((item) => {
|
|
39
|
+
setMenuOpen(false);
|
|
40
|
+
onAddClick(item);
|
|
41
|
+
}, []);
|
|
42
|
+
const handleSnippetMenu = (0, react_1.useCallback)(() => {
|
|
43
|
+
const { properties } = schemaProperties;
|
|
44
|
+
const { properties: existedProperties } = rootSchema;
|
|
45
|
+
if (!properties || !existedProperties) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// schema
|
|
49
|
+
const menuItemNode = Object.keys(properties)
|
|
50
|
+
// 过滤已存在于视图中的 properties
|
|
51
|
+
.filter((key) => !Object.hasOwn(existedProperties, key))
|
|
52
|
+
.map((item) => new menu_interface_1.LabelMenuItemNode(item));
|
|
53
|
+
setSnippetMenu(menuItemNode);
|
|
54
|
+
}, [rootSchema, schemaProperties]);
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
const disposable = new ide_core_common_1.Disposable();
|
|
57
|
+
disposable.addDispose(launchService.onChangeSchema(() => {
|
|
58
|
+
requestAnimationFrame(() => {
|
|
59
|
+
handleSnippetMenu();
|
|
60
|
+
});
|
|
61
|
+
}));
|
|
62
|
+
handleSnippetMenu();
|
|
63
|
+
return () => disposable.dispose();
|
|
64
|
+
}, [schemaProperties, rootSchema]);
|
|
65
|
+
return (react_1.default.createElement(ide_components_1.Button, { type: 'secondary', icon: iconMap_1.defaultIconfont.plus, className: json_templates_module_less_1.default.add_new_field, menu: react_1.default.createElement(index_1.MenuActionList, { afterClick: handleMenuItemClick, data: snippetMenu, style: { maxHeight: 600 } }), moreVisible: menuOpen, onVisibleChange: handleVisibleChange },
|
|
66
|
+
react_1.default.createElement("span", { className: (0, ide_components_1.getIcon)(iconMap_1.defaultIconfont.plus) }),
|
|
67
|
+
" ",
|
|
68
|
+
(0, ide_core_common_1.localize)('debug.launch.view.template.button.submit')));
|
|
69
|
+
};
|
|
70
|
+
exports.AddItemButton = AddItemButton;
|
|
71
|
+
//# sourceMappingURL=button-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/button-template.tsx"],"names":[],"mappings":";;;;AACA,uDAA+D;AAE/D,6DAAwE;AACxE,gFAAqF;AACrF,iEAA2D;AAC3D,mFAAyF;AAEzF,4FAA4F;AAC5F,+DAAiE;AAEjE,4CAAiD;AAGjD,sGAAkD;AAE3C,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CACtD,8BAAC,uBAAM,oBAAK,KAAK,IAAE,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,yBAAe,CAAC,OAAO;IAC7D,wCAAM,SAAS,EAAE,IAAA,wBAAO,EAAC,yBAAe,CAAC,OAAO,CAAC,GAAS,CACnD,CACV,CAAC;AAJW,QAAA,YAAY,gBAIvB;AAEK,MAAM,cAAc,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CACxD,8BAAC,uBAAM,oBAAK,KAAK,IAAE,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,yBAAe,CAAC,SAAS;IAC/D,wCAAM,SAAS,EAAE,IAAA,wBAAO,EAAC,yBAAe,CAAC,SAAS,CAAC,GAAS,CACrD,CACV,CAAC;AAJW,QAAA,cAAc,kBAIzB;AAEK,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CACtD,8BAAC,uBAAM,oBAAK,KAAK,IAAE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AE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,8BAAC,uBAAM,IACL,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,yBAAe,CAAC,IAAI,EAC1B,SAAS,EAAE,oCAAM,CAAC,aAAa,EAC/B,IAAI,EAAE,8BAAC,sBAAc,IAAC,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAI,EACvG,WAAW,EAAE,QAAQ,EACrB,eAAe,EAAE,mBAAmB;QAEpC,wCAAM,SAAS,EAAE,IAAA,wBAAO,EAAC,yBAAe,CAAC,IAAI,CAAC,GAAS;;QAAE,IAAA,0BAAQ,EAAC,0CAA0C,CAAC,CACtG,CACV,CAAC;AACJ,CAAC,CAAC;AA5DW,QAAA,aAAa,iBA4DxB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DescriptionFieldProps, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const DescriptionFieldTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends import("@rjsf/utils").GenericObjectType = any>(props: DescriptionFieldProps<T, S, F>) => JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=description-field-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-field-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/description-field-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAmB,UAAU,EAAoB,MAAM,aAAa,CAAC;AAOnG,eAAO,MAAM,wBAAwB,2LAqBpC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DescriptionFieldTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
7
|
+
const DescriptionFieldTemplate = (props) => {
|
|
8
|
+
const { id, schema } = props;
|
|
9
|
+
const description = (0, react_1.useMemo)(() => { var _a; return (_a = schema.description) !== null && _a !== void 0 ? _a : schema.markdownDescription; }, [schema, schema.description, schema.markdownDescription]);
|
|
10
|
+
if (!description) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (react_1.default.createElement("span", { id: id, className: json_templates_module_less_1.default.description_field_template }, description));
|
|
14
|
+
};
|
|
15
|
+
exports.DescriptionFieldTemplate = DescriptionFieldTemplate;
|
|
16
|
+
//# sourceMappingURL=description-field-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-field-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/description-field-template.tsx"],"names":[],"mappings":";;;;AACA,uDAAuC;AAIvC,sGAAkD;AAE3C,MAAM,wBAAwB,GAAG,CAKtC,KAAqC,EACrC,EAAE;IACF,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,WAAW,GAAG,IAAA,eAAO,EACzB,GAAG,EAAE,WAAC,OAAA,MAAA,MAAM,CAAC,WAAW,mCAAK,MAAsB,CAAC,mBAAmB,CAAA,EAAA,EACvE,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAG,MAAsB,CAAC,mBAAmB,CAAC,CAC1E,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,wCAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,oCAAM,CAAC,0BAA0B,IACvD,WAAW,CACP,CACR,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,wBAAwB,4BAqBnC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldTemplateProps, GenericObjectType, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const FieldTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends GenericObjectType = any>(props: FieldTemplateProps<T, S, F>) => JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=field-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/field-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAElB,iBAAiB,EAGjB,UAAU,EAEX,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,aAAa,kKA0DzB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@rjsf/utils");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
8
|
+
const FieldTemplate = (props) => {
|
|
9
|
+
const { classNames, style, children, id, schema, label, hidden, formContext, uiSchema, registry, disabled, onDropPropertyClick, onKeyChange, required, readonly, } = props;
|
|
10
|
+
const { wrapperStyle } = formContext;
|
|
11
|
+
const uiOptions = (0, utils_1.getUiOptions)(uiSchema);
|
|
12
|
+
const WrapIfAdditionalTemplate = (0, utils_1.getTemplate)('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
13
|
+
if (hidden) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (react_1.default.createElement(WrapIfAdditionalTemplate, { classNames: classNames, style: style, disabled: disabled, id: id, label: label, onDropPropertyClick: onDropPropertyClick, onKeyChange: onKeyChange, readonly: readonly, required: required, schema: schema, uiSchema: uiSchema, registry: registry }, id === 'root' ? (children) : (react_1.default.createElement("div", { className: (0, classnames_1.default)(classNames), style: wrapperStyle }, children))));
|
|
17
|
+
};
|
|
18
|
+
exports.FieldTemplate = FieldTemplate;
|
|
19
|
+
//# sourceMappingURL=field-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/field-template.tsx"],"names":[],"mappings":";;;;AAAA,uCAQqB;AACrB,oEAA6B;AAC7B,0DAA0B;AAEnB,MAAM,aAAa,GAAG,CAC3B,KAAkC,EAClC,EAAE;IACF,MAAM,EACJ,UAAU,EACV,KAAK,EACL,QAAQ,EACR,EAAE,EACF,MAAM,EACN,KAAK,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,YAAY,EAAE,GAAG,WAAgC,CAAC;IAE1D,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,wBAAwB,GAAG,IAAA,mBAAW,EAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC;IAEF,IAAI,MAAM,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,8BAAC,wBAAwB,IACvB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAEjB,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CACf,QAAQ,CACT,CAAC,CAAC,CAAC,CACF,uCAAK,SAAS,EAAE,IAAA,oBAAG,EAAC,UAAU,CAAC,EAAE,KAAK,EAAE,YAAY,IACjD,QAAQ,CACL,CACP,CACwB,CAC5B,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,aAAa,iBA0DxB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
.array_field_item_template {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
margin-bottom: 8px;
|
|
5
|
+
|
|
6
|
+
.control_field {
|
|
7
|
+
margin-right: 8px;
|
|
8
|
+
min-width: 180px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.toolbar {
|
|
12
|
+
button {
|
|
13
|
+
border-radius: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.field_template {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.array_field_template {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
|
|
27
|
+
.array_item_description {
|
|
28
|
+
margin-bottom: 8px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.object_field_template {
|
|
33
|
+
.object_field_container {
|
|
34
|
+
.root_property_wrapper {
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.root_object_field_container {
|
|
39
|
+
margin-bottom: 16px;
|
|
40
|
+
|
|
41
|
+
> .object_title {
|
|
42
|
+
padding-left: 16px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.root_property_wrapper {
|
|
46
|
+
padding: 16px;
|
|
47
|
+
position: relative;
|
|
48
|
+
|
|
49
|
+
.wrapper_delete {
|
|
50
|
+
display: none;
|
|
51
|
+
position: absolute;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
right: 16px;
|
|
54
|
+
top: 16px;
|
|
55
|
+
|
|
56
|
+
.close_icon {
|
|
57
|
+
font-size: 21px;
|
|
58
|
+
color: var(--kt-dangerButton-background);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
background-color: var(--kt-tree-hoverBackground);
|
|
64
|
+
|
|
65
|
+
.wrapper_delete {
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.description_field_template {
|
|
75
|
+
display: inline-block;
|
|
76
|
+
margin-bottom: 10px;
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
opacity: 0.75;
|
|
79
|
+
white-space: pre-wrap;
|
|
80
|
+
color: var(--descriptionForeground);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.add_new_field {
|
|
84
|
+
min-width: 300px;
|
|
85
|
+
max-width: 500px;
|
|
86
|
+
width: 100%;
|
|
87
|
+
border-style: dashed;
|
|
88
|
+
margin-left: 16px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.additional_field_template {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
|
|
95
|
+
.form_additional_container {
|
|
96
|
+
display: flex;
|
|
97
|
+
min-width: 300px;
|
|
98
|
+
max-width: 500px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
margin-bottom: 8px;
|
|
101
|
+
|
|
102
|
+
.form_additional_children {
|
|
103
|
+
label[class*='field_label'] {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.form_additional,
|
|
109
|
+
.form_additional_children {
|
|
110
|
+
margin-right: 16px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.children_field {
|
|
115
|
+
position: relative;
|
|
116
|
+
|
|
117
|
+
.object_title,
|
|
118
|
+
.object_description {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dividing {
|
|
123
|
+
width: 2px;
|
|
124
|
+
background-color: var(--editorGroup-border);
|
|
125
|
+
height: 100%;
|
|
126
|
+
position: absolute;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.children_container {
|
|
130
|
+
margin-left: 16px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ObjectFieldTemplateProps, RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export declare const ObjectFieldTemplate: <T = any, S extends import("json-schema").JSONSchema7 = RJSFSchema, F extends import("@rjsf/utils").GenericObjectType = any>(props: ObjectFieldTemplateProps<T, S, F>) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=object-field-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-field-template.d.ts","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/object-field-template.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,EAExB,UAAU,EASX,MAAM,aAAa,CAAC;AAsCrB,eAAO,MAAM,mBAAmB,uLAyG/B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectFieldTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@rjsf/utils");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
8
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
9
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
10
|
+
const ide_core_browser_2 = require("@opensumi/ide-core-browser");
|
|
11
|
+
const debug_service_1 = require("../../../common/debug-service");
|
|
12
|
+
const json_templates_module_less_1 = tslib_1.__importDefault(require("./json-templates.module.less"));
|
|
13
|
+
/**
|
|
14
|
+
* 情况一: properties 为空则表明该属性的值是任意的 key:value 对象组合,所以需要显示添加按钮
|
|
15
|
+
* 情况二: 如果 properties 当中存在 ADDITIONAL_PROPERTY_FLAG 字段,则允许继续添加
|
|
16
|
+
*/
|
|
17
|
+
const extendCanExpand = (props) => {
|
|
18
|
+
const { schema, uiSchema, formData } = props;
|
|
19
|
+
const { properties } = schema;
|
|
20
|
+
if (!properties) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (Object.keys(properties).length === 0) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (!Object.values(properties).some((item) => item[utils_1.ADDITIONAL_PROPERTY_FLAG])) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return (0, utils_1.canExpand)(schema, uiSchema, formData);
|
|
30
|
+
};
|
|
31
|
+
const ObjectFieldTemplate = (props) => {
|
|
32
|
+
const { schema, uiSchema, required, registry, idSchema, title, disabled, readonly, properties, onAddClick } = props;
|
|
33
|
+
const launchService = (0, ide_core_browser_1.useInjectable)(debug_service_1.ILaunchService);
|
|
34
|
+
const uiOptions = (0, utils_1.getUiOptions)(uiSchema);
|
|
35
|
+
const TitleFieldTemplate = (0, utils_1.getTemplate)('TitleFieldTemplate', registry, uiOptions);
|
|
36
|
+
const DescriptionFieldTemplate = (0, utils_1.getTemplate)('DescriptionFieldTemplate', registry, uiOptions);
|
|
37
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
38
|
+
const description = (0, react_1.useMemo)(() => { var _a; return (_a = props.description) !== null && _a !== void 0 ? _a : schema.markdownDescription; }, [props.description, schema]);
|
|
39
|
+
const fieldContainerClass = (0, react_1.useMemo)(() => idSchema.$id === 'root'
|
|
40
|
+
? (0, classnames_1.default)(json_templates_module_less_1.default.object_field_container, json_templates_module_less_1.default.root_object_field_container)
|
|
41
|
+
: json_templates_module_less_1.default.object_field_container, [idSchema]);
|
|
42
|
+
const propertyWrapperClass = (0, react_1.useMemo)(() => idSchema.$id === 'root' ? (0, classnames_1.default)(json_templates_module_less_1.default.property_wrapper, json_templates_module_less_1.default.root_property_wrapper) : json_templates_module_less_1.default.property_wrapper, [idSchema]);
|
|
43
|
+
const handleDelProperties = (0, react_1.useCallback)((node) => {
|
|
44
|
+
const { name } = node;
|
|
45
|
+
launchService.delItem(name);
|
|
46
|
+
}, []);
|
|
47
|
+
const renderProperties = (0, react_1.useCallback)((node) => {
|
|
48
|
+
const { rawSchemaProperties: schemaProperties } = launchService;
|
|
49
|
+
if (!schemaProperties) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const required = schemaProperties.required || [];
|
|
53
|
+
return (react_1.default.createElement("div", { key: node.name, className: propertyWrapperClass, onKeyDown: (event) => {
|
|
54
|
+
if (event.key === ide_core_browser_2.Key.ENTER.code) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
}
|
|
58
|
+
} },
|
|
59
|
+
node.content,
|
|
60
|
+
required.includes(node.name) || idSchema.$id !== 'root' ? null : (react_1.default.createElement("div", { className: json_templates_module_less_1.default.wrapper_delete, onClick: () => handleDelProperties(node) },
|
|
61
|
+
react_1.default.createElement("span", { className: (0, classnames_1.default)((0, ide_components_1.getIcon)('close-circle'), json_templates_module_less_1.default.close_icon) })))));
|
|
62
|
+
}, [properties, launchService.rawSchemaProperties, idSchema]);
|
|
63
|
+
return (react_1.default.createElement("div", { className: json_templates_module_less_1.default.object_field_template },
|
|
64
|
+
react_1.default.createElement("fieldset", null,
|
|
65
|
+
react_1.default.createElement("div", { className: fieldContainerClass },
|
|
66
|
+
title && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.object_title },
|
|
67
|
+
react_1.default.createElement(TitleFieldTemplate, { id: (0, utils_1.titleId)(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry }))),
|
|
68
|
+
description && (react_1.default.createElement("div", { className: json_templates_module_less_1.default.object_description },
|
|
69
|
+
react_1.default.createElement(DescriptionFieldTemplate, { id: (0, utils_1.descriptionId)(idSchema), description: description, schema: schema, uiSchema: uiSchema, registry: registry }))),
|
|
70
|
+
properties.filter((e) => !e.hidden).map((element) => renderProperties(element))),
|
|
71
|
+
extendCanExpand(props) && (react_1.default.createElement(AddButton, { onClick: onAddClick(schema), disabled: disabled || readonly, registry: registry })))));
|
|
72
|
+
};
|
|
73
|
+
exports.ObjectFieldTemplate = ObjectFieldTemplate;
|
|
74
|
+
//# sourceMappingURL=object-field-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-field-template.js","sourceRoot":"","sources":["../../../../src/browser/preferences/templates/object-field-template.tsx"],"names":[],"mappings":";;;;AAAA,uCAYqB;AACrB,oEAA6B;AAC7B,uDAAoD;AAEpD,6DAAmD;AACnD,iEAAwE;AACxE,iEAAiD;AAEjD,iEAA+D;AAG/D,sGAAkD;AAElD;;;GAGG;AACH,MAAM,eAAe,GAAG,CACtB,KAAwC,EACxC,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAwB,CAAC,CAAC,EAAE;QAC7E,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAA,iBAAS,EAAC,M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