@wix/patterns-fields 1.29.0 → 1.32.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.
- package/dist/cjs/assets/locale/messages_en.json +11 -10
- package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
- package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
- package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/cjs/components/document/cell-document-edit.js +302 -0
- package/dist/cjs/components/document/cell-document-edit.js.map +1 -0
- package/dist/cjs/components/document/cell-document-view.js +56 -0
- package/dist/cjs/components/document/cell-document-view.js.map +1 -0
- package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
- package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
- package/dist/cjs/components/document/index.js +12 -0
- package/dist/cjs/components/document/index.js.map +1 -1
- package/dist/cjs/components/document/utils.js +1 -0
- package/dist/cjs/components/document/utils.js.map +1 -1
- package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
- package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/cjs/components/image/cell-image-edit.js +68 -168
- package/dist/cjs/components/image/cell-image-edit.js.map +1 -1
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +3 -3
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/cell-media-edit-shell.js +101 -0
- package/dist/cjs/components/media-control/cell-media-edit-shell.js.map +1 -0
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css +4 -0
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js +22 -0
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js.map +1 -0
- package/dist/cjs/components/media-control/index.js +12 -0
- package/dist/cjs/components/media-control/index.js.map +1 -1
- package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
- package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/use-cell-media-edit.js +93 -0
- package/dist/cjs/components/media-control/use-cell-media-edit.js.map +1 -0
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
- package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js +4 -4
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
- package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/cjs/components/reference/cell-reference-input.js +47 -17
- package/dist/cjs/components/reference/cell-reference-input.js.map +1 -1
- package/dist/cjs/components/reference/cell-reference-input.st.css.js +3 -3
- package/dist/cjs/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +6 -6
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +5 -5
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +8 -8
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +20 -20
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +4 -4
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +20 -20
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/text/text-view.st.css.js +3 -3
- package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
- package/dist/cjs/services/translations.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/assets/locale/messages_en.json +11 -10
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/cell-document-edit.js +60 -0
- package/dist/esm/components/document/cell-document-edit.js.map +1 -0
- package/dist/esm/components/document/cell-document-view.js +13 -0
- package/dist/esm/components/document/cell-document-view.js.map +1 -0
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/document/index.js +2 -0
- package/dist/esm/components/document/index.js.map +1 -1
- package/dist/esm/components/document/utils.js +1 -0
- package/dist/esm/components/document/utils.js.map +1 -1
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/image/cell-image-edit.js +46 -85
- package/dist/esm/components/image/cell-image-edit.js.map +1 -1
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
- package/dist/esm/components/media-control/cell-media-edit-shell.js +23 -0
- package/dist/esm/components/media-control/cell-media-edit-shell.js.map +1 -0
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css +4 -0
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js +15 -0
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js.map +1 -0
- package/dist/esm/components/media-control/index.js +2 -0
- package/dist/esm/components/media-control/index.js.map +1 -1
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/esm/components/media-control/use-cell-media-edit.js +63 -0
- package/dist/esm/components/media-control/use-cell-media-edit.js.map +1 -0
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/overlays/overlay.st.css.js +3 -3
- package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.js +17 -5
- package/dist/esm/components/reference/cell-reference-input.js.map +1 -1
- package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +3 -3
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +3 -3
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/audio/audio-field/form-audio-field.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/color-view.st.css.d.ts.map +1 -1
- package/dist/types/components/document/cell-document-edit.d.ts +23 -0
- package/dist/types/components/document/cell-document-edit.d.ts.map +1 -0
- package/dist/types/components/document/cell-document-view.d.ts +12 -0
- package/dist/types/components/document/cell-document-view.d.ts.map +1 -0
- package/dist/types/components/document/index.d.ts +2 -0
- package/dist/types/components/document/index.d.ts.map +1 -1
- package/dist/types/components/document/utils.d.ts.map +1 -1
- package/dist/types/components/image/cell-image-edit.d.ts +1 -1
- package/dist/types/components/image/cell-image-edit.d.ts.map +1 -1
- package/dist/types/components/media-control/cell-media-edit-shell.d.ts +29 -0
- package/dist/types/components/media-control/cell-media-edit-shell.d.ts.map +1 -0
- package/dist/types/components/media-control/cell-media-edit-shell.st.css.d.ts +13 -0
- package/dist/types/components/media-control/cell-media-edit-shell.st.css.d.ts.map +1 -0
- package/dist/types/components/media-control/index.d.ts +2 -0
- package/dist/types/components/media-control/index.d.ts.map +1 -1
- package/dist/types/components/media-control/paste-url-button.st.css.d.ts.map +1 -1
- package/dist/types/components/media-control/use-cell-media-edit.d.ts +54 -0
- package/dist/types/components/media-control/use-cell-media-edit.d.ts.map +1 -0
- package/dist/types/components/media-gallery/form-media-gallery-field.st.css.d.ts.map +1 -1
- package/dist/types/components/media-tag/web-media-tag/media-tag.st.css.d.ts.map +1 -1
- package/dist/types/components/reference/cell-reference-input.d.ts +2 -0
- package/dist/types/components/reference/cell-reference-input.d.ts.map +1 -1
- package/dist/types/components/reference/cell-reference-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts.map +1 -1
- package/dist/types/services/translations.d.ts +1 -1
- package/dist/types/services/translations.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/components/document/cell-document-edit.spec.tsx +101 -0
- package/src/__tests__/components/document/cell-document-view.spec.tsx +39 -0
- package/src/__tests__/components/document/utils.spec.ts +28 -0
- package/src/assets/locale/messages_en.json +11 -10
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/cell-document-edit.tsx +196 -0
- package/src/components/document/cell-document-view.tsx +49 -0
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/document/index.ts +2 -0
- package/src/components/document/utils.ts +1 -0
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- package/src/components/image/cell-image-edit.tsx +112 -196
- package/src/components/image/thumbnail-replace-overlay.st.css.ts +2 -2
- package/src/components/media-control/cell-media-edit-shell.st.css +4 -0
- package/src/components/media-control/cell-media-edit-shell.st.css.ts +25 -0
- package/src/components/media-control/cell-media-edit-shell.tsx +101 -0
- package/src/components/media-control/index.ts +2 -0
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- package/src/components/media-control/use-cell-media-edit.ts +134 -0
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +3 -3
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.tsx +35 -7
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +3 -3
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +3 -3
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/services/translations.ts +1 -0
- package/src/styles.global.css +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { CellDocumentEdit } from '../../../components/document/cell-document-edit';
|
|
4
|
+
import { PatternsFieldsTestProvider } from '../../../testkit/patterns-fields-test-provider';
|
|
5
|
+
|
|
6
|
+
jest.mock('@wix/bex-core/react', () => ({
|
|
7
|
+
...jest.requireActual('@wix/bex-core/react'),
|
|
8
|
+
useWixPatternsContainer: () => ({
|
|
9
|
+
environment: { msid: 'test-meta-site-id' },
|
|
10
|
+
}),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
const mockCallMedia = jest.fn();
|
|
14
|
+
const mockDownloadMedia = jest.fn();
|
|
15
|
+
const mockOnOpen = jest.fn(() => jest.fn());
|
|
16
|
+
let mockLoading = false;
|
|
17
|
+
|
|
18
|
+
jest.mock('../../../components/media-control/use-media-control', () => ({
|
|
19
|
+
useMediaControl: () => ({
|
|
20
|
+
callMedia: mockCallMedia,
|
|
21
|
+
downloadMedia: mockDownloadMedia,
|
|
22
|
+
loading: mockLoading,
|
|
23
|
+
}),
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
jest.mock('../../../components/media-control/use-paste-url-form', () => ({
|
|
27
|
+
usePasteURLForm: () => ({
|
|
28
|
+
isOpen: false,
|
|
29
|
+
title: '',
|
|
30
|
+
onOpen: mockOnOpen,
|
|
31
|
+
onClose: jest.fn(),
|
|
32
|
+
onSave: jest.fn(),
|
|
33
|
+
}),
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
const DOC_URI =
|
|
37
|
+
'wix:document://v1/ugd/fefc9f_d8295aad65e0419fb9301388ef94369c.pdf/wix-pdf.pdf';
|
|
38
|
+
|
|
39
|
+
describe('CellDocumentEdit', () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
mockLoading = false;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const setup = (
|
|
45
|
+
value: string | null,
|
|
46
|
+
fieldId = 'document-edit-test-col',
|
|
47
|
+
) =>
|
|
48
|
+
render(
|
|
49
|
+
<CellDocumentEdit
|
|
50
|
+
value={value}
|
|
51
|
+
onChange={jest.fn()}
|
|
52
|
+
onCommit={jest.fn()}
|
|
53
|
+
onCancel={jest.fn()}
|
|
54
|
+
dataHook="edit"
|
|
55
|
+
fieldId={fieldId}
|
|
56
|
+
/>,
|
|
57
|
+
{ wrapper: PatternsFieldsTestProvider },
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
it('renders the Tag with the caller-provided fieldId', () => {
|
|
61
|
+
setup(DOC_URI, 'document-edit-col-1');
|
|
62
|
+
expect(screen.getByTestId('document-edit-tag').id).toBe(
|
|
63
|
+
'document-edit-col-1',
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('renders add button when value is null', () => {
|
|
68
|
+
setup(null);
|
|
69
|
+
expect(
|
|
70
|
+
screen.getByTestId('document-edit-add-button'),
|
|
71
|
+
).toBeInTheDocument();
|
|
72
|
+
expect(screen.queryByTestId('document-edit-tag')).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('exposes the Loader via data-hook="loader" inside the edit container while loading (Edit.uni.driver isLoading() contract)', () => {
|
|
76
|
+
mockLoading = true;
|
|
77
|
+
setup(DOC_URI);
|
|
78
|
+
|
|
79
|
+
const container = screen.getByTestId('edit');
|
|
80
|
+
expect(container.querySelector('[data-hook="loader"]')).not.toBeNull();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('icon-only buttons have an accessible name (aria-label) in both empty and populated states', () => {
|
|
84
|
+
setup(null);
|
|
85
|
+
expect(
|
|
86
|
+
screen.getByTestId('document-edit-add-button').getAttribute('aria-label'),
|
|
87
|
+
).toBeTruthy();
|
|
88
|
+
expect(
|
|
89
|
+
screen
|
|
90
|
+
.getByTestId('document-edit-paste-url-button')
|
|
91
|
+
.getAttribute('aria-label'),
|
|
92
|
+
).toBeTruthy();
|
|
93
|
+
|
|
94
|
+
setup(DOC_URI);
|
|
95
|
+
expect(
|
|
96
|
+
screen
|
|
97
|
+
.getByTestId('document-edit-more-button')
|
|
98
|
+
.getAttribute('aria-label'),
|
|
99
|
+
).toBeTruthy();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { CellDocumentView } from '../../../components/document/cell-document-view';
|
|
4
|
+
import { PatternsFieldsTestProvider } from '../../../testkit/patterns-fields-test-provider';
|
|
5
|
+
|
|
6
|
+
const DOC_URI =
|
|
7
|
+
'wix:document://v1/ugd/fefc9f_d8295aad65e0419fb9301388ef94369c.pdf/wix-pdf.pdf';
|
|
8
|
+
|
|
9
|
+
describe('CellDocumentView', () => {
|
|
10
|
+
it('renders the Tag with the caller-provided fieldId', () => {
|
|
11
|
+
render(
|
|
12
|
+
<PatternsFieldsTestProvider>
|
|
13
|
+
<CellDocumentView
|
|
14
|
+
value={DOC_URI}
|
|
15
|
+
dataHook="a"
|
|
16
|
+
fieldId="col-1-row-1"
|
|
17
|
+
/>
|
|
18
|
+
<CellDocumentView
|
|
19
|
+
value={DOC_URI}
|
|
20
|
+
dataHook="b"
|
|
21
|
+
fieldId="col-1-row-2"
|
|
22
|
+
/>
|
|
23
|
+
</PatternsFieldsTestProvider>,
|
|
24
|
+
);
|
|
25
|
+
const ids = screen
|
|
26
|
+
.getAllByTestId('cell-document-tag')
|
|
27
|
+
.map((t) => t.id);
|
|
28
|
+
expect(ids).toEqual(['col-1-row-1', 'col-1-row-2']);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders nothing when value is null', () => {
|
|
32
|
+
render(
|
|
33
|
+
<CellDocumentView value={null} dataHook="view" fieldId="any" />,
|
|
34
|
+
{ wrapper: PatternsFieldsTestProvider },
|
|
35
|
+
);
|
|
36
|
+
expect(screen.queryByTestId('view')).not.toBeInTheDocument();
|
|
37
|
+
expect(screen.queryByTestId('cell-document-tag')).not.toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { openDocument } from '../../../components/document/utils';
|
|
2
|
+
|
|
3
|
+
describe('openDocument', () => {
|
|
4
|
+
it('opens with rel="noopener noreferrer" to prevent tabnabbing', () => {
|
|
5
|
+
const created: HTMLAnchorElement[] = [];
|
|
6
|
+
const realCreateElement = document.createElement.bind(document);
|
|
7
|
+
const spy = jest
|
|
8
|
+
.spyOn(document, 'createElement')
|
|
9
|
+
.mockImplementation((tag: string) => {
|
|
10
|
+
const el = realCreateElement(tag);
|
|
11
|
+
if (tag === 'a') {
|
|
12
|
+
created.push(el as HTMLAnchorElement);
|
|
13
|
+
(el as HTMLAnchorElement).click = jest.fn();
|
|
14
|
+
}
|
|
15
|
+
return el;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
openDocument('https://example.com/file.pdf');
|
|
19
|
+
|
|
20
|
+
expect(created).toHaveLength(1);
|
|
21
|
+
const link = created[0];
|
|
22
|
+
expect(link.rel).toBe('noopener noreferrer');
|
|
23
|
+
expect(link.target).toBe('_blank');
|
|
24
|
+
expect(link.click).toHaveBeenCalled();
|
|
25
|
+
|
|
26
|
+
spy.mockRestore();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"CMS.document.add.button.text": "Add
|
|
3
|
-
"CMS.document.addMore.button.text": "Add
|
|
4
|
-
"CMS.document.action.open": "Open",
|
|
5
|
-
"CMS.document.action.download": "Download",
|
|
6
|
-
"CMS.document.action.replace": "
|
|
2
|
+
"CMS.document.add.button.text": "Add file",
|
|
3
|
+
"CMS.document.addMore.button.text": "Add file",
|
|
4
|
+
"CMS.document.action.open": "Open file",
|
|
5
|
+
"CMS.document.action.download": "Download file",
|
|
6
|
+
"CMS.document.action.replace": "Choose file",
|
|
7
7
|
"CMS.document.action.replaceWithUrl": "Replace with URL",
|
|
8
|
-
"CMS.document.action.delete": "Delete",
|
|
9
|
-
"CMS.document.pasteUrl.button": "
|
|
10
|
-
"CMS.document.pasteUrl.title": "
|
|
11
|
-
"CMS.document.replaceWithUrl.title": "
|
|
8
|
+
"CMS.document.action.delete": "Delete file",
|
|
9
|
+
"CMS.document.pasteUrl.button": "Add file link (URL)",
|
|
10
|
+
"CMS.document.pasteUrl.title": "Add file link (URL)",
|
|
11
|
+
"CMS.document.replaceWithUrl.title": "Add file link (URL)",
|
|
12
12
|
"CMS.document.delete.title": "Delete \"{filename}\"?",
|
|
13
13
|
"CMS.document.delete.confirm": "Delete",
|
|
14
14
|
"CMS.document.delete.cancel": "Cancel",
|
|
@@ -171,5 +171,6 @@
|
|
|
171
171
|
"CMS.video.preview": "Preview",
|
|
172
172
|
"CMS.video.download": "Download Video",
|
|
173
173
|
"CMS.video.delete": "Delete Video",
|
|
174
|
-
"patterns-fields.reference.untitled": "Untitled"
|
|
174
|
+
"patterns-fields.reference.untitled": "Untitled",
|
|
175
|
+
"patterns-fields.reference.open_collection": "Open Collection"
|
|
175
176
|
}
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "addressinput1106484384";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"addressinput1106484384__root","tableAddressInput":"addressinput1106484384__tableAddressInput"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "actionsmenu2539043764";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"actionsmenu2539043764__root","action":"actionsmenu2539043764__action"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formaudiofield3184549307";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"formaudiofield3184549307__root","addItem":"formaudiofield3184549307__addItem","mediaTitle":"formaudiofield3184549307__mediaTitle"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "audioplayer2286934621";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"audioplayer2286934621__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "colorview2476891254";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"colorview2476891254__root","view":"colorview2476891254__view","fillPreview":"colorview2476891254__fillPreview"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "deletedialog4190420635";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"deletedialog4190420635__root","layout":"deletedialog4190420635__layout"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, IconButton, PopoverMenu, Tag, Tooltip } from '@wix/design-system';
|
|
3
|
+
import {
|
|
4
|
+
Add,
|
|
5
|
+
Delete,
|
|
6
|
+
DocumentSmall,
|
|
7
|
+
Download,
|
|
8
|
+
ExternalLink,
|
|
9
|
+
Link,
|
|
10
|
+
LinkSmall,
|
|
11
|
+
MoreSmall,
|
|
12
|
+
Replace,
|
|
13
|
+
} from '@wix/wix-ui-icons-common';
|
|
14
|
+
import { getMediaTitle, MEDIA_TYPES } from '../../utils/media-utils';
|
|
15
|
+
import { getMediaURL } from '../../auto-field-types';
|
|
16
|
+
import { useTranslations } from '../../hooks';
|
|
17
|
+
import { useWixPatternsContainer } from '@wix/bex-core/react';
|
|
18
|
+
import {
|
|
19
|
+
useCellMediaEdit,
|
|
20
|
+
CellMediaEditShell,
|
|
21
|
+
MediaFieldType,
|
|
22
|
+
} from '../media-control';
|
|
23
|
+
import { openDocument } from './utils';
|
|
24
|
+
|
|
25
|
+
export interface CellDocumentEditProps {
|
|
26
|
+
value: string | null;
|
|
27
|
+
onChange: (value: string | null) => void;
|
|
28
|
+
onCommit: () => void;
|
|
29
|
+
onCancel?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Called before opening external UI (media manager / paste-URL form) so the
|
|
32
|
+
* table can set isEditing=true and protect cell focus while the modal is open.
|
|
33
|
+
*/
|
|
34
|
+
onStartEdit?: () => void;
|
|
35
|
+
inputRef?: React.MutableRefObject<{ focus: () => void } | null | undefined>;
|
|
36
|
+
dataHook?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Stable DOM id for the Tag. WDS Tag requires `id` to be present; callers are
|
|
39
|
+
* responsible for ensuring uniqueness (e.g., derive from columnId).
|
|
40
|
+
*/
|
|
41
|
+
fieldId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const CellDocumentEdit: React.FC<CellDocumentEditProps> = ({
|
|
45
|
+
value,
|
|
46
|
+
onChange,
|
|
47
|
+
onCommit,
|
|
48
|
+
onCancel,
|
|
49
|
+
onStartEdit,
|
|
50
|
+
inputRef,
|
|
51
|
+
dataHook,
|
|
52
|
+
fieldId,
|
|
53
|
+
}) => {
|
|
54
|
+
const { t } = useTranslations();
|
|
55
|
+
const msid = useWixPatternsContainer()?.environment?.msid;
|
|
56
|
+
|
|
57
|
+
const mediaEdit = useCellMediaEdit({
|
|
58
|
+
mediaType: MEDIA_TYPES.ALL_MEDIA,
|
|
59
|
+
value,
|
|
60
|
+
onChange,
|
|
61
|
+
onCommit,
|
|
62
|
+
onCancel,
|
|
63
|
+
onStartEdit,
|
|
64
|
+
inputRef,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const pasteUrlTitle = value
|
|
68
|
+
? t('CMS.document.replaceWithUrl.title')
|
|
69
|
+
: t('CMS.document.pasteUrl.title');
|
|
70
|
+
|
|
71
|
+
const openPasteUrl = mediaEdit.startEditAndOpenPasteUrl({
|
|
72
|
+
title: pasteUrlTitle,
|
|
73
|
+
value: value ?? undefined,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const handleOpenDocument = () => {
|
|
77
|
+
if (!value) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
openDocument(getMediaURL(value, msid));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleDownload = () => {
|
|
84
|
+
if (!value) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
mediaEdit.downloadMedia(value);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<CellMediaEditShell
|
|
92
|
+
dataHook={dataHook}
|
|
93
|
+
mediaEdit={mediaEdit}
|
|
94
|
+
value={value}
|
|
95
|
+
fieldType={MediaFieldType.document}
|
|
96
|
+
gap="SP1"
|
|
97
|
+
>
|
|
98
|
+
{value ? (
|
|
99
|
+
<Box minWidth="0" style={{ flex: '1 1 auto' }}>
|
|
100
|
+
<Tag
|
|
101
|
+
id={fieldId}
|
|
102
|
+
dataHook="document-edit-tag"
|
|
103
|
+
removable={false}
|
|
104
|
+
thumb={<DocumentSmall />}
|
|
105
|
+
size="small"
|
|
106
|
+
maxWidth="100%"
|
|
107
|
+
>
|
|
108
|
+
{getMediaTitle(value)}
|
|
109
|
+
</Tag>
|
|
110
|
+
</Box>
|
|
111
|
+
) : (
|
|
112
|
+
<Tooltip content={t('CMS.document.add.button.text')} appendTo="window">
|
|
113
|
+
<IconButton
|
|
114
|
+
size="tiny"
|
|
115
|
+
priority="secondary"
|
|
116
|
+
dataHook="document-edit-add-button"
|
|
117
|
+
ariaLabel={t('CMS.document.add.button.text')}
|
|
118
|
+
onClick={mediaEdit.handleCallMedia}
|
|
119
|
+
>
|
|
120
|
+
<Add />
|
|
121
|
+
</IconButton>
|
|
122
|
+
</Tooltip>
|
|
123
|
+
)}
|
|
124
|
+
|
|
125
|
+
{value ? (
|
|
126
|
+
<PopoverMenu
|
|
127
|
+
textSize="small"
|
|
128
|
+
appendTo="window"
|
|
129
|
+
triggerElement={
|
|
130
|
+
<Tooltip
|
|
131
|
+
content={t('auto-patterns.fields.more_actions_tooltip')}
|
|
132
|
+
appendTo="window"
|
|
133
|
+
>
|
|
134
|
+
<IconButton
|
|
135
|
+
size="tiny"
|
|
136
|
+
priority="tertiary"
|
|
137
|
+
dataHook="document-edit-more-button"
|
|
138
|
+
ariaLabel={t('auto-patterns.fields.more_actions_tooltip')}
|
|
139
|
+
>
|
|
140
|
+
<MoreSmall />
|
|
141
|
+
</IconButton>
|
|
142
|
+
</Tooltip>
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
<PopoverMenu.MenuItem
|
|
146
|
+
dataHook="document-edit-action-replace"
|
|
147
|
+
text={t('CMS.document.action.replace')}
|
|
148
|
+
prefixIcon={<Replace />}
|
|
149
|
+
onClick={mediaEdit.handleCallMedia}
|
|
150
|
+
/>
|
|
151
|
+
<PopoverMenu.MenuItem
|
|
152
|
+
dataHook="document-edit-action-replace-url"
|
|
153
|
+
text={t('CMS.document.action.replaceWithUrl')}
|
|
154
|
+
prefixIcon={<Link />}
|
|
155
|
+
onClick={openPasteUrl}
|
|
156
|
+
/>
|
|
157
|
+
<PopoverMenu.Divider />
|
|
158
|
+
<PopoverMenu.MenuItem
|
|
159
|
+
dataHook="document-edit-action-open"
|
|
160
|
+
text={t('CMS.document.action.open')}
|
|
161
|
+
prefixIcon={<ExternalLink />}
|
|
162
|
+
onClick={handleOpenDocument}
|
|
163
|
+
/>
|
|
164
|
+
<PopoverMenu.MenuItem
|
|
165
|
+
dataHook="document-edit-action-download"
|
|
166
|
+
text={t('CMS.document.action.download')}
|
|
167
|
+
prefixIcon={<Download />}
|
|
168
|
+
onClick={handleDownload}
|
|
169
|
+
/>
|
|
170
|
+
<PopoverMenu.Divider />
|
|
171
|
+
<PopoverMenu.MenuItem
|
|
172
|
+
dataHook="document-edit-action-delete"
|
|
173
|
+
text={t('CMS.document.action.delete')}
|
|
174
|
+
skin="destructive"
|
|
175
|
+
prefixIcon={<Delete />}
|
|
176
|
+
onClick={mediaEdit.handleDelete}
|
|
177
|
+
/>
|
|
178
|
+
</PopoverMenu>
|
|
179
|
+
) : (
|
|
180
|
+
<Tooltip content={t('CMS.document.pasteUrl.button')} appendTo="window">
|
|
181
|
+
<IconButton
|
|
182
|
+
size="tiny"
|
|
183
|
+
priority="tertiary"
|
|
184
|
+
dataHook="document-edit-paste-url-button"
|
|
185
|
+
ariaLabel={t('CMS.document.pasteUrl.button')}
|
|
186
|
+
onClick={openPasteUrl}
|
|
187
|
+
>
|
|
188
|
+
<LinkSmall />
|
|
189
|
+
</IconButton>
|
|
190
|
+
</Tooltip>
|
|
191
|
+
)}
|
|
192
|
+
</CellMediaEditShell>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
CellDocumentEdit.displayName = 'CellDocumentEdit';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Tag } from '@wix/design-system';
|
|
3
|
+
import { DocumentSmall } from '@wix/wix-ui-icons-common';
|
|
4
|
+
|
|
5
|
+
import { getMediaTitle } from '../../utils/media-utils';
|
|
6
|
+
|
|
7
|
+
export interface CellDocumentViewProps {
|
|
8
|
+
value: string | null | undefined;
|
|
9
|
+
dataHook?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Stable DOM id for the Tag. WDS Tag requires `id` to be present; callers are
|
|
12
|
+
* responsible for ensuring uniqueness (e.g., derive from columnId + rowKey).
|
|
13
|
+
*/
|
|
14
|
+
fieldId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CellDocumentView: React.FC<CellDocumentViewProps> = ({
|
|
18
|
+
value,
|
|
19
|
+
dataHook,
|
|
20
|
+
fieldId,
|
|
21
|
+
}) => {
|
|
22
|
+
if (!value) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Box
|
|
28
|
+
dataHook={dataHook}
|
|
29
|
+
verticalAlign="middle"
|
|
30
|
+
padding="0 8px"
|
|
31
|
+
height="100%"
|
|
32
|
+
width="100%"
|
|
33
|
+
minWidth="0"
|
|
34
|
+
>
|
|
35
|
+
<Tag
|
|
36
|
+
id={fieldId}
|
|
37
|
+
dataHook="cell-document-tag"
|
|
38
|
+
removable={false}
|
|
39
|
+
thumb={<DocumentSmall />}
|
|
40
|
+
size="small"
|
|
41
|
+
maxWidth="100%"
|
|
42
|
+
>
|
|
43
|
+
{getMediaTitle(value)}
|
|
44
|
+
</Tag>
|
|
45
|
+
</Box>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
CellDocumentView.displayName = 'CellDocumentView';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formdocumentfield1222498168";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"formdocumentfield1222498168__root","viewWrapper":"formdocumentfield1222498168__viewWrapper","textWidth":"formdocumentfield1222498168__textWidth","documentLoader":"formdocumentfield1222498168__documentLoader","addDocument":"formdocumentfield1222498168__addDocument","addItemWrapper":"formdocumentfield1222498168__addItemWrapper"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './document-view';
|
|
2
|
+
export * from './cell-document-view';
|
|
3
|
+
export * from './cell-document-edit';
|
|
2
4
|
|
|
3
5
|
// NOTE: Heavy exports (FormDocumentField, DocumentControl, etc.) have been moved to './form' to prevent bundle bloat.
|
|
4
6
|
// Import them explicitly: import { FormDocumentField } from '../fields/components/document/form';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "exclamation2043409223";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"exclamation2043409223__root","exclamation":"exclamation2043409223__exclamation","actions":"exclamation2043409223__actions","action":"exclamation2043409223__action"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "highlightedtext3214744979";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,8 +13,8 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
17
|
-
export var keyframes = {"highlighted":"
|
|
16
|
+
export var classes = {"root":"highlightedtext3214744979__root","substring":"highlightedtext3214744979__substring"};
|
|
17
|
+
export var keyframes = {"highlighted":"highlightedtext3214744979__highlighted","highlighted-match":"highlightedtext3214744979__highlighted-match"};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|