@designcrowd/library.brand-page 6.2.7 → 6.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-vzF6Ikn9.js → CreatedOnBrandCrowd-de-de-Bi71mUjJ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-cXu20Wxb.js → CreatedOnBrandCrowd-en-us-C2kl91cc.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-PSfMEmIN.js → CreatedOnBrandCrowd-es-es-CNK-VpMH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CKSJaTW0.js → CreatedOnBrandCrowd-fr-ca-B_WTCv5k.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CKSJaTW0.js → CreatedOnBrandCrowd-fr-fr-B_WTCv5k.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-28G2T3DJ.js → CreatedOnBrandCrowd-pt-br-Dk-k5-Nh.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-28G2T3DJ.js → CreatedOnBrandCrowd-pt-pt-Dk-k5-Nh.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CG2vQgBe.js → CreatedOnDcom-de-de-BVaJyfAR.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DzPaDxZd.js → CreatedOnDcom-en-us-DVzzynRf.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BmN7lNDe.js → CreatedOnDcom-es-es-BS2u-QHG.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BarL0nmZ.js → CreatedOnDcom-fr-ca-BavFpbyC.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-e5Bk-c84.js → CreatedOnDcom-fr-fr-DRchqDHL.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-89-1jjm5.js → CreatedOnDcom-pt-br-N7XAWRj_.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B9v9kExe.js → CreatedOnDcom-pt-pt-Bct14us6.js} +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +14 -7
- package/lib/src/css/library.brand-page-brandPage.min.css +15 -7
- package/lib/src/css/library.brand-page-designCom.min.css +14 -7
- package/lib/src/css/library.brand-page-preview.min.css +14 -7
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BTgw6Jw7.js → lib-BE9sCFvu.js} +9089 -9041
- package/package.json +4 -3
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.test.ts +31 -0
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.vue +1 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.navigation-slot.test.ts +58 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +5 -1
- package/src/brand-page-maker/components/navigation/Navigation.vue +6 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designcrowd/library.brand-page",
|
|
3
3
|
"description": "A collection of Maker/Designer applications",
|
|
4
|
-
"version": "6.2.
|
|
4
|
+
"version": "6.2.8",
|
|
5
5
|
"author": "Design.com Eng",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"dev": "export NODE_TLS_REJECT_UNAUTHORIZED=0 && nuxt dev nuxtapp",
|
|
31
31
|
"dev:dcom": "export tailwindTheme=designCom && nuxt dev nuxtapp",
|
|
32
|
-
"docker:publish": "docker build -t bp-maker:latest . --file ./build/Dockerfile.brand-page-lib-publish --
|
|
32
|
+
"docker:publish": "DOCKER_BUILDKIT=1 docker build -t bp-maker:latest . --file ./build/Dockerfile.brand-page-lib-publish --no-cache --secret id=npm,env=NPM_TOKEN --secret id=codeartifact,env=CODEARTIFACT_AUTH_TOKEN",
|
|
33
33
|
"lint": "eslint . && tsc --project tsconfig.lint.json --noEmit",
|
|
34
34
|
"lint:fix": "eslint --fix .",
|
|
35
35
|
"build:bp": "npm run clean:vite && npm run clean:lib && NODE_ENV=production npm run build:bp:vite && npm run build:bp:typings && npm run copy:css",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"clean:vite": "rimraf ./node_modules/.cache",
|
|
48
48
|
"copy:css": "copyfiles -fF ./public/css/global.css ./public/css/reset.css ./lib/src/css/",
|
|
49
49
|
"test": "vitest run",
|
|
50
|
+
"test:publish-dual-registry": "bash ./build/publish-dual-registry.test.sh",
|
|
50
51
|
"test:watch": "vitest watch",
|
|
51
52
|
"coverage": "echo \"To be migrated to vitest\"",
|
|
52
53
|
"storybook": "npm run clean:vite && npm run storybook:css && npm run storybook:themes && npm run storybook:start",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"@ckpack/vue-color": "1.6.0",
|
|
66
|
-
"@designcrowd/fe-shared-lib": "2.1.
|
|
67
|
+
"@designcrowd/fe-shared-lib": "2.1.3",
|
|
67
68
|
"@pinia/nuxt": "0.11.3",
|
|
68
69
|
"@storybook/react": "9.0.4",
|
|
69
70
|
"@tiptap/extension-bubble-menu": "3.28.0",
|
|
@@ -52,3 +52,34 @@ describe('ActionBarNavigation — Preview button', () => {
|
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
describe('ActionBarNavigation — navigationActionsStart slot', () => {
|
|
57
|
+
beforeEach(() => {
|
|
58
|
+
setActivePinia(createPinia());
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('renders host content ahead of Preview', () => {
|
|
62
|
+
const wrapper = shallowMount(ActionBarNavigation, {
|
|
63
|
+
slots: { navigationActionsStart: '<span data-test-host-action />' },
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const [first, second] = wrapper.element.children;
|
|
67
|
+
|
|
68
|
+
expect(first.hasAttribute('data-test-host-action')).toBe(true);
|
|
69
|
+
expect(second.hasAttribute('data-test-preview-button')).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// The row is a flex row with gaps, so an extra element — even an empty one — would
|
|
73
|
+
// shift every button for hosts that don't use the slot.
|
|
74
|
+
test('adds nothing to the row when the host leaves it empty', () => {
|
|
75
|
+
const wrapper = mountBar();
|
|
76
|
+
const buttons = wrapper.findAllComponents({ name: 'Button' });
|
|
77
|
+
|
|
78
|
+
expect(wrapper.element.children).toHaveLength(buttons.length);
|
|
79
|
+
expect(
|
|
80
|
+
wrapper.element.firstElementChild?.hasAttribute(
|
|
81
|
+
'data-test-preview-button',
|
|
82
|
+
),
|
|
83
|
+
).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
data-component="action-bar-navigation"
|
|
4
4
|
class="tw-flex tw-items-center tw-border-t tw-border-solid tw-border-grayscale-600 tw-h-12 tw-px-2 lg:tw-px-0 lg:tw-h-auto lg:tw-border-none tw-gap-3 lg:tw-gap-5 tw-w-full lg:tw-justify-end tw-box-border"
|
|
5
5
|
>
|
|
6
|
+
<slot name="navigationActionsStart" />
|
|
6
7
|
<Button
|
|
7
8
|
v-if="!isAdminMaker"
|
|
8
9
|
:label="constantsTr('previewDisplayName')"
|
package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.navigation-slot.test.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, test, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { createPinia, setActivePinia } from 'pinia';
|
|
3
|
+
import { shallowMount } from '@vue/test-utils';
|
|
4
|
+
import BrandPageMaker from './BrandPageMaker.vue';
|
|
5
|
+
import BrandPageMakerMixin from './BrandPageMaker.mixin';
|
|
6
|
+
|
|
7
|
+
// The mixin's lifecycle boots the whole editor, which the header's slot plumbing doesn't
|
|
8
|
+
// need; without it the real header templates mount on their own.
|
|
9
|
+
const HeaderOnlyBrandPageMaker = {
|
|
10
|
+
...BrandPageMaker,
|
|
11
|
+
mixins: [
|
|
12
|
+
{
|
|
13
|
+
...BrandPageMakerMixin,
|
|
14
|
+
created: undefined,
|
|
15
|
+
mounted: undefined,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const mountMaker = (slots: Record<string, string> = {}) =>
|
|
21
|
+
shallowMount(HeaderOnlyBrandPageMaker, {
|
|
22
|
+
props: { viewModel: {} },
|
|
23
|
+
slots,
|
|
24
|
+
global: {
|
|
25
|
+
stubs: { MakerNavigation: false, ActionBarNavigation: false },
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const actionRow = (wrapper: ReturnType<typeof mountMaker>): Element =>
|
|
30
|
+
wrapper.get('[data-component="action-bar-navigation"]').element;
|
|
31
|
+
|
|
32
|
+
describe('BrandPageMaker — navigationActionsStart slot', () => {
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
setActivePinia(createPinia());
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('forwards host content into the header action row, ahead of Preview', () => {
|
|
38
|
+
const wrapper = mountMaker({
|
|
39
|
+
navigationActionsStart: '<span data-test-host-action />',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const [first, second] = actionRow(wrapper).children;
|
|
43
|
+
|
|
44
|
+
expect(first.hasAttribute('data-test-host-action')).toBe(true);
|
|
45
|
+
expect(second.hasAttribute('data-test-preview-button')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('leaves the action row untouched when the host provides nothing', () => {
|
|
49
|
+
const wrapper = mountMaker();
|
|
50
|
+
|
|
51
|
+
expect(wrapper.find('[data-test-host-action]').exists()).toBe(false);
|
|
52
|
+
expect(
|
|
53
|
+
actionRow(wrapper).firstElementChild?.hasAttribute(
|
|
54
|
+
'data-test-preview-button',
|
|
55
|
+
),
|
|
56
|
+
).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
@publish="saveAndPublishBrandPage(false)"
|
|
18
18
|
@preview="onPreview"
|
|
19
19
|
@create-team-cards="onCreateTeamCards"
|
|
20
|
-
|
|
20
|
+
>
|
|
21
|
+
<template v-if="$slots.navigationActionsStart" #navigationActionsStart>
|
|
22
|
+
<slot name="navigationActionsStart" />
|
|
23
|
+
</template>
|
|
24
|
+
</MakerNavigation>
|
|
21
25
|
<slot name="editButtonHeader" />
|
|
22
26
|
<div
|
|
23
27
|
class="c-brand-page-maker tw-flex tw-flex-col lg:tw-flex-row tw-box-border"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<header
|
|
3
3
|
data-component="navigation"
|
|
4
|
-
class="js-bp-header tw-h-24 lg:tw-h-16 tw-box-border lg:tw-py-4 lg:tw-px-5 tw-z-30 tw-fixed tw-w-full lg:tw-relative"
|
|
4
|
+
class="js-bp-header tw-h-24 lg:tw-h-16 tw-box-border lg:tw-py-4 lg:tw-px-5 tw-z-30 lg:tw-z-40 tw-fixed tw-w-full lg:tw-relative"
|
|
5
5
|
:class="{
|
|
6
6
|
'tw-bg-grayscale-800': !isAdminMaker,
|
|
7
7
|
}"
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
@publish="saveAndPublishBrandPage"
|
|
37
37
|
@preview="previewBrandPage"
|
|
38
38
|
@create-team-cards="onCreateTeamCards"
|
|
39
|
-
|
|
39
|
+
>
|
|
40
|
+
<template v-if="$slots.navigationActionsStart" #navigationActionsStart>
|
|
41
|
+
<slot name="navigationActionsStart" />
|
|
42
|
+
</template>
|
|
43
|
+
</ActionBarNavigation>
|
|
40
44
|
</div>
|
|
41
45
|
</header>
|
|
42
46
|
</template>
|