@imposium-hub/components 2.15.0-2 → 2.16.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/cjs/components/app-wrapper/AppWrapper.d.ts +0 -1
  2. package/dist/cjs/components/app-wrapper/AppWrapper.js +1 -1
  3. package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
  4. package/dist/cjs/components/asset-details/AssetDetails.js +1 -1
  5. package/dist/cjs/components/assets/AssetsTableComplexTagCell.js +1 -1
  6. package/dist/cjs/components/assets/AssetsTableTagsPivot.js +1 -1
  7. package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
  8. package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
  9. package/dist/cjs/components/assets/AssetsUploadMenu.js +1 -1
  10. package/dist/cjs/components/change-report/ChangeReportTree.js +65 -10
  11. package/dist/cjs/components/change-report/ChangeReportTree.js.map +1 -1
  12. package/dist/cjs/components/controlled-list/ControlledList.stories.js +1 -1
  13. package/dist/cjs/components/number-field/NumberField.d.ts +2 -2
  14. package/dist/cjs/components/number-field/NumberField.js +7 -4
  15. package/dist/cjs/components/number-field/NumberField.js.map +1 -1
  16. package/dist/cjs/components/publish-wizard/PublishWizard.js +36 -38
  17. package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -1
  18. package/dist/cjs/components/tag/Tag.js.map +1 -1
  19. package/dist/cjs/components/tag/Tag.test.js.map +1 -1
  20. package/dist/cjs/constants/copy.d.ts +1 -0
  21. package/dist/cjs/constants/copy.js +3 -2
  22. package/dist/cjs/constants/copy.js.map +1 -1
  23. package/dist/cjs/constants/icons.d.ts +5 -0
  24. package/dist/cjs/constants/icons.js +12 -2
  25. package/dist/cjs/constants/icons.js.map +1 -1
  26. package/dist/cjs/constants/snippets.d.ts +2 -0
  27. package/dist/cjs/index.d.ts +1 -1
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/cjs/redux/actions/publish.d.ts +1 -1
  30. package/dist/cjs/redux/actions/publish.js +2 -2
  31. package/dist/cjs/redux/actions/publish.js.map +1 -1
  32. package/dist/esm/components/app-wrapper/AppWrapper.d.ts +0 -1
  33. package/dist/esm/components/app-wrapper/AppWrapper.js +1 -1
  34. package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
  35. package/dist/esm/components/asset-details/AssetDetails.js +1 -1
  36. package/dist/esm/components/assets/AssetsTableComplexTagCell.js +1 -1
  37. package/dist/esm/components/assets/AssetsTableTagsPivot.js +1 -1
  38. package/dist/esm/components/assets/AssetsTypeIcon.js +2 -0
  39. package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
  40. package/dist/esm/components/assets/AssetsUploadMenu.js +1 -1
  41. package/dist/esm/components/change-report/ChangeReportTree.js +64 -10
  42. package/dist/esm/components/change-report/ChangeReportTree.js.map +1 -1
  43. package/dist/esm/components/controlled-list/ControlledList.stories.js +1 -1
  44. package/dist/esm/components/number-field/NumberField.d.ts +2 -2
  45. package/dist/esm/components/number-field/NumberField.js +5 -4
  46. package/dist/esm/components/number-field/NumberField.js.map +1 -1
  47. package/dist/esm/components/publish-wizard/PublishWizard.js +36 -38
  48. package/dist/esm/components/publish-wizard/PublishWizard.js.map +1 -1
  49. package/dist/esm/components/tag/Tag.js.map +1 -1
  50. package/dist/esm/components/tag/Tag.test.js.map +1 -1
  51. package/dist/esm/constants/copy.d.ts +1 -0
  52. package/dist/esm/constants/copy.js +3 -2
  53. package/dist/esm/constants/copy.js.map +1 -1
  54. package/dist/esm/constants/icons.d.ts +5 -0
  55. package/dist/esm/constants/icons.js +10 -0
  56. package/dist/esm/constants/icons.js.map +1 -1
  57. package/dist/esm/constants/snippets.d.ts +2 -0
  58. package/dist/esm/index.d.ts +1 -1
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/redux/actions/publish.d.ts +1 -1
  61. package/dist/esm/redux/actions/publish.js +2 -2
  62. package/dist/esm/redux/actions/publish.js.map +1 -1
  63. package/dist/styles.css +54 -10
  64. package/dist/styles.less +65 -13
  65. package/less/components/change-report.less +50 -9
  66. package/less/components/publish-wizard.less +15 -4
  67. package/package.json +5 -1
  68. package/src/components/advanced-number-field/AdvancedNumberField.test.tsx +704 -0
  69. package/src/components/anchor-field/AnchorField.test.tsx +130 -0
  70. package/src/components/app-wrapper/AppWrapper.tsx +1 -6
  71. package/src/components/asset-details/AssetDetails.test.tsx +494 -0
  72. package/src/components/asset-details/AssetDetails.tsx +1 -1
  73. package/src/components/assets/AssetField.test.tsx +439 -0
  74. package/src/components/assets/AssetsTableAssetIdCell.test.tsx +134 -0
  75. package/src/components/assets/AssetsTableAssetIdFilter.test.tsx +95 -0
  76. package/src/components/assets/AssetsTableComplexTagCell.test.tsx +159 -0
  77. package/src/components/assets/AssetsTableComplexTagCell.tsx +1 -1
  78. package/src/components/assets/AssetsTableDateCell.test.tsx +106 -0
  79. package/src/components/assets/AssetsTableTagsPivot.tsx +1 -1
  80. package/src/components/assets/AssetsTypeIcon.tsx +2 -0
  81. package/src/components/assets/AssetsUploadMenu.tsx +1 -1
  82. package/src/components/change-report/ChangeReportTree.tsx +104 -16
  83. package/src/components/controlled-list/ControlledList.stories.tsx +1 -1
  84. package/src/components/number-field/NumberField.test.tsx +383 -0
  85. package/src/components/number-field/NumberField.tsx +15 -9
  86. package/src/components/publish-wizard/PublishWizard.tsx +52 -53
  87. package/src/components/text-field/TextField.test.tsx +988 -0
  88. package/src/constants/copy.ts +3 -2
  89. package/src/constants/icons.tsx +10 -0
  90. package/src/constants/snippets.ts +2 -0
  91. package/src/index.ts +1 -1
  92. package/src/redux/actions/publish.ts +7 -2
  93. package/src/test/setup.ts +91 -0
  94. package/src/test/utils.tsx +44 -0
  95. package/tsconfig.eslint.json +8 -0
  96. package/tsconfig.json +1 -1
  97. package/vitest.config.ts +31 -0
  98. package/src/components/service-icon/ServiceIcon.test.tsx +0 -0
  99. /package/src/components/{Tag → tag}/Tag.test.tsx +0 -0
  100. /package/src/components/{Tag → tag}/Tag.tsx +0 -0
