@wix/patterns-fields 1.109.0 → 1.110.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/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/boolean/cell-checkbox.js +15 -6
- package/dist/cjs/components/boolean/cell-checkbox.js.map +1 -1
- package/dist/cjs/components/color-view/cell-color-view.st.css.js +3 -3
- package/dist/cjs/components/color-view/cell-color-view.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/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/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/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.st.css.js +2 -2
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.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-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 +3 -3
- package/dist/cjs/components/media-image/overlays/overlay.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/cell-multi-document-edit.st.css.js +3 -3
- package/dist/cjs/components/multi-document/cell-multi-document-edit.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-multi-reference-input.st.css.js +2 -2
- package/dist/cjs/components/reference/cell-multi-reference-input.st.css.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/cell-rich-content-input.js +12 -9
- package/dist/cjs/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +4 -4
- 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 +3 -3
- 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.js +23 -17
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +7 -7
- 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 +5 -5
- 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/cell-rich-text-editor.js +21 -5
- package/dist/cjs/components/rich-text/cell-rich-text-editor.js.map +1 -1
- package/dist/cjs/components/rich-text/cell-rich-text-input.js +15 -7
- package/dist/cjs/components/rich-text/cell-rich-text-input.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +18 -18
- 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 +18 -18
- 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/styles.global.css +1 -1
- package/dist/cjs/utils/keyboard.js +12 -0
- package/dist/cjs/utils/keyboard.js.map +1 -0
- 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/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- 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/boolean/cell-checkbox.js +10 -4
- package/dist/esm/components/boolean/cell-checkbox.js.map +1 -1
- package/dist/esm/components/color-view/cell-color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- 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/highlighted-text/highlighted-text.st.css.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.st.css.js +2 -2
- 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-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/esm/components/media-image/overlays/overlay.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/multi-document/cell-multi-document-edit.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/esm/components/reference/cell-multi-reference-input.st.css.js +2 -2
- 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/cell-rich-content-input.js +11 -9
- package/dist/esm/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +2 -2
- 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/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- 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/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- 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/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.js +8 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +2 -2
- 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/cell-rich-text-editor.js +16 -1
- package/dist/esm/components/rich-text/cell-rich-text-editor.js.map +1 -1
- package/dist/esm/components/rich-text/cell-rich-text-input.js +8 -0
- package/dist/esm/components/rich-text/cell-rich-text-input.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +2 -2
- 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/toolbar/toolbar.st.css.js +2 -2
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/styles.global.css +1 -1
- package/dist/esm/utils/keyboard.js +7 -0
- package/dist/esm/utils/keyboard.js.map +1 -0
- package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
- package/dist/types/components/audio/audio-field/form-audio-field.st.css.d.ts.map +1 -1
- package/dist/types/components/boolean/cell-checkbox.d.ts +4 -1
- package/dist/types/components/boolean/cell-checkbox.d.ts.map +1 -1
- package/dist/types/components/highlighted-text/highlighted-text.st.css.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-image/media-image.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.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/cell-rich-content-input.d.ts +2 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.d.ts +2 -0
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.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/cell-rich-text-editor.d.ts.map +1 -1
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts +1 -1
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts.map +1 -1
- package/dist/types/utils/keyboard.d.ts +4 -0
- package/dist/types/utils/keyboard.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/__tests__/components/cell-rich-content-input.spec.tsx +73 -0
- package/src/__tests__/components/cell-rich-text-editor.spec.tsx +64 -0
- package/src/__tests__/components/cell-rich-text-input.spec.tsx +39 -0
- package/src/__tests__/components/rich-content-editor.spec.tsx +53 -0
- package/src/__tests__/utils/keyboard.spec.ts +45 -0
- 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/boolean/cell-checkbox.tsx +33 -11
- package/src/components/color-view/cell-color-view.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/form-document-field.st.css.ts +2 -2
- 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/thumbnail-replace-overlay.st.css.ts +2 -2
- package/src/components/media-control/cell-media-edit-shell.st.css.ts +2 -2
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- 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 +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.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-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/cell-rich-content-input.tsx +12 -13
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +2 -2
- 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 +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx +9 -1
- 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/cell-rich-text-editor.tsx +30 -1
- package/src/components/rich-text/cell-rich-text-input.tsx +9 -1
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +2 -2
- 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 +2 -2
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/styles.global.css +1 -1
- package/src/utils/keyboard.ts +7 -0
|
@@ -8,6 +8,7 @@ export interface CellRichContentInputProps {
|
|
|
8
8
|
initialTypedKey?: string;
|
|
9
9
|
}
|
|
10
10
|
/** Full-screen Ricos editor for the richContent cell type.
|
|
11
|
-
* Opens immediately in fullscreen mode. Saving (X button or
|
|
11
|
+
* Opens immediately in fullscreen mode. Saving (X button, Escape or Enter) calls onChange + onSave.
|
|
12
|
+
* Shift+Enter adds a new line. */
|
|
12
13
|
export declare const CellRichContentInput: React.FC<CellRichContentInputProps>;
|
|
13
14
|
//# sourceMappingURL=cell-rich-content-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-rich-content-input.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-content/cell-rich-content-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sHAAsH;IACtH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;
|
|
1
|
+
{"version":3,"file":"cell-rich-content-input.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-content/cell-rich-content-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sHAAsH;IACtH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;mCAEmC;AACnC,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA0DpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-content-default-value-input.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;;
|
|
1
|
+
{"version":3,"file":"rich-content-default-value-input.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;;CAAsN,CAAC;AACzO,eAAO,IAAI,SAAS,IAAK,CAAC;AAC1B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,UAAU,IAAK,CAAC;AAC3B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,IAAI;;;CAA0F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-content-form-read-only-input.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;
|
|
1
|
+
{"version":3,"file":"rich-content-form-read-only-input.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;CAAyD,CAAC;AAC5E,eAAO,IAAI,SAAS,IAAK,CAAC;AAC1B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,UAAU,IAAK,CAAC;AAC3B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,IAAI;;;;;;CAAkQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen-modal.st.css.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;
|
|
1
|
+
{"version":3,"file":"fullscreen-modal.st.css.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;CAAsG,CAAC;AACzH,eAAO,IAAI,SAAS,IAAK,CAAC;AAC1B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,UAAU,IAAK,CAAC;AAC3B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,IAAI;;;;;CAA8K,CAAC"}
|
|
@@ -23,6 +23,8 @@ export type RichContentEditorProps = Omit<RCEProps, 'onChange'> & {
|
|
|
23
23
|
onChange?: (content: RicosDocument, isContentChanged?: boolean) => void;
|
|
24
24
|
onPublish?: (promise: Promise<RicosDocument>) => void;
|
|
25
25
|
fullScreenOnly?: boolean;
|
|
26
|
+
/** Close full screen on Enter in the text, like Escape. Shift+Enter still adds a new line. */
|
|
27
|
+
closeOnEnter?: boolean;
|
|
26
28
|
};
|
|
27
29
|
export declare const RichContentEditor: FC<RichContentEditorProps>;
|
|
28
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-content-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAYnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+DAA+D,CAAC;AACnG,OAAO,KAAK,EAGV,gBAAgB,EAEjB,MAAM,+DAA+D,CAAC;AAQvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"rich-content-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAYnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+DAA+D,CAAC;AACnG,OAAO,KAAK,EAGV,gBAAgB,EAEjB,MAAM,+DAA+D,CAAC;AAQvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAe/C,KAAK,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAQF,UAAU,QAAS,SAAQ,UAAU;IACnC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA+TD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAChE,iBAAiB,CAAC,EAAE,CAClB,OAAO,CAAC,EAAE,aAAa,EACvB,gBAAgB,CAAC,EAAE,OAAO,KACvB,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CACjB,OAAO,CAAC,EAAE,aAAa,EACvB,gBAAgB,CAAC,EAAE,OAAO,KACvB,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkNxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-content-toolbar.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;;;
|
|
1
|
+
{"version":3,"file":"rich-content-toolbar.st.css.d.ts","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts"],"names":[],"mappings":"AAUA,eAAO,IAAI,SAAS,+BAAwC,CAAC;AAC7D,eAAO,IAAI,KAAK,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AACnE,eAAO,IAAI,EAAE,EAAE,OAAO,mBAAmB,EAAE,UAAoB,CAAC;AAEhE,eAAO,IAAI,SAAS,QAAc,CAAC;AACnC,eAAO,IAAI,OAAO;;;;;CAAkN,CAAC;AACrO,eAAO,IAAI,SAAS,IAAK,CAAC;AAC1B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,UAAU,IAAK,CAAC;AAC3B,eAAO,IAAI,MAAM,IAAK,CAAC;AACvB,eAAO,IAAI,IAAI,IAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-rich-text-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text/cell-rich-text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cell-rich-text-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text/cell-rich-text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAI5F;4EAC4E;AAC5E,eAAO,MAAM,uBAAuB,EAAE,sBAqCrC,CAAC;AAWF,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,oFAAoF;IACpF,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED;;gFAEgF;AAChF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwGhE,CAAC"}
|
|
@@ -5,7 +5,7 @@ export interface CellRichTextInputProps {
|
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
/** Typed key from type-to-edit — appended to existing plain-text content on mount. */
|
|
7
7
|
initialTypedKey?: string;
|
|
8
|
-
/** Called when the editor loses focus (click outside) or ESC is pressed. */
|
|
8
|
+
/** Called when the editor loses focus (click outside), or ESC or Enter is pressed. Shift+Enter adds a new line. */
|
|
9
9
|
onCommit?: () => void;
|
|
10
10
|
/** CSS custom properties for the --rt-* theming API. Defaults to standard sizes. */
|
|
11
11
|
textStyle?: RichTextStyleVariables;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-rich-text-input.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text/cell-rich-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"cell-rich-text-input.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text/cell-rich-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAM5F,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mHAAmH;IACnH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oFAAoF;IACpF,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED;;;;;;;;8EAQ8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkG9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/utils/keyboard.ts"],"names":[],"mappings":"AAAA;uDACuD;AACvD,eAAO,MAAM,qBAAqB,GAAI,GAAG,aAAa,YAIqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/patterns-fields",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.110.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kobi",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"@wix/atlas": "^1.0.35",
|
|
125
125
|
"@wix/data": "^1.0.323",
|
|
126
126
|
"@wix/media": "^1.0.231",
|
|
127
|
-
"@wix/patterns-fields-utils": "1.
|
|
127
|
+
"@wix/patterns-fields-utils": "1.91.0",
|
|
128
128
|
"@wix/rich-content": "1.0.37",
|
|
129
129
|
"@wix/sdk": "^1.17.2",
|
|
130
130
|
"@wix/wix-ui-icons-common": "^3.189.0",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"@types/lodash": "^4.17.20",
|
|
153
153
|
"@types/react": "^16.14.68",
|
|
154
154
|
"@wix/babel-cli": "^1.11.0",
|
|
155
|
-
"@wix/bex-core": "2.
|
|
155
|
+
"@wix/bex-core": "2.388.0",
|
|
156
156
|
"@wix/design-system": "^1.330.2",
|
|
157
157
|
"@wix/eslint-config-yoshi": "^6.74.0",
|
|
158
158
|
"@wix/jest-yoshi-preset": "^6.74.0",
|
|
@@ -212,5 +212,5 @@
|
|
|
212
212
|
"optional": true
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
"falconPackageHash": "
|
|
215
|
+
"falconPackageHash": "bb5b3c3bf9f0007ceacfd54e6d151e8e85457fdc68e652502a14df5e"
|
|
216
216
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { act, render } from '@testing-library/react';
|
|
3
|
+
import { CellRichContentInput } from '../../components/rich-content/cell-rich-content-input';
|
|
4
|
+
|
|
5
|
+
type ExitFullScreen = (content?: unknown, isContentChanged?: boolean) => void;
|
|
6
|
+
let exitFullScreen: ExitFullScreen;
|
|
7
|
+
|
|
8
|
+
jest.mock(
|
|
9
|
+
'../../components/rich-content/rich-content-input/rich-content-editor',
|
|
10
|
+
() => ({
|
|
11
|
+
RichContentEditor: (props: { onExitFullScreen: ExitFullScreen }) => {
|
|
12
|
+
exitFullScreen = props.onExitFullScreen;
|
|
13
|
+
return null;
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
jest.mock(
|
|
19
|
+
'@wix/patterns-fields-utils/@wix/patterns-fields-bundled-ricos',
|
|
20
|
+
() => ({
|
|
21
|
+
fromPlainText: (text: string) => ({ nodes: [], text }),
|
|
22
|
+
toPlainTextSync: () => '',
|
|
23
|
+
ensureContentId: (content: unknown) => content,
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
describe('<CellRichContentInput/>', () => {
|
|
28
|
+
const content = { nodes: [] };
|
|
29
|
+
|
|
30
|
+
const setup = (props: { initialTypedKey?: string } = {}) => {
|
|
31
|
+
const onChange = jest.fn();
|
|
32
|
+
const onSave = jest.fn();
|
|
33
|
+
render(
|
|
34
|
+
<CellRichContentInput
|
|
35
|
+
value={content}
|
|
36
|
+
onChange={onChange}
|
|
37
|
+
onSave={onSave}
|
|
38
|
+
{...props}
|
|
39
|
+
/>,
|
|
40
|
+
);
|
|
41
|
+
return { onChange, onSave };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
it('closes without reporting a change when the content did not change', () => {
|
|
45
|
+
const { onChange, onSave } = setup();
|
|
46
|
+
act(() => exitFullScreen(content, false));
|
|
47
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
48
|
+
expect(onSave).toHaveBeenCalledTimes(1);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('reports the new content when it changed', () => {
|
|
52
|
+
const { onChange, onSave } = setup();
|
|
53
|
+
const edited = { nodes: [{ type: 'PARAGRAPH' }] };
|
|
54
|
+
act(() => exitFullScreen(edited, true));
|
|
55
|
+
expect(onChange).toHaveBeenCalledWith(edited);
|
|
56
|
+
expect(onSave).toHaveBeenCalledTimes(1);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('reports a typed-to-edit key as a change', () => {
|
|
60
|
+
const { onChange } = setup({ initialTypedKey: 'x' });
|
|
61
|
+
act(() => exitFullScreen(content, false));
|
|
62
|
+
expect(onChange).toHaveBeenCalledWith(content);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('saves only once when closed twice (X button and Escape together)', () => {
|
|
66
|
+
const { onSave } = setup();
|
|
67
|
+
act(() => {
|
|
68
|
+
exitFullScreen(content, true);
|
|
69
|
+
exitFullScreen(content, true);
|
|
70
|
+
});
|
|
71
|
+
expect(onSave).toHaveBeenCalledTimes(1);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { act, render } from '@testing-library/react';
|
|
3
|
+
import { EditorState, Modifier } from 'draft-js';
|
|
4
|
+
import { CellRichTextEditor } from '../../components/rich-text/cell-rich-text-editor';
|
|
5
|
+
|
|
6
|
+
let editorProps: {
|
|
7
|
+
editorState: EditorState;
|
|
8
|
+
onChange: (state: EditorState) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
jest.mock(
|
|
12
|
+
'../../components/rich-text/rich-text-input/rich-text-editor/rich-editor',
|
|
13
|
+
() => ({
|
|
14
|
+
RichEditor: (props: typeof editorProps) => {
|
|
15
|
+
editorProps = props;
|
|
16
|
+
return null;
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
describe('<CellRichTextEditor/>', () => {
|
|
22
|
+
const setup = (props: { initialTypedKey?: string } = {}) => {
|
|
23
|
+
const onChange = jest.fn();
|
|
24
|
+
render(
|
|
25
|
+
<CellRichTextEditor
|
|
26
|
+
value="<p>Hello</p>"
|
|
27
|
+
onChange={onChange}
|
|
28
|
+
{...props}
|
|
29
|
+
/>,
|
|
30
|
+
);
|
|
31
|
+
return { onChange };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
it('does not call onChange for a selection-only change (e.g. focus)', () => {
|
|
35
|
+
const { onChange } = setup();
|
|
36
|
+
act(() =>
|
|
37
|
+
editorProps.onChange(EditorState.moveFocusToEnd(editorProps.editorState)),
|
|
38
|
+
);
|
|
39
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('calls onChange when the content changes', () => {
|
|
43
|
+
const { onChange } = setup();
|
|
44
|
+
const state = editorProps.editorState;
|
|
45
|
+
const content = Modifier.insertText(
|
|
46
|
+
state.getCurrentContent(),
|
|
47
|
+
state.getSelection(),
|
|
48
|
+
'!',
|
|
49
|
+
);
|
|
50
|
+
act(() =>
|
|
51
|
+
editorProps.onChange(
|
|
52
|
+
EditorState.push(state, content, 'insert-characters'),
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
expect(onChange).toHaveBeenCalledTimes(1);
|
|
56
|
+
expect(onChange.mock.calls[0][0]).toContain('!');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('reports a typed-to-edit key as a change on mount', () => {
|
|
60
|
+
const { onChange } = setup({ initialTypedKey: 'x' });
|
|
61
|
+
expect(onChange).toHaveBeenCalledTimes(1);
|
|
62
|
+
expect(onChange.mock.calls[0][0]).toContain('x');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
+
import { CellRichTextInput } from '../../components/rich-text/cell-rich-text-input';
|
|
4
|
+
|
|
5
|
+
jest.mock('../../components/rich-text/cell-rich-text-editor', () => ({
|
|
6
|
+
DEFAULT_CELL_TEXT_STYLE: {},
|
|
7
|
+
CellRichTextEditor: () => (
|
|
8
|
+
<div data-hook="mock-editor" contentEditable="true" />
|
|
9
|
+
),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
describe('<CellRichTextInput/>', () => {
|
|
13
|
+
const setup = () => {
|
|
14
|
+
const onCommit = jest.fn();
|
|
15
|
+
const { baseElement } = render(
|
|
16
|
+
<CellRichTextInput value="" onChange={jest.fn()} onCommit={onCommit} />,
|
|
17
|
+
);
|
|
18
|
+
const editor = baseElement.querySelector('[data-hook="mock-editor"]')!;
|
|
19
|
+
return { onCommit, editor };
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
it('commits on Enter in the text', () => {
|
|
23
|
+
const { onCommit, editor } = setup();
|
|
24
|
+
fireEvent.keyDown(editor, { key: 'Enter' });
|
|
25
|
+
expect(onCommit).toHaveBeenCalledTimes(1);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('does not commit on Shift+Enter', () => {
|
|
29
|
+
const { onCommit, editor } = setup();
|
|
30
|
+
fireEvent.keyDown(editor, { key: 'Enter', shiftKey: true });
|
|
31
|
+
expect(onCommit).not.toHaveBeenCalled();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('does not commit on Enter outside the text (e.g. a toolbar input)', () => {
|
|
35
|
+
const { onCommit } = setup();
|
|
36
|
+
fireEvent.keyDown(document.body, { key: 'Enter' });
|
|
37
|
+
expect(onCommit).not.toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -412,6 +412,59 @@ describe('<RichContentEditor/>', () => {
|
|
|
412
412
|
});
|
|
413
413
|
});
|
|
414
414
|
|
|
415
|
+
describe('Enter key', () => {
|
|
416
|
+
const pressEnterInText = (opts: { shiftKey?: boolean } = {}) => {
|
|
417
|
+
const text = document.createElement('div');
|
|
418
|
+
text.setAttribute('contenteditable', 'true');
|
|
419
|
+
document.body.appendChild(text);
|
|
420
|
+
fireEvent.keyDown(text, { key: 'Enter', bubbles: true, ...opts });
|
|
421
|
+
text.remove();
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
it('closes fullscreen on Enter in the text when closeOnEnter is set', async () => {
|
|
425
|
+
renderWithProps({
|
|
426
|
+
fullScreenOnly: true,
|
|
427
|
+
closeOnEnter: true,
|
|
428
|
+
onExitFullScreen,
|
|
429
|
+
});
|
|
430
|
+
await waitFor(() =>
|
|
431
|
+
expect(screen.getByTestId('fullscreen-modal')).toBeInTheDocument(),
|
|
432
|
+
);
|
|
433
|
+
|
|
434
|
+
pressEnterInText();
|
|
435
|
+
|
|
436
|
+
await waitFor(() => expect(onExitFullScreen).toHaveBeenCalled());
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it('does not close on Shift+Enter', async () => {
|
|
440
|
+
renderWithProps({
|
|
441
|
+
fullScreenOnly: true,
|
|
442
|
+
closeOnEnter: true,
|
|
443
|
+
onExitFullScreen,
|
|
444
|
+
});
|
|
445
|
+
await waitFor(() =>
|
|
446
|
+
expect(screen.getByTestId('fullscreen-modal')).toBeInTheDocument(),
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
pressEnterInText({ shiftKey: true });
|
|
450
|
+
|
|
451
|
+
await nextRender();
|
|
452
|
+
expect(onExitFullScreen).not.toHaveBeenCalled();
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
it('does not close on Enter without closeOnEnter', async () => {
|
|
456
|
+
renderWithProps({ fullScreenOnly: true, onExitFullScreen });
|
|
457
|
+
await waitFor(() =>
|
|
458
|
+
expect(screen.getByTestId('fullscreen-modal')).toBeInTheDocument(),
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
pressEnterInText();
|
|
462
|
+
|
|
463
|
+
await nextRender();
|
|
464
|
+
expect(onExitFullScreen).not.toHaveBeenCalled();
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
|
|
415
468
|
describe('fullscreen mode', () => {
|
|
416
469
|
it('should open fullscreen modal when toggle button is clicked', async () => {
|
|
417
470
|
renderWithProps({
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isEnterInEditableText } from '../../utils/keyboard';
|
|
2
|
+
|
|
3
|
+
const press = (target: HTMLElement, init: KeyboardEventInit = {}) => {
|
|
4
|
+
let result: boolean | undefined;
|
|
5
|
+
target.addEventListener('keydown', (e) => {
|
|
6
|
+
result = isEnterInEditableText(e);
|
|
7
|
+
});
|
|
8
|
+
target.dispatchEvent(
|
|
9
|
+
new KeyboardEvent('keydown', { key: 'Enter', bubbles: true, ...init }),
|
|
10
|
+
);
|
|
11
|
+
return result;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
describe('isEnterInEditableText', () => {
|
|
15
|
+
const editable = () => {
|
|
16
|
+
const outer = document.createElement('div');
|
|
17
|
+
outer.setAttribute('contenteditable', 'true');
|
|
18
|
+
const inner = document.createElement('span');
|
|
19
|
+
outer.appendChild(inner);
|
|
20
|
+
document.body.appendChild(outer);
|
|
21
|
+
return inner;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
it('is true for Enter inside editable text', () => {
|
|
25
|
+
expect(press(editable())).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('is false for Shift+Enter', () => {
|
|
29
|
+
expect(press(editable(), { shiftKey: true })).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('is false while composing (IME)', () => {
|
|
33
|
+
expect(press(editable(), { isComposing: true })).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('is false outside editable text (e.g. a toolbar input)', () => {
|
|
37
|
+
const input = document.createElement('input');
|
|
38
|
+
document.body.appendChild(input);
|
|
39
|
+
expect(press(input)).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('is false for other keys', () => {
|
|
43
|
+
expect(press(editable(), { key: 'a' })).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "addressinput840205872";
|
|
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":"addressinput840205872__root","tableAddressInput":"addressinput840205872__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_ = "actionsmenu994746356";
|
|
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":"actionsmenu994746356__root","action":"actionsmenu994746356__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_ = "formaudiofield1744934343";
|
|
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":"formaudiofield1744934343__root","addItem":"formaudiofield1744934343__addItem","mediaTitle":"formaudiofield1744934343__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_ = "audioplayer2787508242";
|
|
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":"audioplayer2787508242__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
useCallback,
|
|
4
|
+
useImperativeHandle,
|
|
5
|
+
useRef,
|
|
6
|
+
} from 'react';
|
|
2
7
|
import type { CheckboxProps } from '@wix/design-system';
|
|
3
8
|
import { Checkbox } from '@wix/design-system';
|
|
4
9
|
|
|
@@ -8,20 +13,37 @@ export interface CellCheckboxProps
|
|
|
8
13
|
onChange?(checked: boolean): void;
|
|
9
14
|
}
|
|
10
15
|
|
|
16
|
+
export interface CellCheckboxHandle {
|
|
17
|
+
focus(): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
/**
|
|
12
21
|
* Cell-layer Checkbox — fires onChange on toggle. Thin wrapper around
|
|
13
22
|
* WDS Checkbox with cell-friendly prop types (boolean instead of event).
|
|
14
23
|
*/
|
|
15
|
-
export const CellCheckbox
|
|
16
|
-
checked,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
export const CellCheckbox = forwardRef<CellCheckboxHandle, CellCheckboxProps>(
|
|
25
|
+
({ checked, onChange, ...props }, ref) => {
|
|
26
|
+
// WDS types this ref as an element, but it resolves to the Checkbox,
|
|
27
|
+
// whose focus() focuses the input and shows the keyboard focus ring.
|
|
28
|
+
const checkboxRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
|
|
30
|
+
useImperativeHandle(ref, () => ({
|
|
31
|
+
focus: () => checkboxRef.current?.focus(),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
const handleChange = useCallback(() => {
|
|
35
|
+
onChange?.(!checked);
|
|
36
|
+
}, [checked, onChange]);
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
return (
|
|
39
|
+
<Checkbox
|
|
40
|
+
{...props}
|
|
41
|
+
ref={checkboxRef}
|
|
42
|
+
checked={checked}
|
|
43
|
+
onChange={handleChange}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
26
48
|
|
|
27
49
|
CellCheckbox.displayName = 'CellCheckbox';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "cellcolorview1285518022";
|
|
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":"cellcolorview1285518022__root","hashPrefix":"cellcolorview1285518022__hashPrefix"};
|
|
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_ = "colorview1355180041";
|
|
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":"colorview1355180041__root","view":"colorview1355180041__view","fillPreview":"colorview1355180041__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_ = "deletedialog2793524866";
|
|
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":"deletedialog2793524866__root","layout":"deletedialog2793524866__layout"};
|
|
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_ = "formdocumentfield3083378965";
|
|
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":"formdocumentfield3083378965__root","viewWrapper":"formdocumentfield3083378965__viewWrapper","textWidth":"formdocumentfield3083378965__textWidth","documentLoader":"formdocumentfield3083378965__documentLoader","addDocument":"formdocumentfield3083378965__addDocument","addItemWrapper":"formdocumentfield3083378965__addItemWrapper"};
|
|
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_ = "exclamation2723601405";
|
|
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":"exclamation2723601405__root","exclamation":"exclamation2723601405__exclamation","actions":"exclamation2723601405__actions","action":"exclamation2723601405__action"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|