@spectrum-web-components/coachmark 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +4 -0
- package/package.json +13 -13
- package/src/Coachmark.d.ts +1 -0
- package/src/Coachmark.dev.js +3 -1
- package/src/Coachmark.dev.js.map +2 -2
- package/src/Coachmark.js +6 -4
- package/src/Coachmark.js.map +2 -2
- package/stories/coachmark.stories.js +43 -30
- package/stories/coachmark.stories.js.map +2 -2
- package/test/coachmark.test.js +24 -13
- package/test/coachmark.test.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -140,6 +140,10 @@
|
|
|
140
140
|
{
|
|
141
141
|
"description": "an `sp-action-menu` element outlining actions to take on the represened object",
|
|
142
142
|
"name": "actions"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"description": "Override the default pagination delivery with your own internationalized content",
|
|
146
|
+
"name": "step-count"
|
|
143
147
|
}
|
|
144
148
|
],
|
|
145
149
|
"members": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/coachmark",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
"lit-html"
|
|
71
71
|
],
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@spectrum-web-components/asset": "^0.42.
|
|
74
|
-
"@spectrum-web-components/base": "^0.42.
|
|
75
|
-
"@spectrum-web-components/button": "^0.42.
|
|
76
|
-
"@spectrum-web-components/button-group": "^0.42.
|
|
77
|
-
"@spectrum-web-components/icon": "^0.42.
|
|
78
|
-
"@spectrum-web-components/icons-ui": "^0.42.
|
|
79
|
-
"@spectrum-web-components/quick-actions": "^0.42.
|
|
80
|
-
"@spectrum-web-components/reactive-controllers": "^0.42.
|
|
81
|
-
"@spectrum-web-components/shared": "^0.42.
|
|
73
|
+
"@spectrum-web-components/asset": "^0.42.1",
|
|
74
|
+
"@spectrum-web-components/base": "^0.42.1",
|
|
75
|
+
"@spectrum-web-components/button": "^0.42.1",
|
|
76
|
+
"@spectrum-web-components/button-group": "^0.42.1",
|
|
77
|
+
"@spectrum-web-components/icon": "^0.42.1",
|
|
78
|
+
"@spectrum-web-components/icons-ui": "^0.42.1",
|
|
79
|
+
"@spectrum-web-components/quick-actions": "^0.42.1",
|
|
80
|
+
"@spectrum-web-components/reactive-controllers": "^0.42.1",
|
|
81
|
+
"@spectrum-web-components/shared": "^0.42.1"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@spectrum-css/coachindicator": "^1.1.
|
|
85
|
-
"@spectrum-css/coachmark": "^6.1.
|
|
84
|
+
"@spectrum-css/coachindicator": "^1.1.5",
|
|
85
|
+
"@spectrum-css/coachmark": "^6.1.5"
|
|
86
86
|
},
|
|
87
87
|
"types": "./src/index.d.ts",
|
|
88
88
|
"customElements": "custom-elements.json",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"./sp-*.js",
|
|
91
91
|
"./**/*.dev.js"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "c7ab5516e86d20194e92114afd04affa490b7248"
|
|
94
94
|
}
|
package/src/Coachmark.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import '@spectrum-web-components/quick-actions/sp-quick-actions.js';
|
|
|
15
15
|
* @slot heading - HTML content to be listed as the heading
|
|
16
16
|
* @slot description - A description of the card
|
|
17
17
|
* @slot actions - an `sp-action-menu` element outlining actions to take on the represened object
|
|
18
|
+
* @slot step-count - Override the default pagination delivery with your own internationalized content
|
|
18
19
|
*/
|
|
19
20
|
export declare class Coachmark extends Popover {
|
|
20
21
|
static get styles(): CSSResultArray;
|
package/src/Coachmark.dev.js
CHANGED
|
@@ -90,7 +90,9 @@ export class Coachmark extends Popover {
|
|
|
90
90
|
return html`
|
|
91
91
|
<div class="step" role="status">
|
|
92
92
|
<span aria-live="polite">
|
|
93
|
-
|
|
93
|
+
<slot name="step-count">
|
|
94
|
+
${this.currentStep} of ${this.totalSteps}
|
|
95
|
+
</slot>
|
|
94
96
|
</span>
|
|
95
97
|
</div>
|
|
96
98
|
`;
|
package/src/Coachmark.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Coachmark.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\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 {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.dev.js'\nimport type { CoachmarkItem } from './CoachmarkItem.dev.js'\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAC1B,OAAO;AACP,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;
|
|
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\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 {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.dev.js'\nimport type { CoachmarkItem } from './CoachmarkItem.dev.js'\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n * @slot step-count - Override the default pagination delivery with your own internationalized content\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n <slot name=\"step-count\">\n ${this.currentStep} of ${this.totalSteps}\n </slot>\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB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AO,CAAC;AAAA,GAPjB,UAQO;AAGR;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,MAAM,CAAC;AAAA,GAVnC,UAWD;AAOA;AAAA,EADP,SAAS,EAAE,WAAW,eAAe,CAAC;AAAA,GAjB9B,UAkBD;AAGD;AAAA,EADN,SAAS,EAAE,MAAM,MAAM,CAAC;AAAA,GApBhB,UAqBF;AAGC;AAAA,EADP,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAvBrB,UAwBD;AAGA;AAAA,EADP,SAAS,EAAE,WAAW,aAAa,CAAC;AAAA,GA1B5B,UA2BD;AAGD;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,WAAW,aAAa,SAAS,KAAK,CAAC;AAAA,GA7BzD,UA8BF;AAGA;AAAA,EADN,SAAS;AAAA,GAhCD,UAiCF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GAnC5C,UAoCF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAtC3C,UAuCF;AAGP;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAzC3C,UA0CT;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB,CAAC;AAAA,GA5C7C,UA6CT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Coachmark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var r=(
|
|
1
|
+
"use strict";var v=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var r=(c,l,n,e)=>{for(var i=e>1?void 0:e?b(l,n):l,o=c.length-1,a;o>=0;o--)(a=c[o])&&(i=(e?a(l,n,i):a(i))||i);return e&&i&&v(l,n,i),i};import{html as t,nothing as u}from"@spectrum-web-components/base";import{property as s}from"@spectrum-web-components/base/src/decorators.js";import{when as p}from"@spectrum-web-components/base/src/directives.js";import T from"./coachmark.css.js";import f from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js";import{Popover as g}from"@spectrum-web-components/popover";import{join as $}from"lit/directives/join.js";import{ifDefined as y}from"@spectrum-web-components/base/src/directives.js";import{MediaType as A}from"./CoachmarkItem.js";import"@spectrum-web-components/asset/sp-asset.js";import"@spectrum-web-components/button/sp-button.js";import"@spectrum-web-components/button-group/sp-button-group.js";import"@spectrum-web-components/quick-actions/sp-quick-actions.js";export class Coachmark extends g{constructor(){super(...arguments);this.placement="right";this.modifierKeys=[];this.hasAsset=!1;this.renderSecondaryButton=()=>t`
|
|
2
2
|
<sp-button
|
|
3
3
|
treatment="outline"
|
|
4
4
|
variant="secondary"
|
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
`;this.renderSteps=()=>t`
|
|
42
42
|
<div class="step" role="status">
|
|
43
43
|
<span aria-live="polite">
|
|
44
|
-
|
|
44
|
+
<slot name="step-count">
|
|
45
|
+
${this.currentStep} of ${this.totalSteps}
|
|
46
|
+
</slot>
|
|
45
47
|
</span>
|
|
46
48
|
</div>
|
|
47
49
|
`;this.renderActionMenu=()=>t`
|
|
@@ -66,11 +68,11 @@
|
|
|
66
68
|
<span type="${e}" class="keyboard-shortcut">${n}</span>
|
|
67
69
|
`}renderJoiner(){return t`
|
|
68
70
|
<span class="plus">+</span>
|
|
69
|
-
`}renderHeader(){var o,a,
|
|
71
|
+
`}renderHeader(){var o,a,d,m;const n=this.modifierKeys&&((o=this.modifierKeys)==null?void 0:o.length)>0,e=!!this.shortcutKey,i=!!((a=this.content)!=null&&a.title);return!i&&!n&&!e?t`
|
|
70
72
|
<div class="title"><slot name="title"></slot></div>
|
|
71
73
|
`:t`
|
|
72
74
|
${i?t`
|
|
73
|
-
<div class="title">${(
|
|
75
|
+
<div class="title">${(d=this.content)==null?void 0:d.title}</div>
|
|
74
76
|
`:u}
|
|
75
77
|
${n||e?t`
|
|
76
78
|
<kbd class="keys spectrum-Body spectrum-Body--sizeS">
|
package/src/Coachmark.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Coachmark.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\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 {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.js';\nimport type { CoachmarkItem } from './CoachmarkItem.js';\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "qNAWA,OAEI,QAAAA,EACA,WAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,QAAAC,MAAY,kDACrB,OAAOC,MAAqB,qBAC5B,OAAOC,MAAmB,iEAC1B,MAAO,gEACP,OAAS,WAAAC,MAAe,mCACxB,OAAS,QAAAC,MAAY,yBACrB,OAAS,aAAAC,MAAiB,kDAE1B,OAAS,aAAAC,MAAiB,qBAE1B,MAAO,6CACP,MAAO,+CACP,MAAO,2DACP,MAAO,
|
|
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\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 {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.js';\nimport type { CoachmarkItem } from './CoachmarkItem.js';\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n * @slot step-count - Override the default pagination delivery with your own internationalized content\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n <slot name=\"step-count\">\n ${this.currentStep} of ${this.totalSteps}\n </slot>\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAWA,OAEI,QAAAA,EACA,WAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,QAAAC,MAAY,kDACrB,OAAOC,MAAqB,qBAC5B,OAAOC,MAAmB,iEAC1B,MAAO,gEACP,OAAS,WAAAC,MAAe,mCACxB,OAAS,QAAAC,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AiCF,qBAGAkB,EAAA,CADNlB,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GAnC5C,UAoCF,2BAGAkB,EAAA,CADNlB,EAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,CAAC,GAtC3C,UAuCF,0BAGPkB,EAAA,CADClB,EAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,CAAC,GAzC3C,UA0CT,0BAGAkB,EAAA,CADClB,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GA5C7C,UA6CT",
|
|
6
6
|
"names": ["html", "nothing", "property", "when", "coachmarkStyles", "chevronStyles", "Popover", "join", "ifDefined", "MediaType", "_a", "modifierKey", "type", "_b", "_c", "_d", "hasModifier", "hasShortcut", "hasTitle", "k", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -28,15 +28,17 @@ export const InTour = (props, args = {}) => {
|
|
|
28
28
|
const {
|
|
29
29
|
open = true,
|
|
30
30
|
heading = "Coachmark in Tour",
|
|
31
|
-
content = "This is a Coachmark with nothing but text in it."
|
|
31
|
+
content = "This is a Coachmark with nothing but text in it.",
|
|
32
|
+
currentStep = 2,
|
|
33
|
+
totalSteps = 8
|
|
32
34
|
} = props;
|
|
33
35
|
return html`
|
|
34
36
|
<sp-coachmark
|
|
35
37
|
?open=${open}
|
|
36
38
|
primary-cta="Next"
|
|
37
39
|
secondary-cta="Previous"
|
|
38
|
-
current-step
|
|
39
|
-
total-steps
|
|
40
|
+
current-step=${currentStep}
|
|
41
|
+
total-steps=${totalSteps}
|
|
40
42
|
.content=${{
|
|
41
43
|
title: heading,
|
|
42
44
|
description: content
|
|
@@ -56,6 +58,7 @@ export const InTour = (props, args = {}) => {
|
|
|
56
58
|
(_a = args.onSecondary) == null ? void 0 : _a.call(args, event);
|
|
57
59
|
}}
|
|
58
60
|
>
|
|
61
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
59
62
|
<sp-action-menu
|
|
60
63
|
placement="bottom-end"
|
|
61
64
|
quiet
|
|
@@ -80,7 +83,7 @@ export const single = () => {
|
|
|
80
83
|
`;
|
|
81
84
|
};
|
|
82
85
|
export const TriggerOnClick = (props) => {
|
|
83
|
-
const { open = true } = props;
|
|
86
|
+
const { open = true, currentStep = 1, totalSteps = 4 } = props;
|
|
84
87
|
return html`
|
|
85
88
|
<sp-coach-indicator id="trigger"></sp-coach-indicator>
|
|
86
89
|
<sp-overlay
|
|
@@ -91,31 +94,31 @@ export const TriggerOnClick = (props) => {
|
|
|
91
94
|
>
|
|
92
95
|
<sp-coachmark
|
|
93
96
|
?open=${open}
|
|
94
|
-
current-step
|
|
95
|
-
total-steps
|
|
96
|
-
primary-cta="
|
|
97
|
-
secondary-cta="
|
|
97
|
+
current-step=${currentStep}
|
|
98
|
+
total-steps=${totalSteps}
|
|
99
|
+
primary-cta="次"
|
|
100
|
+
secondary-cta="前の"
|
|
98
101
|
>
|
|
99
|
-
<div slot="title"
|
|
102
|
+
<div slot="title">クリック時のコーチマーク</div>
|
|
100
103
|
<div slot="content">
|
|
101
|
-
|
|
102
|
-
lonely in here.
|
|
104
|
+
これはテキストだけが入ったコーチマークです。ここはなんだか寂しいですね。
|
|
103
105
|
</div>
|
|
106
|
+
<div slot="step-count">4 分の 1</div>
|
|
104
107
|
<sp-action-menu
|
|
105
108
|
placement="bottom-end"
|
|
106
109
|
quiet
|
|
107
110
|
slot="actions"
|
|
108
111
|
label="More Actions"
|
|
109
112
|
>
|
|
110
|
-
<sp-menu-item
|
|
111
|
-
<sp-menu-item
|
|
113
|
+
<sp-menu-item>ツアーをスキップ</sp-menu-item>
|
|
114
|
+
<sp-menu-item>ツアー再開</sp-menu-item>
|
|
112
115
|
</sp-action-menu>
|
|
113
116
|
</sp-coachmark>
|
|
114
117
|
</sp-overlay>
|
|
115
118
|
`;
|
|
116
119
|
};
|
|
117
120
|
export const TriggerOnHover = (props) => {
|
|
118
|
-
const { open = true } = props;
|
|
121
|
+
const { open = true, currentStep = 2, totalSteps = 8 } = props;
|
|
119
122
|
return html`
|
|
120
123
|
<sp-coach-indicator id="trigger"></sp-coach-indicator>
|
|
121
124
|
<sp-overlay
|
|
@@ -126,8 +129,8 @@ export const TriggerOnHover = (props) => {
|
|
|
126
129
|
>
|
|
127
130
|
<sp-coachmark
|
|
128
131
|
?open=${open}
|
|
129
|
-
current-step
|
|
130
|
-
total-steps
|
|
132
|
+
current-step=${currentStep}
|
|
133
|
+
total-steps=${totalSteps}
|
|
131
134
|
primary-cta="Next"
|
|
132
135
|
secondary-cta="Previous"
|
|
133
136
|
>
|
|
@@ -136,6 +139,7 @@ export const TriggerOnHover = (props) => {
|
|
|
136
139
|
This is a Coachmark with nothing but text in it. Kind of
|
|
137
140
|
lonely in here.
|
|
138
141
|
</div>
|
|
142
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
139
143
|
<sp-action-menu
|
|
140
144
|
placement="bottom-end"
|
|
141
145
|
quiet
|
|
@@ -149,22 +153,24 @@ export const TriggerOnHover = (props) => {
|
|
|
149
153
|
</sp-overlay>
|
|
150
154
|
`;
|
|
151
155
|
};
|
|
152
|
-
export const withImage = () => {
|
|
156
|
+
export const withImage = (props) => {
|
|
157
|
+
const { open = true, currentStep = 2, totalSteps = 8 } = props;
|
|
153
158
|
return html`
|
|
154
159
|
<sp-coachmark
|
|
155
|
-
open
|
|
160
|
+
?open=${open}
|
|
156
161
|
src=${cave}
|
|
157
162
|
media-type="image"
|
|
158
163
|
primary-cta="Next"
|
|
159
164
|
secondary-cta="Previous"
|
|
160
|
-
current-step
|
|
161
|
-
total-steps
|
|
165
|
+
current-step=${currentStep}
|
|
166
|
+
total-steps=${totalSteps}
|
|
162
167
|
>
|
|
163
168
|
<div slot="title">Coachmark with Media</div>
|
|
164
169
|
<div slot="content">
|
|
165
170
|
This is a Coachmark with nothing but text in it. Kind of lonely
|
|
166
171
|
in here.
|
|
167
172
|
</div>
|
|
173
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
168
174
|
<sp-action-menu
|
|
169
175
|
placement="bottom-end"
|
|
170
176
|
quiet
|
|
@@ -177,22 +183,24 @@ export const withImage = () => {
|
|
|
177
183
|
</sp-coachmark>
|
|
178
184
|
`;
|
|
179
185
|
};
|
|
180
|
-
export const withGif = () => {
|
|
186
|
+
export const withGif = (props) => {
|
|
187
|
+
const { open = true, currentStep = 2, totalSteps = 8 } = props;
|
|
181
188
|
return html`
|
|
182
189
|
<sp-coachmark
|
|
183
|
-
open
|
|
190
|
+
?open=${open}
|
|
184
191
|
src=${gif}
|
|
185
192
|
media-type="image"
|
|
186
193
|
primary-cta="Next"
|
|
187
194
|
secondary-cta="Previous"
|
|
188
|
-
current-step
|
|
189
|
-
total-steps
|
|
195
|
+
current-step=${currentStep}
|
|
196
|
+
total-steps=${totalSteps}
|
|
190
197
|
>
|
|
191
198
|
<div slot="title">Coachmark with GIF</div>
|
|
192
199
|
<div slot="content">
|
|
193
200
|
This is a Coachmark with nothing but text in it. Kind of lonely
|
|
194
201
|
in here.
|
|
195
202
|
</div>
|
|
203
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
196
204
|
<sp-action-menu
|
|
197
205
|
placement="bottom-end"
|
|
198
206
|
quiet
|
|
@@ -212,7 +220,9 @@ export const withKeys = (props) => {
|
|
|
212
220
|
const {
|
|
213
221
|
modifierKeys = ["\u21E7 Shift", "\u2318"],
|
|
214
222
|
heading = "Coachmark with Keys",
|
|
215
|
-
content = "This is a Coachmark with nothing but text in it."
|
|
223
|
+
content = "This is a Coachmark with nothing but text in it.",
|
|
224
|
+
currentStep = 2,
|
|
225
|
+
totalSteps = 8
|
|
216
226
|
} = props;
|
|
217
227
|
return html`
|
|
218
228
|
<sp-coachmark
|
|
@@ -224,9 +234,10 @@ export const withKeys = (props) => {
|
|
|
224
234
|
}}
|
|
225
235
|
primary-cta="Next"
|
|
226
236
|
secondary-cta="Previous"
|
|
227
|
-
current-step
|
|
228
|
-
total-steps
|
|
237
|
+
current-step=${currentStep}
|
|
238
|
+
total-steps=${totalSteps}
|
|
229
239
|
>
|
|
240
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
230
241
|
<sp-action-menu
|
|
231
242
|
placement="bottom-end"
|
|
232
243
|
quiet
|
|
@@ -239,20 +250,22 @@ export const withKeys = (props) => {
|
|
|
239
250
|
</sp-coachmark>
|
|
240
251
|
`;
|
|
241
252
|
};
|
|
242
|
-
export const withShortCut = () => {
|
|
253
|
+
export const withShortCut = (props) => {
|
|
254
|
+
const { currentStep = 2, totalSteps = 8 } = props;
|
|
243
255
|
return html`
|
|
244
256
|
<sp-coachmark
|
|
245
257
|
open
|
|
246
258
|
primary-cta="Next"
|
|
247
259
|
secondary-cta="Previous"
|
|
248
|
-
current-step
|
|
249
|
-
total-steps
|
|
260
|
+
current-step=${currentStep}
|
|
261
|
+
total-steps=${totalSteps}
|
|
250
262
|
shortcut-key="Z"
|
|
251
263
|
.content=${{
|
|
252
264
|
title: "Coachmark Shortcut",
|
|
253
265
|
description: "This is a Coachmark with nothing but text in it. Kind of lonely in here"
|
|
254
266
|
}}
|
|
255
267
|
>
|
|
268
|
+
<div slot="step-count">${currentStep} of ${totalSteps}</div>
|
|
256
269
|
<sp-action-menu
|
|
257
270
|
placement="bottom-end"
|
|
258
271
|
quiet
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["coachmark.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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport type { MediaType } from '../src/CoachmarkItem.js';\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport { cave, gif } from './images.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\n\nexport default {\n title: 'Coachmark',\n component: 'sp-coachmark',\n argTypes: {\n onPrimary: { action: 'primary' },\n onSecondary: { action: 'secondary' },\n },\n};\n\ntype StoryArgs = {\n onPrimary?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n};\n\ntype Properties = {\n open?: boolean;\n placement?: Placement;\n id?: string;\n heading: string;\n shortcutKey?: string;\n modifierKeys?: string[];\n content: string;\n src?: string;\n mediaType?: MediaType;\n imageAlt?: string;\n currentStep?: number;\n totalSteps?: number;\n primaryCTA?: string;\n secondaryCTA?: string;\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-coachmark open>\n <div id=\"heading\" slot=\"title\">Coachmark with Text Only</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n </sp-coachmark>\n `;\n};\n\nexport const InTour = (\n props: Properties,\n args: StoryArgs = {}\n): TemplateResult => {\n const {\n open = true,\n heading = 'Coachmark in Tour',\n content = 'This is a Coachmark with nothing but text in it.',\n } = props;\n return html`\n <sp-coachmark\n ?open=${open}\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=\"2\"\n total-steps=\"8\"\n .content=${{\n title: heading,\n description: content,\n }}\n @primary=${(event: Event & { target: HTMLElement }) => {\n event.target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n args.onPrimary?.(event);\n }}\n @secondary=${(event: Event & { target: HTMLElement }) => {\n event.target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n args.onSecondary?.(event);\n }}\n >\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const single = (): TemplateResult => {\n return html`\n <sp-coachmark open primary-cta=\"Ok\">\n <div slot=\"title\">A single coachmark</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n </sp-coachmark>\n `;\n};\n\nexport const TriggerOnClick = (props: Properties): TemplateResult => {\n const { open = true } = props;\n\n return html`\n <sp-coach-indicator id=\"trigger\"></sp-coach-indicator>\n <sp-overlay\n trigger=\"trigger@click\"\n placement=\"right\"\n .receivesFocus=${'false'}\n ?open=${open}\n >\n <sp-coachmark\n ?open=${open}\n current-step=\"2\"\n total-steps=\"8\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n >\n <div slot=\"title\">Coachmark on Click</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of\n lonely in here.\n </div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n </sp-overlay>\n `;\n};\n\nexport const TriggerOnHover = (props: Properties): TemplateResult => {\n const { open = true } = props;\n\n return html`\n <sp-coach-indicator id=\"trigger\"></sp-coach-indicator>\n <sp-overlay\n trigger=\"trigger@hover\"\n placement=\"right\"\n .receivesFocus=${'false'}\n ?open=${open}\n >\n <sp-coachmark\n ?open=${open}\n current-step=\"2\"\n total-steps=\"8\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n >\n <div slot=\"title\">Coachmark on hover</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of\n lonely in here.\n </div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n </sp-overlay>\n `;\n};\n\nexport const withImage = (): TemplateResult => {\n return html`\n <sp-coachmark\n open\n src=${cave}\n media-type=\"image\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=\"2\"\n total-steps=\"8\"\n >\n <div slot=\"title\">Coachmark with Media</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const withGif = (): TemplateResult => {\n return html`\n <sp-coachmark\n open\n src=${gif}\n media-type=\"image\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=\"2\"\n total-steps=\"8\"\n >\n <div slot=\"title\">Coachmark with GIF</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nwithGif.swc_vrt = {\n skip: true,\n};\n\nexport const withKeys = (props: Properties): TemplateResult => {\n const {\n modifierKeys = ['\u21E7 Shift', '\u2318'],\n heading = 'Coachmark with Keys',\n content = 'This is a Coachmark with nothing but text in it.',\n } = props;\n return html`\n <sp-coachmark\n open\n .modifierKeys=${modifierKeys}\n .content=${{\n title: heading,\n description: content,\n }}\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=\"2\"\n total-steps=\"8\"\n >\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const withShortCut = (): TemplateResult => {\n return html`\n <sp-coachmark\n open\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=\"2\"\n total-steps=\"8\"\n shortcut-key=\"Z\"\n .content=${{\n title: 'Coachmark Shortcut',\n description:\n 'This is a Coachmark with nothing but text in it. Kind of lonely in here',\n }}\n >\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,MAAM,WAAW;AAE1B,OAAO;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,IACN,WAAW,EAAE,QAAQ,UAAU;AAAA,IAC/B,aAAa,EAAE,QAAQ,YAAY;AAAA,EACvC;AACJ;AAwBO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASX;AAEO,aAAM,SAAS,CAClB,OACA,OAAkB,CAAC,MACF;AACjB,QAAM;AAAA,IACF,OAAO;AAAA,IACP,UAAU;AAAA,IACV,UAAU;AAAA,
|
|
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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport type { MediaType } from '../src/CoachmarkItem.js';\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport { cave, gif } from './images.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\n\nexport default {\n title: 'Coachmark',\n component: 'sp-coachmark',\n argTypes: {\n onPrimary: { action: 'primary' },\n onSecondary: { action: 'secondary' },\n },\n};\n\ntype StoryArgs = {\n onPrimary?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n};\n\ntype Properties = {\n open?: boolean;\n placement?: Placement;\n id?: string;\n heading?: string;\n shortcutKey?: string;\n modifierKeys?: string[];\n content?: string;\n src?: string;\n mediaType?: MediaType;\n imageAlt?: string;\n currentStep?: number;\n totalSteps?: number;\n primaryCTA?: string;\n secondaryCTA?: string;\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-coachmark open>\n <div id=\"heading\" slot=\"title\">Coachmark with Text Only</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n </sp-coachmark>\n `;\n};\n\nexport const InTour = (\n props: Properties,\n args: StoryArgs = {}\n): TemplateResult => {\n const {\n open = true,\n heading = 'Coachmark in Tour',\n content = 'This is a Coachmark with nothing but text in it.',\n currentStep = 2,\n totalSteps = 8,\n } = props;\n return html`\n <sp-coachmark\n ?open=${open}\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=${currentStep}\n total-steps=${totalSteps}\n .content=${{\n title: heading,\n description: content,\n }}\n @primary=${(event: Event & { target: HTMLElement }) => {\n event.target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n args.onPrimary?.(event);\n }}\n @secondary=${(event: Event & { target: HTMLElement }) => {\n event.target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n args.onSecondary?.(event);\n }}\n >\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const single = (): TemplateResult => {\n return html`\n <sp-coachmark open primary-cta=\"Ok\">\n <div slot=\"title\">A single coachmark</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n </sp-coachmark>\n `;\n};\n\nexport const TriggerOnClick = (props: Properties): TemplateResult => {\n const { open = true, currentStep = 1, totalSteps = 4 } = props;\n\n return html`\n <sp-coach-indicator id=\"trigger\"></sp-coach-indicator>\n <sp-overlay\n trigger=\"trigger@click\"\n placement=\"right\"\n .receivesFocus=${'false'}\n ?open=${open}\n >\n <sp-coachmark\n ?open=${open}\n current-step=${currentStep}\n total-steps=${totalSteps}\n primary-cta=\"\u6B21\"\n secondary-cta=\"\u524D\u306E\"\n >\n <div slot=\"title\">\u30AF\u30EA\u30C3\u30AF\u6642\u306E\u30B3\u30FC\u30C1\u30DE\u30FC\u30AF</div>\n <div slot=\"content\">\n \u3053\u308C\u306F\u30C6\u30AD\u30B9\u30C8\u3060\u3051\u304C\u5165\u3063\u305F\u30B3\u30FC\u30C1\u30DE\u30FC\u30AF\u3067\u3059\u3002\u3053\u3053\u306F\u306A\u3093\u3060\u304B\u5BC2\u3057\u3044\u3067\u3059\u306D\u3002\n </div>\n <div slot=\"step-count\">4 \u5206\u306E 1</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>\u30C4\u30A2\u30FC\u3092\u30B9\u30AD\u30C3\u30D7</sp-menu-item>\n <sp-menu-item>\u30C4\u30A2\u30FC\u518D\u958B</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n </sp-overlay>\n `;\n};\n\nexport const TriggerOnHover = (props: Properties): TemplateResult => {\n const { open = true, currentStep = 2, totalSteps = 8 } = props;\n\n return html`\n <sp-coach-indicator id=\"trigger\"></sp-coach-indicator>\n <sp-overlay\n trigger=\"trigger@hover\"\n placement=\"right\"\n .receivesFocus=${'false'}\n ?open=${open}\n >\n <sp-coachmark\n ?open=${open}\n current-step=${currentStep}\n total-steps=${totalSteps}\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n >\n <div slot=\"title\">Coachmark on hover</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of\n lonely in here.\n </div>\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n </sp-overlay>\n `;\n};\n\nexport const withImage = (props: Properties): TemplateResult => {\n const { open = true, currentStep = 2, totalSteps = 8 } = props;\n return html`\n <sp-coachmark\n ?open=${open}\n src=${cave}\n media-type=\"image\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=${currentStep}\n total-steps=${totalSteps}\n >\n <div slot=\"title\">Coachmark with Media</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const withGif = (props: Properties): TemplateResult => {\n const { open = true, currentStep = 2, totalSteps = 8 } = props;\n\n return html`\n <sp-coachmark\n ?open=${open}\n src=${gif}\n media-type=\"image\"\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=${currentStep}\n total-steps=${totalSteps}\n >\n <div slot=\"title\">Coachmark with GIF</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nwithGif.swc_vrt = {\n skip: true,\n};\n\nexport const withKeys = (props: Properties): TemplateResult => {\n const {\n modifierKeys = ['\u21E7 Shift', '\u2318'],\n heading = 'Coachmark with Keys',\n content = 'This is a Coachmark with nothing but text in it.',\n currentStep = 2,\n totalSteps = 8,\n } = props;\n return html`\n <sp-coachmark\n open\n .modifierKeys=${modifierKeys}\n .content=${{\n title: heading,\n description: content,\n }}\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=${currentStep}\n total-steps=${totalSteps}\n >\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip tour</sp-menu-item>\n <sp-menu-item>Restart tour</sp-menu-item>\n </sp-action-menu>\n </sp-coachmark>\n `;\n};\n\nexport const withShortCut = (props: Properties): TemplateResult => {\n const { currentStep = 2, totalSteps = 8 } = props;\n return html`\n <sp-coachmark\n open\n primary-cta=\"Next\"\n secondary-cta=\"Previous\"\n current-step=${currentStep}\n total-steps=${totalSteps}\n shortcut-key=\"Z\"\n .content=${{\n title: 'Coachmark Shortcut',\n description:\n 'This is a Coachmark with nothing but text in it. Kind of lonely in here',\n }}\n >\n <div slot=\"step-count\">${currentStep} of ${totalSteps}</div>\n <sp-action-menu\n placement=\"bottom-end\"\n quiet\n slot=\"actions\"\n label=\"More Actions\"\n >\n <sp-menu-item>Skip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
63
|
});
|
|
64
64
|
it("if in tour coachmark loads with pagination with previous, next buttons and action menu", async () => {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
const stepText = "2 of 8";
|
|
65
|
+
var _a, _b, _c;
|
|
67
66
|
const el = await fixture(
|
|
68
67
|
InTour(
|
|
69
68
|
{
|
|
@@ -80,21 +79,21 @@ describe("Coachmark", () => {
|
|
|
80
79
|
const stepCount = el.shadowRoot.querySelector(
|
|
81
80
|
'span[aria-live="polite"]'
|
|
82
81
|
);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"the slotted content renders in the element"
|
|
82
|
+
const stepCountSlot = el.querySelector(
|
|
83
|
+
'[slot="step-count"]'
|
|
86
84
|
);
|
|
85
|
+
expect((_a = stepCountSlot == null ? void 0 : stepCountSlot.textContent) == null ? void 0 : _a.trim()).to.equal("2 of 8");
|
|
87
86
|
expect(stepCount == null ? void 0 : stepCount.textContent);
|
|
88
87
|
const nextButton = el.shadowRoot.querySelector(
|
|
89
88
|
'sp-button[variant="primary"'
|
|
90
89
|
);
|
|
91
90
|
expect(nextButton).to.not.be.undefined;
|
|
92
|
-
expect((
|
|
91
|
+
expect((_b = nextButton == null ? void 0 : nextButton.textContent) == null ? void 0 : _b.trim()).to.equal("Next");
|
|
93
92
|
const prevButton = el.shadowRoot.querySelector(
|
|
94
93
|
'sp-button[variant="secondary"'
|
|
95
94
|
);
|
|
96
95
|
expect(prevButton).to.not.be.undefined;
|
|
97
|
-
expect((
|
|
96
|
+
expect((_c = prevButton == null ? void 0 : prevButton.textContent) == null ? void 0 : _c.trim()).to.equal("Previous");
|
|
98
97
|
});
|
|
99
98
|
it("loads pagination when total step count is greater than 1", async () => {
|
|
100
99
|
var _a;
|
|
@@ -103,16 +102,18 @@ describe("Coachmark", () => {
|
|
|
103
102
|
{
|
|
104
103
|
open: true,
|
|
105
104
|
heading: "Coachmark In Tour",
|
|
106
|
-
content: "This is a Coachmark with nothing but text in it."
|
|
105
|
+
content: "This is a Coachmark with nothing but text in it.",
|
|
106
|
+
currentStep: 2,
|
|
107
|
+
totalSteps: 8
|
|
107
108
|
},
|
|
108
109
|
{}
|
|
109
110
|
)
|
|
110
111
|
);
|
|
111
112
|
await elementUpdated(el);
|
|
112
|
-
const
|
|
113
|
-
'
|
|
113
|
+
const stepCountSlot = el.querySelector(
|
|
114
|
+
'[slot="step-count"]'
|
|
114
115
|
);
|
|
115
|
-
expect((_a =
|
|
116
|
+
expect((_a = stepCountSlot == null ? void 0 : stepCountSlot.textContent) == null ? void 0 : _a.trim()).to.equal("2 of 8");
|
|
116
117
|
await expect(el).to.be.accessible();
|
|
117
118
|
});
|
|
118
119
|
it('loads primary button with text "Ok" for a single coachmark', async () => {
|
|
@@ -145,7 +146,12 @@ describe("Coachmark", () => {
|
|
|
145
146
|
});
|
|
146
147
|
it("renders with shortcut", async () => {
|
|
147
148
|
var _a;
|
|
148
|
-
const el = await fixture(
|
|
149
|
+
const el = await fixture(
|
|
150
|
+
withShortCut({
|
|
151
|
+
currentStep: 1,
|
|
152
|
+
totalSteps: 8
|
|
153
|
+
})
|
|
154
|
+
);
|
|
149
155
|
await elementUpdated(el);
|
|
150
156
|
const shortcutKey = el.shadowRoot.querySelector(
|
|
151
157
|
'span[type="shortcut"]'
|
|
@@ -154,7 +160,12 @@ describe("Coachmark", () => {
|
|
|
154
160
|
expect((_a = shortcutKey == null ? void 0 : shortcutKey.textContent) == null ? void 0 : _a.trim()).to.include("Z");
|
|
155
161
|
});
|
|
156
162
|
it("renders content with image asset", async () => {
|
|
157
|
-
const el = await fixture(
|
|
163
|
+
const el = await fixture(
|
|
164
|
+
withImage({
|
|
165
|
+
currentStep: 1,
|
|
166
|
+
totalSteps: 8
|
|
167
|
+
})
|
|
168
|
+
);
|
|
158
169
|
await elementUpdated(el);
|
|
159
170
|
const imageElement = el.shadowRoot.querySelector(
|
|
160
171
|
'img[src="https://picsum.photos/id/237/200/300"'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["coachmark.test.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*/\n\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n} from '@open-wc/testing';\n\nimport { Coachmark, CoachmarkItem } from '@spectrum-web-components/coachmark';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { spy } from 'sinon';\nimport { Button } from '@spectrum-web-components/button';\nimport {\n Default,\n InTour,\n single,\n withImage,\n withKeys,\n withShortCut,\n} from '../stories/coachmark.stories.js';\n\nconst defaultItem: CoachmarkItem = {\n heading: 'I am the heading for Coachmark',\n content: 'I am the content for this Coachmark',\n};\ndescribe('Coachmark', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Coachmark>(\n html`\n <sp-coachmark\n id=\"coachmark\"\n .content=${{\n title: defaultItem.heading,\n description: defaultItem.content,\n }}\n ></sp-coachmark>\n `\n )\n );\n it('loads default coachmark accessibly', async () => {\n const el = await fixture<Coachmark>(Default());\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('displays the slotted content as `.title`', async () => {\n const testHeading = 'Coachmark with Text Only';\n const el = await fixture<Coachmark>(Default());\n\n await elementUpdated(el);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const headingSlot = root.querySelector(\n '[name=\"title\"]'\n ) as HTMLSlotElement;\n\n expect(headingSlot, 'did not find slot element').to.not.be.null;\n const nodes = headingSlot.assignedNodes();\n const divElement = nodes.find(\n (node) => (node as HTMLElement).id === 'heading'\n );\n expect(divElement, 'did not find div element').to.not.be.null;\n expect((divElement as HTMLDivElement).textContent).to.contain(\n testHeading,\n 'the slotted content renders in the element'\n );\n });\n it('if in tour coachmark loads with pagination with previous, next buttons and action menu', async () => {\n const
|
|
5
|
-
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,6BAA6B;AACtC,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,WAAW;AAEpB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,MAAM,cAA6B;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AACb;AACA,SAAS,aAAa,MAAM;AACxB;AAAA,IACI,YACI,MAAM;AAAA,MACF;AAAA;AAAA;AAAA,mCAGmB;AAAA,QACP,OAAO,YAAY;AAAA,QACnB,aAAa,YAAY;AAAA,MAC7B,CAAC;AAAA;AAAA;AAAA,IAGb;AAAA,EACR;AACA,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM,QAAmB,QAAQ,CAAC;AAC7C,UAAM,eAAe,EAAE;AACvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,4CAA4C,YAAY;AACvD,UAAM,cAAc;AACpB,UAAM,KAAK,MAAM,QAAmB,QAAQ,CAAC;AAE7C,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,GAAG,aAAa,GAAG,aAAa;AAC7C,UAAM,cAAc,KAAK;AAAA,MACrB;AAAA,IACJ;AAEA,WAAO,aAAa,2BAA2B,EAAE,GAAG,IAAI,GAAG;AAC3D,UAAM,QAAQ,YAAY,cAAc;AACxC,UAAM,aAAa,MAAM;AAAA,MACrB,CAAC,SAAU,KAAqB,OAAO;AAAA,IAC3C;AACA,WAAO,YAAY,0BAA0B,EAAE,GAAG,IAAI,GAAG;AACzD,WAAQ,WAA8B,WAAW,EAAE,GAAG;AAAA,MAClD;AAAA,MACA;AAAA,IACJ;AAAA,EACJ,CAAC;AACD,KAAG,0FAA0F,YAAY;AAlF7G;AAmFQ,UAAM,
|
|
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*/\n\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n} from '@open-wc/testing';\n\nimport { Coachmark, CoachmarkItem } from '@spectrum-web-components/coachmark';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { spy } from 'sinon';\nimport { Button } from '@spectrum-web-components/button';\nimport {\n Default,\n InTour,\n single,\n withImage,\n withKeys,\n withShortCut,\n} from '../stories/coachmark.stories.js';\n\nconst defaultItem: CoachmarkItem = {\n heading: 'I am the heading for Coachmark',\n content: 'I am the content for this Coachmark',\n};\ndescribe('Coachmark', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Coachmark>(\n html`\n <sp-coachmark\n id=\"coachmark\"\n .content=${{\n title: defaultItem.heading,\n description: defaultItem.content,\n }}\n ></sp-coachmark>\n `\n )\n );\n it('loads default coachmark accessibly', async () => {\n const el = await fixture<Coachmark>(Default());\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('displays the slotted content as `.title`', async () => {\n const testHeading = 'Coachmark with Text Only';\n const el = await fixture<Coachmark>(Default());\n\n await elementUpdated(el);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const headingSlot = root.querySelector(\n '[name=\"title\"]'\n ) as HTMLSlotElement;\n\n expect(headingSlot, 'did not find slot element').to.not.be.null;\n const nodes = headingSlot.assignedNodes();\n const divElement = nodes.find(\n (node) => (node as HTMLElement).id === 'heading'\n );\n expect(divElement, 'did not find div element').to.not.be.null;\n expect((divElement as HTMLDivElement).textContent).to.contain(\n testHeading,\n 'the slotted content renders in the element'\n );\n });\n it('if in tour coachmark loads with pagination with previous, next buttons and action menu', async () => {\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark In Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n },\n {}\n )\n );\n await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n const stepCount = el.shadowRoot.querySelector(\n 'span[aria-live=\"polite\"]'\n );\n\n const stepCountSlot = el.querySelector(\n '[slot=\"step-count\"]'\n ) as HTMLSlotElement;\n expect(stepCountSlot?.textContent?.trim()).to.equal('2 of 8');\n\n expect(stepCount?.textContent);\n const nextButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"primary\"'\n );\n expect(nextButton).to.not.be.undefined;\n expect(nextButton?.textContent?.trim()).to.equal('Next');\n\n const prevButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"secondary\"'\n );\n expect(prevButton).to.not.be.undefined;\n expect(prevButton?.textContent?.trim()).to.equal('Previous');\n });\n it('loads pagination when total step count is greater than 1', async () => {\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark In Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n currentStep: 2,\n totalSteps: 8,\n },\n {}\n )\n );\n await elementUpdated(el);\n const stepCountSlot = el.querySelector(\n '[slot=\"step-count\"]'\n ) as HTMLSlotElement;\n expect(stepCountSlot?.textContent?.trim()).to.equal('2 of 8');\n\n await expect(el).to.be.accessible();\n });\n it('loads primary button with text \"Ok\" for a single coachmark', async () => {\n const el = await fixture<Coachmark>(single());\n\n await elementUpdated(el);\n const okayButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"primary\"'\n );\n expect(okayButton).to.not.be.null;\n expect(okayButton?.textContent?.trim()).to.equal('Ok');\n });\n it('renders modifier keys with joiner', async () => {\n const modifierKeys = ['\u21E7 Shift', '\u2318'];\n const el = await fixture<Coachmark>(\n withKeys({\n modifierKeys,\n heading: 'Coachmark with Keys',\n content: 'This is a Coachmark with nothing but text in it.',\n })\n );\n await elementUpdated(el);\n const modifier = el.shadowRoot.querySelector('span[type=\"modifier\"]');\n expect(modifier).to.not.be.undefined;\n expect(modifier?.textContent?.trim()).to.include('\u21E7 Shift');\n const joiner = el.shadowRoot.querySelector('span[class=\"plus\"]');\n expect(joiner).to.not.be.undefined;\n expect(joiner?.textContent?.trim()).to.include('+');\n });\n it('renders with shortcut', async () => {\n const el = await fixture<Coachmark>(\n withShortCut({\n currentStep: 1,\n totalSteps: 8,\n })\n );\n await elementUpdated(el);\n\n const shortcutKey = el.shadowRoot.querySelector(\n 'span[type=\"shortcut\"]'\n );\n expect(shortcutKey).to.not.be.undefined;\n expect(shortcutKey?.textContent?.trim()).to.include('Z');\n });\n it('renders content with image asset', async () => {\n const el = await fixture<Coachmark>(\n withImage({\n currentStep: 1,\n totalSteps: 8,\n })\n );\n await elementUpdated(el);\n const imageElement = el.shadowRoot.querySelector(\n 'img[src=\"https://picsum.photos/id/237/200/300\"'\n );\n expect(imageElement).not.to.be.undefined;\n });\n it('in tour dispatches `primary` and `secondary`', async () => {\n const primarySpy = spy();\n const secondarySpy = spy();\n const handlePrimary = (): void => primarySpy();\n const handleSecondary = (): void => secondarySpy();\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark in Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n },\n {}\n )\n );\n el.addEventListener('primary', handlePrimary);\n el.addEventListener('secondary', handleSecondary);\n\n await elementUpdated(el);\n expect(primarySpy.called).to.be.false;\n expect(secondarySpy.called).to.be.false;\n\n const primaryButton = el.shadowRoot.querySelector(\n '[variant=\"primary\"]'\n ) as Button;\n const secondaryButton = el.shadowRoot.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n primaryButton.click();\n\n await elementUpdated(el);\n expect(primarySpy.called, 'dispatched `primary`').to.be.true;\n expect(secondarySpy.called).to.be.false;\n\n secondaryButton.click();\n\n await elementUpdated(el);\n expect(primarySpy.callCount).to.equal(1);\n expect(secondarySpy.called, 'dispatched `secondary`').to.be.true;\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,6BAA6B;AACtC,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,WAAW;AAEpB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,MAAM,cAA6B;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AACb;AACA,SAAS,aAAa,MAAM;AACxB;AAAA,IACI,YACI,MAAM;AAAA,MACF;AAAA;AAAA;AAAA,mCAGmB;AAAA,QACP,OAAO,YAAY;AAAA,QACnB,aAAa,YAAY;AAAA,MAC7B,CAAC;AAAA;AAAA;AAAA,IAGb;AAAA,EACR;AACA,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM,QAAmB,QAAQ,CAAC;AAC7C,UAAM,eAAe,EAAE;AACvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,4CAA4C,YAAY;AACvD,UAAM,cAAc;AACpB,UAAM,KAAK,MAAM,QAAmB,QAAQ,CAAC;AAE7C,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,GAAG,aAAa,GAAG,aAAa;AAC7C,UAAM,cAAc,KAAK;AAAA,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