@@ -155,6 +155,7 @@ export const publish = {
155
155
  loadingChangesMessage: 'Loading changes...',
156
156
  publishNotesLabel: 'Publish notes',
157
157
  publishNotesPlaceholder: 'Describe the changes in this version...',
158
+ publishNotesMaxLength: 2000,
158
159
 
159
160
  // change report status labels
160
161
  statusAdded: 'Added',
@@ -162,13 +163,13 @@ export const publish = {
162
163
  statusModified: 'Modified',
163
164
 
164
165
  // publish
165
- publishStepTitle: 'STEP 2: Publish your Project',
166
+ publishStepTitle: 'STEP 1: Publish your Project',
166
167
  publishStepTitleFromCrM: 'STEP 1: Publish your Project to selected Creatives',
167
168
  publishStepDesc:
168
169
  "Your project needs to be published before your changes can be seen. If you haven't made any changes since the last time you published, you can skip to the next step.",
169
170
 
170
171
  // distribute
171
- distributeStepTitle: 'STEP 3: How do you want your users to view their video?',
172
+ distributeStepTitle: 'STEP 2: How do you want your users to view their video?',
172
173
  distributeStepTitleFromCrM: 'STEP 2: Run a test batch or return to Creative Manager?',
173
174
  distributeStepDesc:
174
175
  'Select which Composition you want to deliver, access credentials you want to use, and distribution channel.',
@@ -60,6 +60,11 @@ import { faJs } from '@fortawesome/free-brands-svg-icons/faJs';
60
60
  import { faDownload } from '@fortawesome/free-solid-svg-icons/faDownload';
61
61
  import { faUpload } from '@fortawesome/free-solid-svg-icons/faUpload';
62
62
  import { faCode } from '@fortawesome/free-solid-svg-icons/faCode';
63
+ import { faHashtag } from '@fortawesome/free-solid-svg-icons/faHashtag';
64
+ import { faToggleOn } from '@fortawesome/free-solid-svg-icons/faToggleOn';
65
+ import { faVolumeUp } from '@fortawesome/free-solid-svg-icons/faVolumeUp';
66
+ import { faPalette } from '@fortawesome/free-solid-svg-icons/faPalette';
67
+ import { faQrcode } from '@fortawesome/free-solid-svg-icons/faQrcode';
63
68
  import { faEye } from '@fortawesome/free-solid-svg-icons/faEye';
64
69
  import {
65
70
  faArrowDown,
@@ -162,6 +167,11 @@ export const ICON_ALIGN_RIGHT = <FontAwesomeIcon icon={faAlignRight} />;
162
167
  export const ICON_ALIGN_CENTER = <FontAwesomeIcon icon={faAlignCenter} />;
163
168
 
164
169
  export const ICON_BARS = <FontAwesomeIcon icon={faBars} />;
170
+ export const ICON_HASHTAG = <FontAwesomeIcon icon={faHashtag} />;
171
+ export const ICON_TOGGLE_ON = <FontAwesomeIcon icon={faToggleOn} />;
172
+ export const ICON_VOLUME_UP = <FontAwesomeIcon icon={faVolumeUp} />;
173
+ export const ICON_PALETTE = <FontAwesomeIcon icon={faPalette} />;
174
+ export const ICON_QRCODE = <FontAwesomeIcon icon={faQrcode} />;
165
175
 
166
176
  export const ICON_ARROW_UP = <FontAwesomeIcon icon={faArrowToTop} />;
167
177
 
@@ -3,6 +3,8 @@ export interface IChangeReportNode {
3
3
  status: 'added' | 'removed' | 'modified';
4
4
  oldValue?: string;
5
5
  newValue?: string;
6
+ layerType?: string;
7
+ varType?: string;
6
8
  children?: IChangeReportNode[];
7
9
  }
8
10
 
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ import TextAreaField from './components/text-area-field/TextAreaField';
23
23
  import ToastService from './components/toast-service/ToastService';
24
24
  import SliderField from './components/slider-field/SliderField';
25
25
  import ColorField from './components/color-field/ColorField';
26
- import Tag from './components/Tag/Tag';
26
+ import Tag from './components/tag/Tag';
27
27
  import HRule from './components/h-rule/HRule';
28
28
  import Section from './components/section/Section';
29
29
  import Spinner from './components/spinner/Spinner';
@@ -74,10 +74,15 @@ export const cancelPublish = (api: IImposiumAPI, storyId: string) => {
74
74
  };
75
75
  };
76
76
 
77
- export const publishVersion = (api: IImposiumAPI, storyId: string, creativeIds?: string[]) => {
77
+ export const publishVersion = (
78
+ api: IImposiumAPI,
79
+ storyId: string,
80
+ message?: string,
81
+ creativeIds?: string[]
82
+ ) => {
78
83
  return (dispatch) => {
79
84
  return new Promise((resolve, reject) => {
80
- api.runPublish(storyId, '', creativeIds)
85
+ api.runPublish(storyId, message || '', creativeIds)
81
86
  .then((d) => {
82
87
  dispatch(getStoryPublishStatus(api, storyId))
83
88
  .then()
@@ -0,0 +1,91 @@
1
+ // Test setup file for Vitest
2
+ import React from 'react';
3
+ import { beforeAll, vi } from 'vitest';
4
+
5
+ // Mock hotkeys-js
6
+ vi.mock('hotkeys-js', () => {
7
+ const mockHotkeys = vi.fn();
8
+ mockHotkeys.filter = vi.fn();
9
+ mockHotkeys.unbind = vi.fn();
10
+ return {
11
+ default: mockHotkeys
12
+ };
13
+ });
14
+
15
+ // Mock Font Awesome icons - return simple div elements
16
+ vi.mock('../../constants/icons', () => ({
17
+ ICON_CHECK: '<div data-testid="icon-check">✓</div>',
18
+ ICON_EDIT: '<div data-testid="icon-edit">✎</div>',
19
+ ICON_SEARCH: '<div data-testid="icon-search">🔍</div>',
20
+ ICON_PLUS: '<div data-testid="icon-plus">+</div>',
21
+ ICON_CLIPBOARD: '<div data-testid="icon-clipboard">📋</div>',
22
+ ICON_TIMES: '<div data-testid="icon-times">×</div>',
23
+ ICON_CIRCLE_NOTCH: '<div data-testid="icon-loading">⟳</div>',
24
+ ICON_CARET_UP: '<div data-testid="icon-caret-up">▲</div>',
25
+ ICON_CARET_DOWN: '<div data-testid="icon-caret-down">▼</div>'
26
+ }));
27
+
28
+ // Mock react-textarea-autocomplete
29
+ vi.mock('@imposium-hub/react-textarea-autocomplete', () => ({
30
+ default: vi.fn(() => 'input')
31
+ }));
32
+
33
+ // Mock utility functions
34
+ vi.mock('../../Util', () => ({
35
+ generateUUID: vi.fn(() => 'test-uuid-123'),
36
+ filterHotkeys: vi.fn(() => true)
37
+ }));
38
+
39
+ // Mock FieldWrapper to simplify testing
40
+ vi.mock('../../components/field-wrapper/FieldWrapper', () => ({
41
+ default: ({ children, customClass, buttons, info, label }) =>
42
+ React.createElement(
43
+ 'div',
44
+ {
45
+ 'className': `field-wrapper ${customClass || ''}`,
46
+ 'data-testid': 'field-wrapper'
47
+ },
48
+ [
49
+ label && React.createElement('label', { key: 'label' }, label),
50
+ children,
51
+ info && React.createElement('div', { key: 'info', className: 'field-info' }, info),
52
+ buttons &&
53
+ React.createElement(
54
+ 'div',
55
+ { key: 'buttons', className: 'field-buttons' },
56
+ buttons
57
+ )
58
+ ]
59
+ )
60
+ }));
61
+
62
+ // Mock Button component to include proper accessibility
63
+ vi.mock('../../components/button/Button', () => ({
64
+ default: ({ children, onClick, tooltip, style, color, ...props }) =>
65
+ React.createElement(
66
+ 'button',
67
+ {
68
+ 'role': 'button',
69
+ 'className': `imposium-btn btn-${style || 'default'} ${color || ''}`,
70
+ onClick,
71
+ 'data-tooltip-content': typeof tooltip === 'string' ? tooltip : tooltip?.content,
72
+ ...props
73
+ },
74
+ children
75
+ )
76
+ }));
77
+
78
+ // Setup global mocks
79
+ beforeAll(() => {
80
+ // Mock clipboard API
81
+ Object.assign(navigator, {
82
+ clipboard: {
83
+ writeText: vi.fn(() => Promise.resolve())
84
+ }
85
+ });
86
+
87
+ // Mock hotkeys global object
88
+ global.hotkeys = vi.fn();
89
+ global.hotkeys.filter = vi.fn();
90
+ global.hotkeys.unbind = vi.fn();
91
+ });
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { render, RenderOptions } from '@testing-library/react';
3
+ import { vi, MockedFunction } from 'vitest';
4
+
5
+ // Interface for mock props with common component callbacks
6
+ interface IMockProps {
7
+ onChange: MockedFunction<any>;
8
+ onSubmit: MockedFunction<any>;
9
+ onBlur: MockedFunction<any>;
10
+ onFocus: MockedFunction<any>;
11
+ onNotification: MockedFunction<any>;
12
+ onError: MockedFunction<any>;
13
+ doSubmit: MockedFunction<any>;
14
+ [key: string]: any;
15
+ }
16
+
17
+ // Custom render function that can be extended with providers if needed
18
+ const customRender = (ui: React.ReactElement, options?: Omit<RenderOptions, 'wrapper'>) => {
19
+ return render(ui, {
20
+ // Add any global providers here if needed in the future
21
+ ...options
22
+ });
23
+ };
24
+
25
+ // Re-export everything from React Testing Library
26
+ export * from '@testing-library/react';
27
+
28
+ // Override render method
29
+ export { customRender as render };
30
+
31
+ // Helper functions for common test scenarios
32
+ export const createMockProps = (overrides: IMockProps) => ({
33
+ onChange: vi.fn(),
34
+ onSubmit: vi.fn(),
35
+ onBlur: vi.fn(),
36
+ onFocus: vi.fn(),
37
+ onNotification: vi.fn(),
38
+ onError: vi.fn(),
39
+ doSubmit: vi.fn(),
40
+ ...overrides
41
+ });
42
+
43
+ // Helper to wait for async updates
44
+ export const waitForUpdate = () => new Promise((resolve) => setTimeout(resolve, 0));
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "skipLibCheck": true
5
+ },
6
+ "include": ["src/**/*"],
7
+ "exclude": ["node_modules", "dist"]
8
+ }
package/tsconfig.json CHANGED
@@ -14,5 +14,5 @@
14
14
  "moduleResolution": "node"
15
15
  },
16
16
  "include": ["src"],
17
- "exclude": ["node_modules", "dist"]
17
+ "exclude": ["node_modules", "dist", "**/*.test.*", "**/*.spec.*", "src/test/**/*"]
18
18
  }
@@ -0,0 +1,31 @@
1
+ /// <reference types="vitest" />
2
+ import { defineConfig } from 'vitest/config';
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ environment: 'jsdom',
7
+ setupFiles: ['./src/test/setup.ts'],
8
+ include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
9
+ exclude: ['node_modules', 'dist', '.git', '.storybook'],
10
+ globals: true,
11
+ coverage: {
12
+ provider: 'v8',
13
+ reporter: ['text'],
14
+ reportsDirectory: './coverage',
15
+ include: ['src/components/**/*.{ts,tsx}'],
16
+ exclude: [
17
+ 'src/**/*.test.{ts,tsx}',
18
+ 'src/**/*.stories.{ts,tsx}',
19
+ 'src/test/**',
20
+ 'src/constants/**',
21
+ 'src/utils/**'
22
+ ],
23
+ skipFull: false
24
+ }
25
+ },
26
+ resolve: {
27
+ alias: {
28
+ '@': '/src'
29
+ }
30
+ }
31
+ });
File without changes
File without changes
File without changes