@automattic/launchpad 1.2.2 → 1.2.4
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/CHANGELOG.md +9 -1
- package/dist/cjs/action-components/share-site-modal/index.js +3 -5
- package/dist/cjs/action-components/share-site-modal/index.js.map +1 -1
- package/dist/cjs/action-components/share-site-modal/style.scss +0 -19
- package/dist/cjs/checklist-item/index.js +4 -4
- package/dist/cjs/checklist-item/index.js.map +1 -1
- package/dist/cjs/setup-actions.js +9 -7
- package/dist/cjs/setup-actions.js.map +1 -1
- package/dist/esm/action-components/share-site-modal/index.js +3 -5
- package/dist/esm/action-components/share-site-modal/index.js.map +1 -1
- package/dist/esm/action-components/share-site-modal/style.scss +0 -19
- package/dist/esm/checklist-item/index.js +2 -2
- package/dist/esm/checklist-item/index.js.map +1 -1
- package/dist/esm/setup-actions.js +9 -7
- package/dist/esm/setup-actions.js.map +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/action-components/share-site-modal/index.d.ts +1 -1
- package/dist/types/action-components/share-site-modal/index.d.ts.map +1 -1
- package/dist/types/checklist/index.d.ts +1 -1
- package/dist/types/checklist/index.d.ts.map +1 -1
- package/dist/types/checklist-item/index.d.ts.map +1 -1
- package/dist/types/launchpad.d.ts +1 -1
- package/dist/types/launchpad.d.ts.map +1 -1
- package/dist/types/setup-actions.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +20 -23
- package/src/action-components/share-site-modal/index.tsx +2 -13
- package/src/action-components/share-site-modal/style.scss +0 -19
- package/src/checklist-item/index.tsx +6 -2
- package/src/setup-actions.ts +9 -7
- package/src/style-imports.d.ts +3 -0
- package/src/test/setup-actions.ts +44 -0
- package/src/types.ts +1 -1
|
@@ -6,6 +6,6 @@ interface ShareSiteModalProps {
|
|
|
6
6
|
site: SiteDetails | null;
|
|
7
7
|
task: Task | null;
|
|
8
8
|
}
|
|
9
|
-
declare const ShareSiteModal: ({ setModalIsOpen, site, task }: ShareSiteModalProps) => import("react
|
|
9
|
+
declare const ShareSiteModal: ({ setModalIsOpen, site, task }: ShareSiteModalProps) => import("react").JSX.Element;
|
|
10
10
|
export default ShareSiteModal;
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action-components/share-site-modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action-components/share-site-modal/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,cAAc,CAAC;AAEtB,UAAU,mBAAmB;IAC5B,cAAc,EAAE,CAAE,MAAM,EAAE,OAAO,KAAM,IAAI,CAAC;IAC5C,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAClB;AAkHD,QAAA,MAAM,cAAc,GAAK,gCAAgC,mBAAmB,gCAoH3E,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -7,6 +7,6 @@ interface Props {
|
|
|
7
7
|
children?: ReactElement<ComponentProps<typeof ChecklistItem>> | ReactElement<ComponentProps<typeof ChecklistItem>>[];
|
|
8
8
|
}
|
|
9
9
|
declare const Checklist: FC<Props>;
|
|
10
|
-
export declare const Placeholder: () => import("react
|
|
10
|
+
export declare const Placeholder: () => import("react").JSX.Element;
|
|
11
11
|
export default Checklist;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checklist/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,aAA0D,MAAM,mBAAmB,CAAC;AAC3F,OAAO,cAAc,CAAC;AAEtB,UAAU,KAAK;IACd,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EACN,YAAY,CAAE,cAAc,CAAE,OAAO,aAAa,CAAE,CAAE,GACtD,YAAY,CAAE,cAAc,CAAE,OAAO,aAAa,CAAE,CAAE,EAAE,CAAC;CAC5D;AAED,QAAA,MAAM,SAAS,EAAE,EAAE,CAAE,KAAK,CA6BzB,CAAC;AAEF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checklist/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,aAA0D,MAAM,mBAAmB,CAAC;AAC3F,OAAO,cAAc,CAAC;AAEtB,UAAU,KAAK;IACd,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EACN,YAAY,CAAE,cAAc,CAAE,OAAO,aAAa,CAAE,CAAE,GACtD,YAAY,CAAE,cAAc,CAAE,OAAO,aAAa,CAAE,CAAE,EAAE,CAAC;CAC5D;AAED,QAAA,MAAM,SAAS,EAAE,EAAE,CAAE,KAAK,CA6BzB,CAAC;AAEF,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checklist-item/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,cAAc,CAAC;AAEtB,UAAU,KAAK;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checklist-item/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,cAAc,CAAC;AAEtB,UAAU,KAAK;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAE,KAAK,CAkJ7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAQzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -9,6 +9,6 @@ type LaunchpadProps = {
|
|
|
9
9
|
onPostFilterTasks?: (tasks: Task[]) => Task[];
|
|
10
10
|
highlightNextAction?: boolean;
|
|
11
11
|
};
|
|
12
|
-
declare const Launchpad: ({ siteSlug, checklistSlug, launchpadContext, onSiteLaunched, onTaskClick, onPostFilterTasks, highlightNextAction, }: LaunchpadProps) => import("react
|
|
12
|
+
declare const Launchpad: ({ siteSlug, checklistSlug, launchpadContext, onSiteLaunched, onTaskClick, onPostFilterTasks, highlightNextAction, }: LaunchpadProps) => import("react").JSX.Element | null;
|
|
13
13
|
export default Launchpad;
|
|
14
14
|
//# sourceMappingURL=launchpad.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchpad.d.ts","sourceRoot":"","sources":["../../src/launchpad.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,UAAU,mBAAwD,CAAC;AAEhF,KAAK,cAAc,GAAG;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,aAAa,CAAE,aAAa,CAAE,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,EAAE,CAAC;IAChD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,SAAS,GAAK,qHAQjB,cAAc,
|
|
1
|
+
{"version":3,"file":"launchpad.d.ts","sourceRoot":"","sources":["../../src/launchpad.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,UAAU,mBAAwD,CAAC;AAEhF,KAAK,cAAc,GAAG;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,aAAa,CAAE,aAAa,CAAE,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,EAAE,CAAC;IAChD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,SAAS,GAAK,qHAQjB,cAAc,uCAkEhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-actions.d.ts","sourceRoot":"","sources":["../../src/setup-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-actions.d.ts","sourceRoot":"","sources":["../../src/setup-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAe/D,eAAO,MAAM,oBAAoB,GAAK,0EAOnC,yBAAyB,KAAI,IAAI,EA0JnC,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,EAAE,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACpF,iBAAiB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACrC,CAAE,MAAM,EAAE,MAAM,GAAI,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAChC,uBAAuB,CAAC,EAAE,CAAE,MAAM,EAAE,OAAO,KAAM,IAAI,CAAC;CACtD;AAED,MAAM,MAAM,aAAa,GAAG;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,GAAG,OAAO,CAAC;CAC/C,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;IAChC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/launchpad",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Launchpad components.",
|
|
5
5
|
"homepage": "https://github.com/Automattic/wp-calypso",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -39,43 +39,40 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@automattic/calypso-analytics": "^1.1.5",
|
|
42
|
-
"@automattic/
|
|
43
|
-
"@automattic/
|
|
44
|
-
"@automattic/data-stores": "^3.2.0",
|
|
45
|
-
"@automattic/i18n-utils": "^1.2.3",
|
|
42
|
+
"@automattic/data-stores": "^3.2.2",
|
|
43
|
+
"@automattic/i18n-utils": "^1.3.0",
|
|
46
44
|
"@automattic/typography": "^1.0.0",
|
|
47
|
-
"@automattic/viewport": "^1.1.
|
|
45
|
+
"@automattic/viewport": "^1.1.1",
|
|
48
46
|
"@tanstack/react-query": "^5.83.0",
|
|
49
|
-
"@wordpress/base-styles": "^
|
|
50
|
-
"@wordpress/components": "^
|
|
51
|
-
"@wordpress/icons": "^
|
|
52
|
-
"@wordpress/
|
|
47
|
+
"@wordpress/base-styles": "^9.1.0",
|
|
48
|
+
"@wordpress/components": "^35.0.0",
|
|
49
|
+
"@wordpress/icons": "^13.3.0",
|
|
50
|
+
"@wordpress/ui": "^0.17.0",
|
|
53
51
|
"clsx": "^2.1.1",
|
|
54
52
|
"social-logos": "^3.1.18",
|
|
55
53
|
"tslib": "^2.8.1",
|
|
56
|
-
"utility-types": "^3.10.0",
|
|
57
54
|
"wpcom-proxy-request": "^7.0.7"
|
|
58
55
|
},
|
|
59
56
|
"devDependencies": {
|
|
60
|
-
"@automattic/calypso-build": "^
|
|
61
|
-
"@automattic/calypso-storybook": "^1.0.
|
|
57
|
+
"@automattic/calypso-build": "^11.0.0",
|
|
58
|
+
"@automattic/calypso-storybook": "^1.0.1",
|
|
62
59
|
"@automattic/calypso-typescript-config": "^1.0.0",
|
|
63
|
-
"@storybook/addon-a11y": "^
|
|
60
|
+
"@storybook/addon-a11y": "^9.1.20",
|
|
64
61
|
"msw": "^2.1.7",
|
|
65
|
-
"msw-storybook-addon": "2.0.
|
|
66
|
-
"postcss": "^8.5.
|
|
62
|
+
"msw-storybook-addon": "2.0.7",
|
|
63
|
+
"postcss": "^8.5.15",
|
|
67
64
|
"react": "^18.3.1",
|
|
68
65
|
"react-dom": "^18.3.1",
|
|
69
|
-
"storybook": "^
|
|
70
|
-
"typescript": "^
|
|
66
|
+
"storybook": "^9.1.20",
|
|
67
|
+
"typescript": "^6.0.3",
|
|
71
68
|
"webpack": "^5.99.8"
|
|
72
69
|
},
|
|
73
70
|
"peerDependencies": {
|
|
74
|
-
"@wordpress/data": "^10.
|
|
75
|
-
"@wordpress/element": "^
|
|
76
|
-
"@wordpress/i18n": "^
|
|
71
|
+
"@wordpress/data": "^10.48.0",
|
|
72
|
+
"@wordpress/element": "^8.0.0",
|
|
73
|
+
"@wordpress/i18n": "^6.21.0",
|
|
77
74
|
"debug": "^4.4.1",
|
|
78
|
-
"react": "^18.3.1",
|
|
79
|
-
"react-dom": "^18.3.1"
|
|
75
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
76
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
80
77
|
}
|
|
81
78
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { recordTracksEvent } from '@automattic/calypso-analytics';
|
|
2
|
-
import { Popover } from '@automattic/components';
|
|
3
2
|
import { updateLaunchpadSettings } from '@automattic/data-stores';
|
|
4
3
|
import { useQueryClient } from '@tanstack/react-query';
|
|
5
4
|
import {
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
12
11
|
} from '@wordpress/components';
|
|
13
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
14
13
|
import { copy, share, check } from '@wordpress/icons';
|
|
15
|
-
import { useState,
|
|
14
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
16
15
|
import { SocialLogo } from 'social-logos';
|
|
17
16
|
import type { Task } from '../../types';
|
|
18
17
|
import type { SiteDetails } from '@automattic/data-stores';
|
|
@@ -127,7 +126,7 @@ const getShareData = ( site: SiteDetails | null ) => {
|
|
|
127
126
|
return {
|
|
128
127
|
title: siteSlug,
|
|
129
128
|
text: sprintf(
|
|
130
|
-
/* translators: siteSlug is the short form of the site URL with the https:// */
|
|
129
|
+
/* translators: %(siteSlug)s is the short form of the site URL with the https:// */
|
|
131
130
|
__( 'Please visit my site: %(siteSlug)s', 'launchpad' ),
|
|
132
131
|
{
|
|
133
132
|
siteSlug,
|
|
@@ -158,7 +157,6 @@ const ShareSiteModal = ( { setModalIsOpen, site, task }: ShareSiteModalProps ) =
|
|
|
158
157
|
);
|
|
159
158
|
|
|
160
159
|
const [ clipboardCopied, setClipboardCopied ] = useState( false );
|
|
161
|
-
const clipboardTextEl = useRef( null );
|
|
162
160
|
const copyHandler = () => {
|
|
163
161
|
navigator.clipboard.writeText( shareData.url );
|
|
164
162
|
setClipboardCopied( true );
|
|
@@ -204,20 +202,11 @@ const ShareSiteModal = ( { setModalIsOpen, site, task }: ShareSiteModalProps ) =
|
|
|
204
202
|
>
|
|
205
203
|
<VStack className="share-site-modal__modal-content" spacing={ 4 }>
|
|
206
204
|
<VStack className="share-site-modal__modal-actions" spacing={ 4 }>
|
|
207
|
-
<Popover
|
|
208
|
-
className="share-site-modal__popover"
|
|
209
|
-
isVisible={ clipboardCopied }
|
|
210
|
-
context={ clipboardTextEl.current }
|
|
211
|
-
position="top"
|
|
212
|
-
>
|
|
213
|
-
{ __( 'Copied to clipboard!', 'launchpad' ) }
|
|
214
|
-
</Popover>
|
|
215
205
|
<InputControl
|
|
216
206
|
className="share-site-modal__modal-input-container"
|
|
217
207
|
__next40pxDefaultSize
|
|
218
208
|
value={ shareData.title }
|
|
219
209
|
label={ __( 'Site URL', 'launchpad' ) }
|
|
220
|
-
ref={ clipboardTextEl }
|
|
221
210
|
readOnly
|
|
222
211
|
hideLabelFromVision
|
|
223
212
|
suffix={
|
|
@@ -45,22 +45,3 @@
|
|
|
45
45
|
text-decoration: underline;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
.share-site-modal__popover {
|
|
50
|
-
outline: none;
|
|
51
|
-
z-index: 100000;
|
|
52
|
-
.popover__inner {
|
|
53
|
-
border: 0;
|
|
54
|
-
box-shadow: none;
|
|
55
|
-
border-radius: 2px;
|
|
56
|
-
color: var(--color-text-inverted);
|
|
57
|
-
background: var(--color-neutral-60);
|
|
58
|
-
font-size: $font-body-extra-small;
|
|
59
|
-
padding: 6px 10px;
|
|
60
|
-
text-align: left;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.popover__arrow {
|
|
64
|
-
display: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Badge } from '@automattic/components';
|
|
2
1
|
import { Button, Icon } from '@wordpress/components';
|
|
3
2
|
import { __, isRTL, sprintf } from '@wordpress/i18n';
|
|
4
3
|
import { check, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
4
|
+
import { Badge } from '@wordpress/ui';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import type { Task, Expandable } from '../types';
|
|
7
7
|
import type { FC, Key } from 'react';
|
|
@@ -137,7 +137,11 @@ const ChecklistItem: FC< Props > = ( {
|
|
|
137
137
|
<span className="screen-reader-text">{ getStatusText() }</span>
|
|
138
138
|
<span aria-hidden="true">{ title }</span>
|
|
139
139
|
</span>
|
|
140
|
-
{ task.badge_text ?
|
|
140
|
+
{ task.badge_text ? (
|
|
141
|
+
<Badge className="badge" intent="informational">
|
|
142
|
+
{ String( task.badge_text ) }
|
|
143
|
+
</Badge>
|
|
144
|
+
) : null }
|
|
141
145
|
{ shouldDisplayTaskCounter && (
|
|
142
146
|
<span className="checklist-item__counter">
|
|
143
147
|
{ task.repetition_count }/{ task.target_repetitions }
|
package/src/setup-actions.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import config from '@automattic/calypso-config';
|
|
2
1
|
import { updateLaunchpadSettings } from '@automattic/data-stores';
|
|
3
2
|
import { localizeUrl } from '@automattic/i18n-utils';
|
|
4
3
|
import { isMobile } from '@automattic/viewport';
|
|
5
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
6
4
|
import wpcomRequest from 'wpcom-proxy-request';
|
|
7
5
|
import type { LaunchpadTaskActionsProps, Task } from './types';
|
|
8
6
|
|
|
@@ -39,8 +37,14 @@ export const setUpActionsForTasks = ( {
|
|
|
39
37
|
const hasCalypsoPath = task.calypso_path !== undefined;
|
|
40
38
|
|
|
41
39
|
if ( uiContext === 'calypso' && hasCalypsoPath ) {
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const { calypso_path } = task;
|
|
41
|
+
if ( task.id === 'drive_traffic' && ! isMobile() && calypso_path !== undefined ) {
|
|
42
|
+
// Merge the query via a throwaway base, but keep the original string as the base so
|
|
43
|
+
// absolute origins survive, then re-append any fragment.
|
|
44
|
+
const params = new URL( calypso_path, 'http://example.com' ).searchParams;
|
|
45
|
+
params.set( 'tour', 'marketingConnectionsTour' );
|
|
46
|
+
const [ baseAndQuery, fragment = '' ] = calypso_path.split( /(#.*)/s );
|
|
47
|
+
task.calypso_path = `${ baseAndQuery.split( '?' )[ 0 ] }?${ params }${ fragment }`;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
// Enable task in 'calypso' context
|
|
@@ -100,9 +104,7 @@ export const setUpActionsForTasks = ( {
|
|
|
100
104
|
|
|
101
105
|
case 'customize_welcome_message':
|
|
102
106
|
logMissingCalypsoPath = true;
|
|
103
|
-
task.calypso_path =
|
|
104
|
-
? `/settings/newsletter/${ siteSlug }#messages`
|
|
105
|
-
: `/settings/reading/${ siteSlug }#newsletter-settings`;
|
|
107
|
+
task.calypso_path = `https://${ siteSlug }/wp-admin/admin.php?page=jetpack-newsletter`;
|
|
106
108
|
break;
|
|
107
109
|
|
|
108
110
|
case 'manage_subscribers':
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { setUpActionsForTasks } from '../setup-actions';
|
|
5
|
+
import type { LaunchpadTaskActionsProps } from '../types';
|
|
6
|
+
|
|
7
|
+
jest.mock( '@automattic/viewport', () => ( { isMobile: jest.fn( () => false ) } ) );
|
|
8
|
+
jest.mock( '@automattic/data-stores', () => ( { updateLaunchpadSettings: jest.fn() } ) );
|
|
9
|
+
|
|
10
|
+
const runDriveTraffic = ( calypso_path: string ) => {
|
|
11
|
+
const props: LaunchpadTaskActionsProps = {
|
|
12
|
+
siteSlug: 'example.wordpress.com',
|
|
13
|
+
tasks: [ { id: 'drive_traffic', completed: false, disabled: false, calypso_path } ],
|
|
14
|
+
tracksData: {
|
|
15
|
+
checklistSlug: 'test',
|
|
16
|
+
launchpadContext: 'test',
|
|
17
|
+
recordTracksEvent: jest.fn(),
|
|
18
|
+
tasklistCompleted: false,
|
|
19
|
+
},
|
|
20
|
+
extraActions: {},
|
|
21
|
+
uiContext: 'calypso',
|
|
22
|
+
};
|
|
23
|
+
return setUpActionsForTasks( props )[ 0 ].calypso_path;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe( 'setUpActionsForTasks: drive_traffic tour query arg', () => {
|
|
27
|
+
it( 'appends the tour arg to a relative path', () => {
|
|
28
|
+
expect( runDriveTraffic( '/marketing/connections/example.wordpress.com' ) ).toBe(
|
|
29
|
+
'/marketing/connections/example.wordpress.com?tour=marketingConnectionsTour'
|
|
30
|
+
);
|
|
31
|
+
} );
|
|
32
|
+
|
|
33
|
+
it( 'preserves the origin and existing query of an absolute URL', () => {
|
|
34
|
+
expect( runDriveTraffic( 'https://example.com/wp-admin/admin.php?page=jetpack-social' ) ).toBe(
|
|
35
|
+
'https://example.com/wp-admin/admin.php?page=jetpack-social&tour=marketingConnectionsTour'
|
|
36
|
+
);
|
|
37
|
+
} );
|
|
38
|
+
|
|
39
|
+
it( 'keeps the fragment after the query', () => {
|
|
40
|
+
expect( runDriveTraffic( '/marketing/connections/example.wordpress.com#section' ) ).toBe(
|
|
41
|
+
'/marketing/connections/example.wordpress.com?tour=marketingConnectionsTour#section'
|
|
42
|
+
);
|
|
43
|
+
} );
|
|
44
|
+
} );
|
package/src/types.ts
CHANGED