geostyler 10.3.0 → 10.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.
Files changed (65) hide show
  1. package/browser/geostyler.css +1 -1
  2. package/browser/geostyler.js +1 -1
  3. package/dist/Component/{Removable/RemovableItem → RemovableItem}/RemovableItem.css +0 -0
  4. package/dist/Component/{Removable/RemovableItem → RemovableItem}/RemovableItem.d.ts +1 -1
  5. package/dist/Component/{Removable/RemovableItem → RemovableItem}/RemovableItem.js +2 -7
  6. package/dist/Component/RemovableItem/RemovableItem.js.map +1 -0
  7. package/dist/Component/RuleCard/RuleCard.d.ts +2 -2
  8. package/dist/Component/RuleCard/RuleCard.js +4 -3
  9. package/dist/Component/RuleCard/RuleCard.js.map +1 -1
  10. package/dist/Component/Rules/Rules.js +31 -41
  11. package/dist/Component/Rules/Rules.js.map +1 -1
  12. package/dist/Component/{Removable/Removable.css → SortableItem/SortableItem.css} +0 -0
  13. package/dist/Component/SortableItem/SortableItem.d.ts +7 -0
  14. package/dist/Component/{Removable/Removable.js → SortableItem/SortableItem.js} +30 -23
  15. package/dist/Component/SortableItem/SortableItem.js.map +1 -0
  16. package/dist/Component/SymbolizerCard/SymbolizerCard.d.ts +1 -1
  17. package/dist/Component/SymbolizerCard/SymbolizerCard.js +4 -3
  18. package/dist/Component/SymbolizerCard/SymbolizerCard.js.map +1 -1
  19. package/dist/Component/Symbolizers/Symbolizers.css +1 -9
  20. package/dist/Component/Symbolizers/Symbolizers.js +45 -41
  21. package/dist/Component/Symbolizers/Symbolizers.js.map +1 -1
  22. package/dist/hook/UseDragDropSensors.d.ts +6 -0
  23. package/dist/{Component/DropIndicator/DropIndicator.js → hook/UseDragDropSensors.js} +21 -11
  24. package/dist/hook/UseDragDropSensors.js.map +1 -0
  25. package/dist/index.d.ts +3 -5
  26. package/dist/index.js +6 -10
  27. package/dist/index.js.map +1 -1
  28. package/package.json +4 -1
  29. package/dist/Component/CompositionContext/CompositionContext.d.ts +0 -85
  30. package/dist/Component/CompositionContext/CompositionContext.js +0 -52
  31. package/dist/Component/CompositionContext/CompositionContext.js.map +0 -1
  32. package/dist/Component/DefaultValueContext/DefaultValueContext.d.ts +0 -60
  33. package/dist/Component/DefaultValueContext/DefaultValueContext.js +0 -52
  34. package/dist/Component/DefaultValueContext/DefaultValueContext.js.map +0 -1
  35. package/dist/Component/DragDroppable/DragDroppable.css +0 -36
  36. package/dist/Component/DragDroppable/DragDroppable.d.ts +0 -13
  37. package/dist/Component/DragDroppable/DragDroppable.js +0 -68
  38. package/dist/Component/DragDroppable/DragDroppable.js.map +0 -1
  39. package/dist/Component/DropIndicator/DropIndicator.css +0 -30
  40. package/dist/Component/DropIndicator/DropIndicator.d.ts +0 -6
  41. package/dist/Component/DropIndicator/DropIndicator.js.map +0 -1
  42. package/dist/Component/Legacy/CodeEditor/CodeEditor.css +0 -59
  43. package/dist/Component/Legacy/CodeEditor/CodeEditor.d.ts +0 -131
  44. package/dist/Component/Legacy/CodeEditor/CodeEditor.js +0 -317
  45. package/dist/Component/Legacy/CodeEditor/CodeEditor.js.map +0 -1
  46. package/dist/Component/Removable/Removable.d.ts +0 -10
  47. package/dist/Component/Removable/Removable.js.map +0 -1
  48. package/dist/Component/Removable/RemovableItem/RemovableItem.js.map +0 -1
  49. package/dist/Component/Rule/TitleField/TitleField.css +0 -30
  50. package/dist/Component/Rule/TitleField/TitleField.d.ts +0 -25
  51. package/dist/Component/Rule/TitleField/TitleField.js +0 -100
  52. package/dist/Component/Rule/TitleField/TitleField.js.map +0 -1
  53. package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.css +0 -34
  54. package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.d.ts +0 -88
  55. package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.js +0 -136
  56. package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.js.map +0 -1
  57. package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.d.ts +0 -13
  58. package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.js +0 -73
  59. package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.js.map +0 -1
  60. package/dist/Util/DndUtil.d.ts +0 -114
  61. package/dist/Util/DndUtil.js +0 -159
  62. package/dist/Util/DndUtil.js.map +0 -1
  63. package/dist/hook/UseDragDrop.d.ts +0 -20
  64. package/dist/hook/UseDragDrop.js +0 -238
  65. package/dist/hook/UseDragDrop.js.map +0 -1
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DragDroppable = void 0;
7
- /* Released under the BSD 2-Clause License
8
- *
9
- * Copyright © 2022-present, terrestris GmbH & Co. KG and GeoStyler contributors
10
- * All rights reserved.
11
- *
12
- * Redistribution and use in source and binary forms, with or without
13
- * modification, are permitted provided that the following conditions are met:
14
- *
15
- * * Redistributions of source code must retain the above copyright notice,
16
- * this list of conditions and the following disclaimer.
17
- *
18
- * * Redistributions in binary form must reproduce the above copyright notice,
19
- * this list of conditions and the following disclaimer in the documentation
20
- * and/or other materials provided with the distribution.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
- * POSSIBILITY OF SUCH DAMAGE.
33
- */
34
- var react_1 = __importDefault(require("react"));
35
- var DndUtil_1 = require("../../Util/DndUtil");
36
- var UseDragDrop_1 = require("../../hook/UseDragDrop");
37
- var DropIndicator_1 = __importDefault(require("../DropIndicator/DropIndicator"));
38
- require("./DragDroppable.css");
39
- var DragDroppable = function (_a) {
40
- var position = _a.position, itemType = _a.itemType, _b = _a.onDrop, onDrop = _b === void 0 ? function () { } : _b, _c = _a.dragOrientation, dragOrientation = _c === void 0 ? 'horizontal' : _c, showIndicator = _a.showIndicator, children = _a.children;
41
- var _d = (0, UseDragDrop_1.useDragDrop)({
42
- position: position,
43
- itemType: itemType,
44
- onDrop: onDrop,
45
- dragOrientation: dragOrientation,
46
- showIndicator: showIndicator
47
- })[0], ref = _d.ref, direction = _d.direction, side = _d.side;
48
- var showFrontIndicatorHorizontal = (direction === DndUtil_1.Direction.LEFT && side === DndUtil_1.Side.BEHIND)
49
- || (direction === DndUtil_1.Direction.RIGHT && side === DndUtil_1.Side.BEFORE);
50
- var showBackIndicatorHorizontal = (direction === DndUtil_1.Direction.LEFT && side === DndUtil_1.Side.BEFORE)
51
- || (direction === DndUtil_1.Direction.RIGHT && side === DndUtil_1.Side.BEHIND);
52
- var showFrontIndicatorVertical = (direction === DndUtil_1.Direction.UP && side === DndUtil_1.Side.BEHIND)
53
- || (direction === DndUtil_1.Direction.DOWN && side === DndUtil_1.Side.BEFORE);
54
- var showBackIndicatorVertical = (direction === DndUtil_1.Direction.UP && side === DndUtil_1.Side.BEFORE)
55
- || (direction === DndUtil_1.Direction.DOWN && side === DndUtil_1.Side.BEHIND);
56
- var showFrontIndicator = dragOrientation === 'horizontal' ?
57
- showFrontIndicatorHorizontal : showFrontIndicatorVertical;
58
- var showBackIndicator = dragOrientation === 'horizontal' ?
59
- showBackIndicatorHorizontal : showBackIndicatorVertical;
60
- var orientationClass = dragOrientation === 'horizontal' ? 'horizontal' : 'vertical';
61
- return (react_1.default.createElement("div", { className: "gs-drag-droppable ".concat(orientationClass) },
62
- showFrontIndicator && react_1.default.createElement(DropIndicator_1.default, null),
63
- react_1.default.cloneElement(children, { ref: ref }),
64
- showBackIndicator && react_1.default.createElement(DropIndicator_1.default, null)));
65
- };
66
- exports.DragDroppable = DragDroppable;
67
- exports.default = exports.DragDroppable;
68
- //# sourceMappingURL=DragDroppable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DragDroppable.js","sourceRoot":"","sources":["../../../src/Component/DragDroppable/DragDroppable.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,gDAA4C;AAC5C,8CAAgF;AAChF,sDAAmE;AACnE,iFAA2D;AAE3D,gCAA8B;AAUvB,IAAM,aAAa,GAAiC,UAAC,EAO3D;QANC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,cAAiB,EAAjB,MAAM,mBAAG,cAAO,CAAC,KAAA,EACjB,uBAA8B,EAA9B,eAAe,mBAAG,YAAY,KAAA,EAC9B,aAAa,mBAAA,EACb,QAAQ,cAAA;IAGD,IAAA,KAA4B,IAAA,yBAAW,EAAC;QAC7C,QAAQ,UAAA;QACR,QAAQ,UAAA;QACR,MAAM,QAAA;QACN,eAAe,iBAAA;QACf,aAAa,eAAA;KACd,CAAC,GAN6B,EAAtB,GAAG,SAAA,EAAE,SAAS,eAAA,EAAE,IAAI,UAAE,CAM5B;IAEH,IAAM,4BAA4B,GAAG,CAAC,SAAS,KAAK,mBAAS,CAAC,IAAI,IAAI,IAAI,KAAK,cAAI,CAAC,MAAM,CAAC;WACtF,CAAC,SAAS,KAAK,mB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W,QAAA,aAAa,iBAkDxB;AAEF,kBAAe,qBAAa,CAAC","sourcesContent":["/* Released under the BSD 2-Clause License\n *\n * Copyright © 2022-present, terrestris GmbH & Co. KG and GeoStyler contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\nimport React, { ReactElement } from 'react';\nimport { Direction, DragOrientation, ItemType, Side } from '../../Util/DndUtil';\nimport { OnDropParams, useDragDrop } from '../../hook/UseDragDrop';\nimport DropIndicator from '../DropIndicator/DropIndicator';\n\nimport './DragDroppable.less';\n\nexport interface DragDroppableProps extends React.PropsWithChildren {\n position: number;\n itemType: ItemType;\n onDrop?: (opts: OnDropParams) => void;\n dragOrientation?: DragOrientation;\n showIndicator?: boolean;\n}\n\nexport const DragDroppable: React.FC<DragDroppableProps> = ({\n position,\n itemType,\n onDrop = () => {},\n dragOrientation = 'horizontal',\n showIndicator,\n children\n}) => {\n\n const [{ ref, direction, side }] = useDragDrop({\n position,\n itemType,\n onDrop,\n dragOrientation,\n showIndicator\n });\n\n const showFrontIndicatorHorizontal = (direction === Direction.LEFT && side === Side.BEHIND)\n || (direction === Direction.RIGHT && side === Side.BEFORE);\n\n const showBackIndicatorHorizontal = (direction === Direction.LEFT && side === Side.BEFORE)\n || (direction === Direction.RIGHT && side === Side.BEHIND);\n\n const showFrontIndicatorVertical = (direction === Direction.UP && side === Side.BEHIND)\n || (direction === Direction.DOWN && side === Side.BEFORE);\n\n const showBackIndicatorVertical = (direction === Direction.UP && side === Side.BEFORE)\n || (direction === Direction.DOWN && side === Side.BEHIND);\n\n const showFrontIndicator = dragOrientation === 'horizontal' ?\n showFrontIndicatorHorizontal : showFrontIndicatorVertical;\n\n const showBackIndicator = dragOrientation === 'horizontal' ?\n showBackIndicatorHorizontal : showBackIndicatorVertical;\n\n const orientationClass = dragOrientation === 'horizontal' ? 'horizontal' : 'vertical';\n\n return (\n <div className={`gs-drag-droppable ${orientationClass}`}>\n {\n showFrontIndicator && <DropIndicator />\n }\n {\n React.cloneElement(children as ReactElement, {ref})\n }\n {\n showBackIndicator && <DropIndicator />\n }\n </div>\n );\n};\n\nexport default DragDroppable;\n"]}
@@ -1,30 +0,0 @@
1
- /* Released under the BSD 2-Clause License
2
- *
3
- * Copyright © 2022-present, terrestris GmbH & Co. KG and GeoStyler contributors
4
- * All rights reserved.
5
- *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
8
- *
9
- * * Redistributions of source code must retain the above copyright notice,
10
- * this list of conditions and the following disclaimer.
11
- *
12
- * * Redistributions in binary form must reproduce the above copyright notice,
13
- * this list of conditions and the following disclaimer in the documentation
14
- * and/or other materials provided with the distribution.
15
- *
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
- * POSSIBILITY OF SUCH DAMAGE.
27
- */
28
- .gs-drop-indicator {
29
- border: solid 1px #1890ff;
30
- }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import './DropIndicator.css';
3
- export interface DropIndicatorProps {
4
- }
5
- export declare const DropIndicator: React.FC<DropIndicatorProps>;
6
- export default DropIndicator;
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropIndicator.js","sourceRoot":"","sources":["../../../src/Component/DropIndicator/DropIndicator.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,gDAA0B;AAE1B,gCAA8B;AAIvB,IAAM,aAAa,GAAiC;IAEzD,OAAO,CACL,uCAAK,SAAS,EAAC,mBAAmB,GAAO,CAC1C,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB;AAEF,kBAAe,qBAAa,CAAC","sourcesContent":["/* Released under the BSD 2-Clause License\n *\n * Copyright © 2022-present, terrestris GmbH & Co. KG and GeoStyler contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\nimport React from 'react';\n\nimport './DropIndicator.less';\n\nexport interface DropIndicatorProps {}\n\nexport const DropIndicator: React.FC<DropIndicatorProps> = () => {\n\n return (\n <div className='gs-drop-indicator'></div>\n );\n};\n\nexport default DropIndicator;\n"]}
@@ -1,59 +0,0 @@
1
- /* Released under the BSD 2-Clause License
2
- *
3
- * Copyright © 2018-present, terrestris GmbH & Co. KG and GeoStyler contributors
4
- * All rights reserved.
5
- *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
8
- *
9
- * * Redistributions of source code must retain the above copyright notice,
10
- * this list of conditions and the following disclaimer.
11
- *
12
- * * Redistributions in binary form must reproduce the above copyright notice,
13
- * this list of conditions and the following disclaimer in the documentation
14
- * and/or other materials provided with the distribution.
15
- *
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
- * POSSIBILITY OF SUCH DAMAGE.
27
- */
28
- .gs-code-editor {
29
- height: 100%;
30
- text-align: left;
31
- display: flex;
32
- flex-direction: column;
33
- align-items: flex-end;
34
- }
35
- .gs-code-editor .gs-code-editor-codemirror {
36
- flex: 1;
37
- display: flex;
38
- flex-direction: column;
39
- align-self: stretch;
40
- }
41
- .gs-code-editor .CodeMirror {
42
- flex: 1;
43
- }
44
- .gs-code-editor .gs-code-editor-errormessage {
45
- color: red;
46
- background-color: lightgray;
47
- }
48
- .gs-code-editor .gs-code-editor-toolbar,
49
- .gs-code-editor .gs-code-editor-bottombar {
50
- width: 100%;
51
- padding: 5px 0;
52
- display: flex;
53
- align-items: center;
54
- justify-content: center;
55
- }
56
- .gs-code-editor .gs-code-editor-download-button,
57
- .gs-code-editor .gs-code-editor-copy-button {
58
- margin: 0 5px;
59
- }
@@ -1,131 +0,0 @@
1
- import * as React from 'react';
2
- import 'codemirror/lib/codemirror.css';
3
- import 'codemirror/mode/xml/xml';
4
- import 'codemirror/mode/javascript/javascript';
5
- import 'blob';
6
- import './CodeEditor.css';
7
- import { Style as GsStyle, StyleParser } from 'geostyler-style';
8
- export interface CodeEditorLocale {
9
- downloadButtonLabel: string;
10
- formatSelectLabel: string;
11
- copyButtonLabel: string;
12
- styleCopied: string;
13
- }
14
- interface CodeEditorDefaultProps {
15
- /** Locale object containing translated text snippets */
16
- locale: CodeEditorLocale;
17
- /** Delay in ms until onStyleChange will be called */
18
- delay: number;
19
- /** Show save button */
20
- showSaveButton: boolean;
21
- /** show copy button */
22
- showCopyButton: boolean;
23
- }
24
- export interface CodeEditorProps extends Partial<CodeEditorDefaultProps> {
25
- /** GeoStyler Style Object to display */
26
- style?: GsStyle;
27
- /** List of StylerParsers to parse from/to */
28
- parsers?: StyleParser[];
29
- /** Default parser */
30
- defaultParser?: StyleParser;
31
- /** The callback method that is triggered when the state changes */
32
- onStyleChange?: (rule: GsStyle) => void;
33
- }
34
- interface CodeEditorState {
35
- value: string;
36
- invalidMessage?: string;
37
- activeParser?: StyleParser;
38
- hasError: boolean;
39
- }
40
- /**
41
- * The CodeEditor.
42
- */
43
- export declare class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
44
- static defaultProps: CodeEditorDefaultProps;
45
- static componentName: string;
46
- private editTimeout;
47
- constructor(props: CodeEditorProps);
48
- componentDidMount(): void;
49
- shouldComponentUpdate(nextProps: CodeEditorProps, nextState: CodeEditorState): boolean;
50
- componentDidUpdate(prevProps: CodeEditorProps, prevState: CodeEditorState): void;
51
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
52
- updateValueFromStyle: (style: GsStyle) => void;
53
- getModeByParser: () => string;
54
- valueFromStyleInput: (style: GsStyle) => Promise<unknown>;
55
- styleFromValue: (value: string) => Promise<unknown>;
56
- /**
57
- *
58
- */
59
- onChange: (editor: any, data: any, value: string) => void;
60
- onSelect: (selection: string) => void;
61
- onUnitSelect: (selection: string) => void;
62
- handleOnChange: (editor: any, data: any, value: string) => void;
63
- getParserOptions: () => JSX.Element[];
64
- onDownloadButtonClick: () => void;
65
- onCopyButtonClick: () => void;
66
- /**
67
- * Copies the a value to the clipboard.
68
- * Credits: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
69
- *
70
- * @param {string} str The string to copy to the clipboard.
71
- */
72
- copyToClipboard: (str: string) => void;
73
- render(): JSX.Element;
74
- }
75
- declare const _default: {
76
- new (props: (CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps) | Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>): {
77
- render(): JSX.Element;
78
- context: any;
79
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
80
- forceUpdate(callback?: () => void): void;
81
- readonly props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps> & Readonly<{
82
- children?: React.ReactNode;
83
- }>;
84
- state: Readonly<{}>;
85
- refs: {
86
- [key: string]: React.ReactInstance;
87
- };
88
- componentDidMount?(): void;
89
- shouldComponentUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): boolean;
90
- componentWillUnmount?(): void;
91
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
92
- getSnapshotBeforeUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>): any;
93
- componentDidUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>, snapshot?: any): void;
94
- componentWillMount?(): void;
95
- UNSAFE_componentWillMount?(): void;
96
- componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
97
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
98
- componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
99
- UNSAFE_componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
100
- };
101
- new (props: CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps, context: any): {
102
- render(): JSX.Element;
103
- context: any;
104
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
105
- forceUpdate(callback?: () => void): void;
106
- readonly props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps> & Readonly<{
107
- children?: React.ReactNode;
108
- }>;
109
- state: Readonly<{}>;
110
- refs: {
111
- [key: string]: React.ReactInstance;
112
- };
113
- componentDidMount?(): void;
114
- shouldComponentUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): boolean;
115
- componentWillUnmount?(): void;
116
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
117
- getSnapshotBeforeUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>): any;
118
- componentDidUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>, snapshot?: any): void;
119
- componentWillMount?(): void;
120
- UNSAFE_componentWillMount?(): void;
121
- componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
122
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
123
- componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
124
- UNSAFE_componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
125
- };
126
- contextTypes: {
127
- locale: import("prop-types").Requireable<object>;
128
- };
129
- contextType?: React.Context<any>;
130
- };
131
- export default _default;
@@ -1,317 +0,0 @@
1
- "use strict";
2
- /* Released under the BSD 2-Clause License
3
- *
4
- * Copyright © 2018-present, terrestris GmbH & Co. KG and GeoStyler contributors
5
- * All rights reserved.
6
- *
7
- * Redistribution and use in source and binary forms, with or without
8
- * modification, are permitted provided that the following conditions are met:
9
- *
10
- * * Redistributions of source code must retain the above copyright notice,
11
- * this list of conditions and the following disclaimer.
12
- *
13
- * * Redistributions in binary form must reproduce the above copyright notice,
14
- * this list of conditions and the following disclaimer in the documentation
15
- * and/or other materials provided with the distribution.
16
- *
17
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
- * POSSIBILITY OF SUCH DAMAGE.
28
- */
29
- var __extends = (this && this.__extends) || (function () {
30
- var extendStatics = function (d, b) {
31
- extendStatics = Object.setPrototypeOf ||
32
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
33
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
34
- return extendStatics(d, b);
35
- };
36
- return function (d, b) {
37
- if (typeof b !== "function" && b !== null)
38
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
39
- extendStatics(d, b);
40
- function __() { this.constructor = d; }
41
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42
- };
43
- })();
44
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
45
- if (k2 === undefined) k2 = k;
46
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
47
- }) : (function(o, m, k, k2) {
48
- if (k2 === undefined) k2 = k;
49
- o[k2] = m[k];
50
- }));
51
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
52
- Object.defineProperty(o, "default", { enumerable: true, value: v });
53
- }) : function(o, v) {
54
- o["default"] = v;
55
- });
56
- var __importStar = (this && this.__importStar) || function (mod) {
57
- if (mod && mod.__esModule) return mod;
58
- var result = {};
59
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
60
- __setModuleDefault(result, mod);
61
- return result;
62
- };
63
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
64
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
65
- to[j] = from[i];
66
- return to;
67
- };
68
- var __importDefault = (this && this.__importDefault) || function (mod) {
69
- return (mod && mod.__esModule) ? mod : { "default": mod };
70
- };
71
- Object.defineProperty(exports, "__esModule", { value: true });
72
- exports.CodeEditor = void 0;
73
- var React = __importStar(require("react"));
74
- // Favourite Editor should be Monaco Editor but its React Wrapper is currently
75
- // not very stable
76
- var react_codemirror2_1 = require("react-codemirror2");
77
- require("codemirror/lib/codemirror.css");
78
- require("codemirror/mode/xml/xml");
79
- require("codemirror/mode/javascript/javascript");
80
- require("blob");
81
- var file_saver_1 = require("file-saver");
82
- require("./CodeEditor.css");
83
- var antd_1 = require("antd");
84
- var Option = antd_1.Select.Option;
85
- var isEqual_1 = __importDefault(require("lodash/isEqual"));
86
- var LocaleWrapper_1 = require("../../LocaleWrapper/LocaleWrapper");
87
- var en_US_1 = __importDefault(require("../../../locale/en_US"));
88
- var SLDUnitsSelect_1 = require("../../Symbolizer/SLDUnitsSelect/SLDUnitsSelect");
89
- /**
90
- * The CodeEditor.
91
- */
92
- var CodeEditor = /** @class */ (function (_super) {
93
- __extends(CodeEditor, _super);
94
- function CodeEditor(props) {
95
- var _this = _super.call(this, props) || this;
96
- _this.updateValueFromStyle = function (style) {
97
- _this.valueFromStyleInput(style)
98
- .then(function (parsedStyle) {
99
- _this.setState({
100
- value: parsedStyle
101
- });
102
- });
103
- };
104
- _this.getModeByParser = function () {
105
- var activeParser = _this.state.activeParser;
106
- if (activeParser && activeParser.sldVersion) {
107
- return 'application/xml';
108
- }
109
- return 'application/json';
110
- };
111
- _this.valueFromStyleInput = function (style) {
112
- var activeParser = _this.state.activeParser;
113
- return new Promise(function (resolve, reject) {
114
- if (activeParser) {
115
- resolve(activeParser.writeStyle(style));
116
- }
117
- else {
118
- resolve(JSON.stringify(style, null, 2));
119
- }
120
- });
121
- };
122
- _this.styleFromValue = function (value) {
123
- var activeParser = _this.state.activeParser;
124
- return new Promise(function (resolve, reject) {
125
- if (activeParser) {
126
- resolve(activeParser.readStyle(value));
127
- }
128
- else {
129
- resolve(JSON.parse(value));
130
- }
131
- });
132
- };
133
- /**
134
- *
135
- */
136
- _this.onChange = function (editor, data, value) {
137
- _this.setState({
138
- value: value,
139
- invalidMessage: undefined
140
- });
141
- var onStyleChange = _this.props.onStyleChange;
142
- try {
143
- _this.styleFromValue(value)
144
- .then(function (style) {
145
- if (onStyleChange) {
146
- onStyleChange(style);
147
- }
148
- }).catch(function (err) {
149
- _this.setState({
150
- invalidMessage: err.message
151
- });
152
- });
153
- }
154
- catch (err) {
155
- _this.setState({
156
- invalidMessage: 'Error'
157
- });
158
- }
159
- };
160
- _this.onSelect = function (selection) {
161
- var _a = _this.props, parsers = _a.parsers, style = _a.style;
162
- if (parsers) {
163
- var activeParser = parsers.find(function (parser) { return parser.title === selection; });
164
- _this.setState({ activeParser: activeParser }, function () {
165
- if (style) {
166
- _this.updateValueFromStyle(style);
167
- }
168
- });
169
- }
170
- };
171
- _this.onUnitSelect = function (selection) {
172
- var style = _this.props.style;
173
- var activeParser = _this.state.activeParser;
174
- var parser = activeParser;
175
- parser.symbolizerUnits = selection;
176
- if (style) {
177
- _this.updateValueFromStyle(style);
178
- }
179
- };
180
- _this.handleOnChange = function (editor, data, value) {
181
- var delay = _this.props.delay;
182
- clearTimeout(_this.editTimeout);
183
- _this.editTimeout = setTimeout(function () {
184
- _this.onChange(editor, data, value);
185
- }, delay);
186
- };
187
- _this.getParserOptions = function () {
188
- var parserOptions = [
189
- React.createElement(Option, { key: "GeoStyler Style", value: "GeoStyler Style" }, "Geostyler Style")
190
- ];
191
- if (_this.props.parsers) {
192
- var additionalOptions = _this.props.parsers.map(function (parser) {
193
- var title = parser.title;
194
- return React.createElement(Option, { key: title, value: title }, title);
195
- });
196
- return __spreadArray(__spreadArray([], parserOptions), additionalOptions);
197
- }
198
- return parserOptions;
199
- };
200
- _this.onDownloadButtonClick = function () {
201
- var activeParser = _this.state.activeParser;
202
- var value = _this.state.value;
203
- var style = _this.props.style;
204
- if (style) {
205
- var fileName = style.name;
206
- var type = 'application/json;charset=utf-8';
207
- var title = activeParser && activeParser.title;
208
- if (title === 'SLD Style Parser') {
209
- type = 'text/xml;charset=utf-8';
210
- fileName += '.sld';
211
- }
212
- var blob = new Blob([value], { type: type });
213
- file_saver_1.saveAs(blob, fileName);
214
- }
215
- };
216
- _this.onCopyButtonClick = function () {
217
- var value = _this.state.value;
218
- _this.copyToClipboard(value);
219
- };
220
- /**
221
- * Copies the a value to the clipboard.
222
- * Credits: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
223
- *
224
- * @param {string} str The string to copy to the clipboard.
225
- */
226
- _this.copyToClipboard = function (str) {
227
- var locale = _this.props.locale;
228
- var el = document.createElement('textarea');
229
- el.value = str;
230
- el.setAttribute('readonly', '');
231
- el.style.position = 'absolute';
232
- el.style.left = '-9999px';
233
- document.body.appendChild(el);
234
- var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
235
- el.select();
236
- document.execCommand('copy');
237
- document.body.removeChild(el);
238
- antd_1.message.info(locale.styleCopied);
239
- if (selected) {
240
- document.getSelection().removeAllRanges();
241
- document.getSelection().addRange(selected);
242
- }
243
- };
244
- _this.editTimeout = null;
245
- _this.state = {
246
- value: '',
247
- hasError: false
248
- };
249
- return _this;
250
- }
251
- CodeEditor.prototype.componentDidMount = function () {
252
- var _this = this;
253
- this.setState({
254
- activeParser: this.props.defaultParser
255
- }, function () {
256
- if (_this.props.style) {
257
- _this.updateValueFromStyle(_this.props.style);
258
- }
259
- });
260
- };
261
- CodeEditor.prototype.shouldComponentUpdate = function (nextProps, nextState) {
262
- var diffProps = !isEqual_1.default(this.props, nextProps);
263
- var diffState = !isEqual_1.default(this.state, nextState);
264
- return diffProps || diffState;
265
- };
266
- CodeEditor.prototype.componentDidUpdate = function (prevProps, prevState) {
267
- if (this.props.style && !isEqual_1.default(this.props.style, prevProps.style)) {
268
- this.updateValueFromStyle(this.props.style);
269
- }
270
- };
271
- CodeEditor.prototype.componentDidCatch = function (error, errorInfo) {
272
- this.setState({
273
- hasError: true
274
- });
275
- };
276
- CodeEditor.prototype.render = function () {
277
- var _a = this.props, locale = _a.locale, showSaveButton = _a.showSaveButton, showCopyButton = _a.showCopyButton;
278
- var activeParser = this.state.activeParser;
279
- var _b = this.state, hasError = _b.hasError, value = _b.value;
280
- if (hasError) {
281
- return React.createElement("h1", null, "An error occured in the CodeEditor UI.");
282
- }
283
- return (React.createElement("div", { className: "gs-code-editor" },
284
- React.createElement("div", { className: "gs-code-editor-toolbar" },
285
- locale.formatSelectLabel,
286
- ": ",
287
- React.createElement(antd_1.Select, { className: "gs-code-editor-format-select", style: { width: 300 }, onSelect: this.onSelect, value: activeParser ? activeParser.title : 'GeoStyler Style' }, this.getParserOptions()),
288
- activeParser &&
289
- activeParser.sldVersion &&
290
- activeParser.sldVersion !== '1.0.0' &&
291
- React.createElement(SLDUnitsSelect_1.SLDUnitsSelect, { changeHandler: this.onUnitSelect })),
292
- React.createElement(react_codemirror2_1.UnControlled, { className: "gs-code-editor-codemirror", value: value, autoCursor: false, options: {
293
- gutters: ['CodeMirror-lint-markers'],
294
- lint: true,
295
- mode: this.getModeByParser(),
296
- lineNumbers: true,
297
- lineWrapping: true
298
- }, onChange: this.handleOnChange }),
299
- React.createElement("div", { className: "gs-code-editor-errormessage" }, this.state.invalidMessage),
300
- React.createElement("div", { className: "gs-code-editor-bottombar" },
301
- !showCopyButton ? null :
302
- React.createElement(antd_1.Button, { className: "gs-code-editor-copy-button", type: "primary", onClick: this.onCopyButtonClick }, locale.copyButtonLabel),
303
- !showSaveButton ? null :
304
- React.createElement(antd_1.Button, { className: "gs-code-editor-download-button", type: "primary", onClick: this.onDownloadButtonClick }, locale.downloadButtonLabel))));
305
- };
306
- CodeEditor.defaultProps = {
307
- locale: en_US_1.default.GsCodeEditor,
308
- delay: 500,
309
- showSaveButton: false,
310
- showCopyButton: false
311
- };
312
- CodeEditor.componentName = 'CodeEditor';
313
- return CodeEditor;
314
- }(React.Component));
315
- exports.CodeEditor = CodeEditor;
316
- exports.default = LocaleWrapper_1.localize(CodeEditor, CodeEditor.componentName);
317
- //# sourceMappingURL=CodeEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/Component/Legacy/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA+B;AAC/B,8EAA8E;AAC9E,kBAAkB;AAClB,uDAE2B;AAC3B,yCAAuC;AACvC,mCAAiC;AACjC,iDAA+C;AAE/C,gBAAc;AACd,yCAEoB;AAEpB,6BAA2B;AAE3B,6BAIc;AACd,IAAM,MAAM,GAAG,aAAM,CAAC,MAAM,CAAC;AAO7B,2DAAsC;AAEtC,mEAA6D;AAC7D,gEAA0C;AAE1C,iFAAgF;AAyChF;;GAEG;AACH;IAAgC,8BAAiD;IAa/E,oBAAY,KAAsB;QAAlC,YACE,kBAAM,KAAK,CAAC,SAMb;QA8BD,0BAAoB,GAAG,UAAC,KAAc;YACpC,KAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC;iBAC5B,IAAI,CAAC,UAAC,WAAmB;gBACxB,KAAI,CAAC,QAAQ,CAAC;oBACZ,KAAK,EAAE,WAAW;iBACnB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEF,qBAAe,GAAG;YAChB,IAAM,YAAY,GAAQ,KAAI,CAAC,K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