@spectrum-web-components/menu 1.1.0-beta.53 → 1.1.0-beta.55
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/menu",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.55",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -90,15 +90,15 @@
|
|
|
90
90
|
],
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@lit-labs/observers": "^2.0.2",
|
|
93
|
-
"@spectrum-web-components/action-button": "^1.1.0-beta.
|
|
94
|
-
"@spectrum-web-components/base": "^1.1.0-beta.
|
|
95
|
-
"@spectrum-web-components/divider": "^1.1.0-beta.
|
|
96
|
-
"@spectrum-web-components/icon": "^1.1.0-beta.
|
|
97
|
-
"@spectrum-web-components/icons-ui": "^1.1.0-beta.
|
|
98
|
-
"@spectrum-web-components/overlay": "^1.1.0-beta.
|
|
99
|
-
"@spectrum-web-components/popover": "^1.1.0-beta.
|
|
100
|
-
"@spectrum-web-components/reactive-controllers": "^1.1.0-beta.
|
|
101
|
-
"@spectrum-web-components/shared": "^1.1.0-beta.
|
|
93
|
+
"@spectrum-web-components/action-button": "^1.1.0-beta.55",
|
|
94
|
+
"@spectrum-web-components/base": "^1.1.0-beta.55",
|
|
95
|
+
"@spectrum-web-components/divider": "^1.1.0-beta.55",
|
|
96
|
+
"@spectrum-web-components/icon": "^1.1.0-beta.55",
|
|
97
|
+
"@spectrum-web-components/icons-ui": "^1.1.0-beta.55",
|
|
98
|
+
"@spectrum-web-components/overlay": "^1.1.0-beta.55",
|
|
99
|
+
"@spectrum-web-components/popover": "^1.1.0-beta.55",
|
|
100
|
+
"@spectrum-web-components/reactive-controllers": "^1.1.0-beta.55",
|
|
101
|
+
"@spectrum-web-components/shared": "^1.1.0-beta.55"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@spectrum-css/menu": "^8.0.0-s2-foundations.16"
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"./sp-*.js",
|
|
110
110
|
"./**/*.dev.js"
|
|
111
111
|
],
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "6527b5ddba17f0b56cf4947de00126dbafad4c62"
|
|
113
113
|
}
|
|
@@ -133,13 +133,11 @@ class MyPicker extends XElement {
|
|
|
133
133
|
// Using .value for the key will workaround the issue
|
|
134
134
|
(blendModeOption) => blendModeOption,
|
|
135
135
|
(blendModeOption) => html`
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</sp-menu-item>
|
|
142
|
-
`
|
|
136
|
+
<sp-menu-item value=${blendModeOption.value}>
|
|
137
|
+
${blendModeOption.title}
|
|
138
|
+
<span slot="value">${blendModeOption.subtitle}</span>
|
|
139
|
+
</sp-menu-item>
|
|
140
|
+
`
|
|
143
141
|
)}
|
|
144
142
|
`;
|
|
145
143
|
}
|
|
@@ -173,4 +171,8 @@ export const disconnectedChildItems = () => html`
|
|
|
173
171
|
disconnectedChildItems.swc_vrt = {
|
|
174
172
|
skip: true
|
|
175
173
|
};
|
|
174
|
+
disconnectedChildItems.parameters = {
|
|
175
|
+
// Disables Chromatic's snapshotting on a global level
|
|
176
|
+
chromatic: { disableSnapshot: true }
|
|
177
|
+
};
|
|
176
178
|
//# sourceMappingURL=menu-item.disconnected.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-item.disconnected.stories.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, LitElement, TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { when } from 'lit/directives/when.js';\n\nimport '@spectrum-web-components/picker/sp-picker.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { SpectrumMixin } from '@spectrum-web-components/base';\n\nenum BlendModeValue {\n normal = 2,\n multiply = 3,\n screen = 7,\n}\n\ninterface BlendModeOption {\n value: BlendModeValue;\n title: string;\n subtitle: string;\n thumbnail: string;\n}\n\nconst XElement = SpectrumMixin(LitElement);\n\nclass MyContainer extends XElement {\n @state()\n private _counter = 0;\n\n private _handleClick(): void {\n this._counter += 1;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div>\n ${when(\n this._counter % 2 === 0,\n () => html`\n <my-view1></my-view1>\n `,\n () => html`\n <my-view2></my-view2>\n `\n )}\n <sp-button\n variant=\"primary\"\n size=\"m\"\n @click=${this._handleClick}\n >\n Switch views\n </sp-button>\n </div>\n `;\n }\n}\n\ncustomElements.define('my-container', MyContainer);\n\nclass MyView1 extends XElement {\n protected override render(): TemplateResult {\n const blendModeOptions = [\n {\n value: BlendModeValue.normal,\n title: 'Normal 1',\n subtitle: 'No effect applied',\n },\n {\n value: BlendModeValue.multiply,\n title: 'Multiply',\n subtitle: 'Darken shadows with contrast and details',\n },\n {\n value: BlendModeValue.screen,\n title: 'Screen',\n subtitle: 'Brighten highlights with contrast and details',\n },\n ];\n return html`\n View 1\n <my-picker\n .blendMode=${BlendModeValue.normal}\n .blendModeOptions=${blendModeOptions}\n dir=\"ltr\"\n ></my-picker>\n `;\n }\n}\n\ncustomElements.define('my-view1', MyView1);\n\nclass MyView2 extends XElement {\n protected override render(): TemplateResult {\n const blendModeOptions = [\n {\n value: BlendModeValue.normal,\n title: 'Normal 2',\n subtitle: 'No effect applied',\n },\n {\n value: BlendModeValue.multiply,\n title: 'Multiply',\n subtitle: 'Darken shadows with contrast and details',\n },\n {\n value: BlendModeValue.screen,\n title: 'Screen',\n subtitle: 'Brighten highlights with contrast and details',\n },\n ];\n return html`\n View 2\n <my-picker\n .blendMode=${BlendModeValue.normal}\n .blendModeOptions=${blendModeOptions}\n ></my-picker>\n `;\n }\n}\n\ncustomElements.define('my-view2', MyView2);\n\nclass MyPicker extends XElement {\n @property({ type: Array })\n public blendModeOptions: BlendModeOption[] = [];\n\n @property()\n public blendMode: number = BlendModeValue.normal;\n\n private _renderBlendOptions(): TemplateResult {\n return html`\n ${repeat(\n this.blendModeOptions,\n // This is intentional so that repeat directive will add instead of\n // update existing DOM which will then trigger error in\n // MenuItem.childrenItem\n // Using .value for the key will workaround the issue\n (blendModeOption) => blendModeOption,\n (blendModeOption: BlendModeOption)
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA,SAAS,MAAM,kBAAkC;AACjD,SAAS,UAAU,aAAa;AAChC,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,OAAO;AACP,OAAO;AACP,SAAS,qBAAqB;AAE9B,IAAK,iBAAL,kBAAKA,oBAAL;AACI,EAAAA,gCAAA,YAAS,KAAT;AACA,EAAAA,gCAAA,cAAW,KAAX;AACA,EAAAA,gCAAA,YAAS,KAAT;AAHC,SAAAA;AAAA,GAAA;AAaL,MAAM,WAAW,cAAc,UAAU;AAEzC,MAAM,oBAAoB,SAAS;AAAA,EAAnC;AAAA;AAEI,SAAQ,WAAW;AAAA;AAAA,EAEX,eAAqB;AACzB,SAAK,YAAY;AAAA,EACrB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,kBAEG;AAAA,MACE,KAAK,WAAW,MAAM;AAAA,MACtB,MAAM;AAAA;AAAA;AAAA,MAGN,MAAM;AAAA;AAAA;AAAA,IAGV,CAAC;AAAA;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rB,CAAC,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, LitElement, TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { when } from 'lit/directives/when.js';\n\nimport '@spectrum-web-components/picker/sp-picker.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { SpectrumMixin } from '@spectrum-web-components/base';\n\nenum BlendModeValue {\n normal = 2,\n multiply = 3,\n screen = 7,\n}\n\ninterface BlendModeOption {\n value: BlendModeValue;\n title: string;\n subtitle: string;\n thumbnail: string;\n}\n\nconst XElement = SpectrumMixin(LitElement);\n\nclass MyContainer extends XElement {\n @state()\n private _counter = 0;\n\n private _handleClick(): void {\n this._counter += 1;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div>\n ${when(\n this._counter % 2 === 0,\n () => html`\n <my-view1></my-view1>\n `,\n () => html`\n <my-view2></my-view2>\n `\n )}\n <sp-button\n variant=\"primary\"\n size=\"m\"\n @click=${this._handleClick}\n >\n Switch views\n </sp-button>\n </div>\n `;\n }\n}\n\ncustomElements.define('my-container', MyContainer);\n\nclass MyView1 extends XElement {\n protected override render(): TemplateResult {\n const blendModeOptions = [\n {\n value: BlendModeValue.normal,\n title: 'Normal 1',\n subtitle: 'No effect applied',\n },\n {\n value: BlendModeValue.multiply,\n title: 'Multiply',\n subtitle: 'Darken shadows with contrast and details',\n },\n {\n value: BlendModeValue.screen,\n title: 'Screen',\n subtitle: 'Brighten highlights with contrast and details',\n },\n ];\n return html`\n View 1\n <my-picker\n .blendMode=${BlendModeValue.normal}\n .blendModeOptions=${blendModeOptions}\n dir=\"ltr\"\n ></my-picker>\n `;\n }\n}\n\ncustomElements.define('my-view1', MyView1);\n\nclass MyView2 extends XElement {\n protected override render(): TemplateResult {\n const blendModeOptions = [\n {\n value: BlendModeValue.normal,\n title: 'Normal 2',\n subtitle: 'No effect applied',\n },\n {\n value: BlendModeValue.multiply,\n title: 'Multiply',\n subtitle: 'Darken shadows with contrast and details',\n },\n {\n value: BlendModeValue.screen,\n title: 'Screen',\n subtitle: 'Brighten highlights with contrast and details',\n },\n ];\n return html`\n View 2\n <my-picker\n .blendMode=${BlendModeValue.normal}\n .blendModeOptions=${blendModeOptions}\n ></my-picker>\n `;\n }\n}\n\ncustomElements.define('my-view2', MyView2);\n\nclass MyPicker extends XElement {\n @property({ type: Array })\n public blendModeOptions: BlendModeOption[] = [];\n\n @property()\n public blendMode: number = BlendModeValue.normal;\n\n private _renderBlendOptions(): TemplateResult {\n return html`\n ${repeat(\n this.blendModeOptions,\n // This is intentional so that repeat directive will add instead of\n // update existing DOM which will then trigger error in\n // MenuItem.childrenItem\n // Using .value for the key will workaround the issue\n (blendModeOption) => blendModeOption,\n (blendModeOption: BlendModeOption) => html`\n <sp-menu-item value=${blendModeOption.value}>\n ${blendModeOption.title}\n <span slot=\"value\">${blendModeOption.subtitle}</span>\n </sp-menu-item>\n `\n )}\n `;\n }\n protected override render(): TemplateResult {\n return html`\n <sp-picker\n id=\"blendMode\"\n size=\"l\"\n label=\"Blend\"\n value=${this.blendMode}\n >\n ${this._renderBlendOptions()}\n </sp-picker>\n `;\n }\n}\n\ncustomElements.define('my-picker', MyPicker);\n\nexport default {\n component: 'sp-menu-item',\n title: 'Menu Item/Disconnected',\n};\n\nexport const disconnectedChildItems = (): TemplateResult => html`\n <my-container></my-container>\n`;\n\ndisconnectedChildItems.swc_vrt = {\n skip: true,\n};\n\ndisconnectedChildItems.parameters = {\n // Disables Chromatic's snapshotting on a global level\n chromatic: { disableS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EA,uBAAuB,aAAa;AAAA;AAAA,EAEhC,WAAW,EAAE,iBAAiB,KAAK;AACvC;",
|
|
6
6
|
"names": ["BlendModeValue"]
|
|
7
7
|
}
|
package/stories/menu.stories.js
CHANGED
|
@@ -137,6 +137,10 @@ export const controlled = () => {
|
|
|
137
137
|
controlled.swc_vrt = {
|
|
138
138
|
skip: true
|
|
139
139
|
};
|
|
140
|
+
controlled.parameters = {
|
|
141
|
+
// Disables Chromatic's snapshotting on a global level
|
|
142
|
+
chromatic: { disableSnapshot: true }
|
|
143
|
+
};
|
|
140
144
|
export const menuItemWithDescription = () => {
|
|
141
145
|
return html`
|
|
142
146
|
<sp-menu>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu.stories.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport type { Menu } from '@spectrum-web-components/menu';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-export.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-folder-open.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-share.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\n\nexport default {\n component: 'sp-menu',\n title: 'Menu',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const singleSelect = (): TemplateResult => {\n return html`\n <sp-menu\n selects=\"single\"\n @change=${({\n target: { value },\n }: Event & { target: Menu }): void => {\n navigator.clipboard.writeText(value);\n }}\n >\n <sp-menu-item selected>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu\n selects=\"single\"\n @change=${({\n target: { value },\n }: Event & { target: Menu }): void => {\n navigator.clipboard.writeText(value);\n }}\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const multipleSelect = (): TemplateResult => {\n return html`\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item selected>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item selected>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item selected>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const controlled = (): TemplateResult => {\n const forceSelection = (event: Event & { target: Menu }): void => {\n event.target.updateComplete.then(() => {\n event.target.selected = ['Select and Mask...'];\n });\n };\n return html`\n <p>\n This Menu will default to a\n <code>selected</code>\n value of\n <code>[ 'Feather...', 'Save Selection' ]</code>\n but then on any subsequent interaction be forced to a\n <code>selected</code>\n value of\n <code>[ 'Select and Mask...' ]</code>\n .\n </p>\n <sp-menu selects=\"multiple\" @change=${forceSelection}>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item selected>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n `;\n};\ncontrolled.swc_vrt = {\n skip: true,\n};\n\nexport const menuItemWithDescription = (): TemplateResult => {\n return html`\n <sp-menu>\n <sp-menu-item>\n <sp-icon-export slot=\"icon\"></sp-icon-export>\n Quick export\n <span slot=\"description\">Share a snapshot</span>\n </sp-menu-item>\n <sp-menu-item>\n <sp-icon-folder-open slot=\"icon\"></sp-icon-folder-open>\n Open a copy\n <span slot=\"description\">Illustrator for iPad</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-share slot=\"icon\"></sp-icon-share>\n Share link\n <span slot=\"description\">Enable comments and download</span>\n </sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item selected>\n Select Inverse\n <span slot=\"description\">Enable inverse selection</span>\n </sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item selected>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>\n Make Work Path\n <span slot=\"description\">Create a reusable work path</span>\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const selectsWithIcons = (): TemplateResult => {\n return html`\n <sp-popover open>\n <sp-menu selects=\"single\">\n <sp-menu-item>\n <sp-icon-export slot=\"icon\"></sp-icon-export>\n Quick export\n </sp-menu-item>\n <sp-menu-item selected>\n <sp-icon-folder-open slot=\"icon\"></sp-icon-folder-open>\n Open a copy\n </sp-menu-item>\n <sp-menu-item>\n <sp-icon-share slot=\"icon\"></sp-icon-share>\n Share link\n <span slot=\"description\">Enable comments and download</span>\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const headersAndIcons = (): TemplateResult => {\n return html`\n <sp-popover open>\n <sp-menu selects=\"single\">\n <sp-menu-group>\n <span slot=\"header\">Section Heading</span>\n <sp-menu-item>Action 1</sp-menu-item>\n <sp-menu-item>Action 2</sp-menu-item>\n <sp-menu-item>Action 3</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group>\n <span slot=\"header\">Section Heading</span>\n <sp-menu-item>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Save\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Download\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Share link\n <span slot=\"description\">Enable comments</span>\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nheadersAndIcons.storyName = 'Headers and Icons';\n\nexport const Selected = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu>\n <sp-menu-group>\n <span slot=\"header\">San Francisco</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item>South of Market</sp-menu-item>\n <sp-menu-item>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">Oakland</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const MenuGroupSelects = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu selects=\"single\">\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>Camden</sp-menu-item>\n <sp-menu-item>Cedar Riverside</sp-menu-item>\n <sp-menu-item>Downtown</sp-menu-item>\n <sp-menu-item>Northeast Arts District</sp-menu-item>\n <sp-menu-item selected>Uptown</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">Or of these</span>\n <sp-menu-item>Lowertown</sp-menu-item>\n <sp-menu-item>Grand Ave</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"multiple\">\n <span slot=\"header\">Many of these</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item selected>South of Market</sp-menu-item>\n <sp-menu-item selected>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const selectedOffPage = (): TemplateResult => {\n return html`\n <p style=\"height: 100vh; padding-bottom: 50px;\">\n In this example the \\`<sp-menu-item selected>\\` element is off\n the visible page by default, but does not alter the page scroll on\n load.\n </p>\n <sp-menu>\n <sp-menu-item selected style=\"padding-bottom: 50px;\">\n My best friend's mom's house in the burbs just off Silverado\n street\n </sp-menu-item>\n </sp-menu>\n `;\n};\n\nexport const MenuGroupSelectsMultiple = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu selects=\"multiple\">\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">Many of these</span>\n <sp-menu-item>Camden</sp-menu-item>\n <sp-menu-item selected>Cedar Riverside</sp-menu-item>\n <sp-menu-item selected>Downtown</sp-menu-item>\n <sp-menu-item>Northeast Arts District</sp-menu-item>\n <sp-menu-item>Uptown</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">And these, too</span>\n <sp-menu-item>Lowertown</sp-menu-item>\n <sp-menu-item selected>Grand Ave</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group>\n <span slot=\"header\">None of these</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item>South of Market</sp-menu-item>\n <sp-menu-item>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const menuWithValueSlots = (): TemplateResult => {\n return html`\n <sp-menu style=\"width: 150px\">\n <sp-menu-item>\n Undo\n <span slot=\"value\">\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Redo\n <span slot=\"value\">\u21E7\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Paste\n <span slot=\"value\">\u2318\u200BP</span>\n </sp-menu-item>\n </sp-menu>\n <sp-popover open style=\"width: 150px\">\n <sp-menu>\n <sp-menu-item>\n Undo\n <span slot=\"value\">\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Redo\n <span slot=\"value\">\u21E7\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Paste\n <span slot=\"value\">\u2318\u200BP</span>\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n"],
|
|
5
|
-
"mappings": ";AAWA,SAAS,YAA4B;AAGrC,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaX;AAEO,aAAM,2BAA2B,MAAsB;AAC1D,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCX;AAEO,aAAM,qBAAqB,MAAsB;AACpD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkDX;",
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport type { Menu } from '@spectrum-web-components/menu';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-export.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-folder-open.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-share.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\n\nexport default {\n component: 'sp-menu',\n title: 'Menu',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const singleSelect = (): TemplateResult => {\n return html`\n <sp-menu\n selects=\"single\"\n @change=${({\n target: { value },\n }: Event & { target: Menu }): void => {\n navigator.clipboard.writeText(value);\n }}\n >\n <sp-menu-item selected>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu\n selects=\"single\"\n @change=${({\n target: { value },\n }: Event & { target: Menu }): void => {\n navigator.clipboard.writeText(value);\n }}\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const multipleSelect = (): TemplateResult => {\n return html`\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item selected>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item selected>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item selected>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const controlled = (): TemplateResult => {\n const forceSelection = (event: Event & { target: Menu }): void => {\n event.target.updateComplete.then(() => {\n event.target.selected = ['Select and Mask...'];\n });\n };\n return html`\n <p>\n This Menu will default to a\n <code>selected</code>\n value of\n <code>[ 'Feather...', 'Save Selection' ]</code>\n but then on any subsequent interaction be forced to a\n <code>selected</code>\n value of\n <code>[ 'Select and Mask...' ]</code>\n .\n </p>\n <sp-menu selects=\"multiple\" @change=${forceSelection}>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item selected>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item selected>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n `;\n};\ncontrolled.swc_vrt = {\n skip: true,\n};\n\ncontrolled.parameters = {\n // Disables Chromatic's snapshotting on a global level\n chromatic: { disableSnapshot: true },\n};\n\nexport const menuItemWithDescription = (): TemplateResult => {\n return html`\n <sp-menu>\n <sp-menu-item>\n <sp-icon-export slot=\"icon\"></sp-icon-export>\n Quick export\n <span slot=\"description\">Share a snapshot</span>\n </sp-menu-item>\n <sp-menu-item>\n <sp-icon-folder-open slot=\"icon\"></sp-icon-folder-open>\n Open a copy\n <span slot=\"description\">Illustrator for iPad</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-share slot=\"icon\"></sp-icon-share>\n Share link\n <span slot=\"description\">Enable comments and download</span>\n </sp-menu-item>\n </sp-menu>\n\n <sp-popover open>\n <sp-menu selects=\"multiple\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item selected>\n Select Inverse\n <span slot=\"description\">Enable inverse selection</span>\n </sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item selected>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>\n Make Work Path\n <span slot=\"description\">Create a reusable work path</span>\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const selectsWithIcons = (): TemplateResult => {\n return html`\n <sp-popover open>\n <sp-menu selects=\"single\">\n <sp-menu-item>\n <sp-icon-export slot=\"icon\"></sp-icon-export>\n Quick export\n </sp-menu-item>\n <sp-menu-item selected>\n <sp-icon-folder-open slot=\"icon\"></sp-icon-folder-open>\n Open a copy\n </sp-menu-item>\n <sp-menu-item>\n <sp-icon-share slot=\"icon\"></sp-icon-share>\n Share link\n <span slot=\"description\">Enable comments and download</span>\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const headersAndIcons = (): TemplateResult => {\n return html`\n <sp-popover open>\n <sp-menu selects=\"single\">\n <sp-menu-group>\n <span slot=\"header\">Section Heading</span>\n <sp-menu-item>Action 1</sp-menu-item>\n <sp-menu-item>Action 2</sp-menu-item>\n <sp-menu-item>Action 3</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group>\n <span slot=\"header\">Section Heading</span>\n <sp-menu-item>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Save\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Download\n </sp-menu-item>\n <sp-menu-item disabled>\n <sp-icon-checkmark-circle\n slot=\"icon\"\n ></sp-icon-checkmark-circle>\n Share link\n <span slot=\"description\">Enable comments</span>\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nheadersAndIcons.storyName = 'Headers and Icons';\n\nexport const Selected = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu>\n <sp-menu-group>\n <span slot=\"header\">San Francisco</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item>South of Market</sp-menu-item>\n <sp-menu-item>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">Oakland</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const MenuGroupSelects = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu selects=\"single\">\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>Camden</sp-menu-item>\n <sp-menu-item>Cedar Riverside</sp-menu-item>\n <sp-menu-item>Downtown</sp-menu-item>\n <sp-menu-item>Northeast Arts District</sp-menu-item>\n <sp-menu-item selected>Uptown</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">Or of these</span>\n <sp-menu-item>Lowertown</sp-menu-item>\n <sp-menu-item>Grand Ave</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"multiple\">\n <span slot=\"header\">Many of these</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item selected>South of Market</sp-menu-item>\n <sp-menu-item selected>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const selectedOffPage = (): TemplateResult => {\n return html`\n <p style=\"height: 100vh; padding-bottom: 50px;\">\n In this example the \\`<sp-menu-item selected>\\` element is off\n the visible page by default, but does not alter the page scroll on\n load.\n </p>\n <sp-menu>\n <sp-menu-item selected style=\"padding-bottom: 50px;\">\n My best friend's mom's house in the burbs just off Silverado\n street\n </sp-menu-item>\n </sp-menu>\n `;\n};\n\nexport const MenuGroupSelectsMultiple = (): TemplateResult => {\n return html`\n <sp-popover open style=\"width: 200px;\">\n <sp-menu selects=\"multiple\">\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">Many of these</span>\n <sp-menu-item>Camden</sp-menu-item>\n <sp-menu-item selected>Cedar Riverside</sp-menu-item>\n <sp-menu-item selected>Downtown</sp-menu-item>\n <sp-menu-item>Northeast Arts District</sp-menu-item>\n <sp-menu-item>Uptown</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group selects=\"inherit\">\n <span slot=\"header\">And these, too</span>\n <sp-menu-item>Lowertown</sp-menu-item>\n <sp-menu-item selected>Grand Ave</sp-menu-item>\n </sp-menu-group>\n <sp-menu-group>\n <span slot=\"header\">None of these</span>\n <sp-menu-item>Financial District</sp-menu-item>\n <sp-menu-item>South of Market</sp-menu-item>\n <sp-menu-item>North Beach</sp-menu-item>\n </sp-menu-group>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-group selects=\"single\">\n <span slot=\"header\">One of these</span>\n <sp-menu-item>City Center</sp-menu-item>\n <sp-menu-item disabled>Jack London Square</sp-menu-item>\n <sp-menu-item selected>\n My best friend's mom's house in the burbs just off\n Silverado street\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n};\n\nexport const menuWithValueSlots = (): TemplateResult => {\n return html`\n <sp-menu style=\"width: 150px\">\n <sp-menu-item>\n Undo\n <span slot=\"value\">\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Redo\n <span slot=\"value\">\u21E7\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Paste\n <span slot=\"value\">\u2318\u200BP</span>\n </sp-menu-item>\n </sp-menu>\n <sp-popover open style=\"width: 150px\">\n <sp-menu>\n <sp-menu-item>\n Undo\n <span slot=\"value\">\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-item disabled>\n Redo\n <span slot=\"value\">\u21E7\u2318\u200BZ</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>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