@squiz/formatted-text-editor 2.4.0 → 2.6.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/CHANGELOG.md +12 -0
- package/demo/{App.tsx → diff/App.tsx} +3 -7
- package/demo/{AppContext.tsx → diff/AppContext.tsx} +15 -10
- package/demo/diff/index.html +14 -0
- package/demo/{index.scss → diff/index.scss} +3 -0
- package/demo/{main.tsx → diff/main.tsx} +1 -1
- package/demo/index.html +47 -2
- package/demo/portals/Accordion.tsx +50 -0
- package/demo/portals/App.tsx +150 -0
- package/demo/portals/index.html +13 -0
- package/demo/portals/index.scss +8 -0
- package/demo/portals/index.tsx +12 -0
- package/demo/portals/preview.html +91 -0
- package/demo/portals/preview.tsx +10 -0
- package/lib/Editor/Editor.d.ts +11 -6
- package/lib/Editor/Editor.js +17 -26
- package/lib/EditorToolbar/Toolbar.d.ts +2 -1
- package/lib/EditorToolbar/Toolbar.js +4 -2
- package/lib/EditorToolbar/Tools/Image/Form/ImageForm.js +0 -3
- package/lib/Extensions/CodeBlockExtension/CodeBlockExtension.d.ts +13 -3
- package/lib/Extensions/CodeBlockExtension/CodeBlockExtension.js +74 -8
- package/lib/Extensions/Extensions.d.ts +1 -1
- package/lib/Extensions/Extensions.js +3 -3
- package/lib/Extensions/PreformattedExtension/PreformattedExtension.d.ts +5 -2
- package/lib/Extensions/PreformattedExtension/PreformattedExtension.js +8 -1
- package/lib/hooks/index.d.ts +3 -2
- package/lib/hooks/index.js +3 -2
- package/lib/hooks/useFocus/useFocus.d.ts +6 -0
- package/lib/hooks/{useFocus.js → useFocus/useFocus.js} +29 -15
- package/lib/index.css +164 -5
- package/lib/ui/EditorInput/EditorInput.d.ts +3 -0
- package/lib/ui/EditorInput/EditorInput.js +49 -0
- package/lib/ui/EditorInput/EditorInput.props.d.ts +4 -0
- package/lib/ui/EditorInput/EditorInput.props.js +2 -0
- package/lib/utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode.js +0 -3
- package/lib/utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode.js +0 -6
- package/package.json +5 -4
- package/src/Editor/Editor.spec.tsx +36 -10
- package/src/Editor/Editor.tsx +48 -44
- package/src/Editor/_editor.scss +4 -0
- package/src/EditorToolbar/Toolbar.tsx +8 -4
- package/src/EditorToolbar/Tools/Image/Form/ImageForm.tsx +0 -3
- package/src/EditorToolbar/Tools/TextType/CodeBlock/CodeBlockButton.tsx +3 -3
- package/src/EditorToolbar/_toolbar.scss +3 -2
- package/src/Extensions/CodeBlockExtension/CodeBlockExtension.props.ts +3 -0
- package/src/Extensions/CodeBlockExtension/CodeBlockExtension.spec.ts +59 -0
- package/src/Extensions/CodeBlockExtension/CodeBlockExtension.ts +82 -7
- package/src/Extensions/Extensions.ts +4 -4
- package/src/Extensions/PreformattedExtension/PreformattedExtension.ts +15 -3
- package/src/hooks/index.ts +3 -2
- package/src/hooks/useFocus/useFocus.spec.tsx +48 -0
- package/src/hooks/useFocus/useFocus.ts +71 -0
- package/src/ui/EditorInput/EditorInput.props.ts +5 -0
- package/src/ui/EditorInput/EditorInput.spec.tsx +38 -0
- package/src/ui/EditorInput/EditorInput.tsx +30 -0
- package/src/utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode.spec.ts +1 -3
- package/src/utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode.ts +0 -4
- package/src/utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode.spec.ts +1 -4
- package/src/utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode.ts +0 -5
- package/tests/mockResourceBrowserContext.tsx +17 -1
- package/tests/renderWithContext.tsx +3 -0
- package/lib/hooks/useFocus.d.ts +0 -8
- package/src/hooks/useFocus.ts +0 -61
- /package/demo/{resources.json → diff/resources.json} +0 -0
- /package/demo/{sources.json → diff/sources.json} +0 -0
- /package/demo/{vite-env.d.ts → diff/vite-env.d.ts} +0 -0
- /package/lib/hooks/{useExpandedSelection.d.ts → useExpandedSelection/useExpandedSelection.d.ts} +0 -0
- /package/lib/hooks/{useExpandedSelection.js → useExpandedSelection/useExpandedSelection.js} +0 -0
- /package/lib/hooks/{useExtensionNames.d.ts → useExtensionNames/useExtensionNames.d.ts} +0 -0
- /package/lib/hooks/{useExtensionNames.js → useExtensionNames/useExtensionNames.js} +0 -0
- /package/src/hooks/{useExpandedSelection.ts → useExpandedSelection/useExpandedSelection.ts} +0 -0
- /package/src/hooks/{useExtensionNames.ts → useExtensionNames/useExtensionNames.ts} +0 -0
@@ -23,9 +23,10 @@ const HorizontalLineButton_1 = __importDefault(require("./Tools/HorizontalLine/H
|
|
23
23
|
const TableButton_1 = __importDefault(require("./Tools/Table/TableButton"));
|
24
24
|
const ContentToolsDropdown_1 = __importDefault(require("./Tools/ContentTools/ContentToolsDropdown"));
|
25
25
|
const hooks_1 = require("../hooks");
|
26
|
-
const
|
26
|
+
const react_dom_1 = require("react-dom");
|
27
|
+
const Toolbar = ({ isVisible, enableTableTool, container }) => {
|
27
28
|
const extensionNames = (0, hooks_1.useExtensionNames)();
|
28
|
-
|
29
|
+
const toolbar = (react_1.default.createElement(react_components_1.Toolbar, { className: (0, clsx_1.default)('editor-toolbar header-toolbar', isVisible && 'show-toolbar', container && 'fte-portal-toolbar'), role: "toolbar", tabIndex: 0 },
|
29
30
|
react_1.default.createElement("div", { className: "editor-toolbar__tools" },
|
30
31
|
extensionNames.history && (react_1.default.createElement(react_1.default.Fragment, null,
|
31
32
|
react_1.default.createElement(UndoButton_1.default, null),
|
@@ -45,5 +46,6 @@ const Toolbar = ({ isVisible, enableTableTool }) => {
|
|
45
46
|
extensionNames.clearFormatting && react_1.default.createElement(ClearFormattingButton_1.default, null),
|
46
47
|
enableTableTool && extensionNames.table && react_1.default.createElement(TableButton_1.default, null),
|
47
48
|
react_1.default.createElement(ContentToolsDropdown_1.default, null))));
|
49
|
+
return container ? (0, react_dom_1.createPortal)(toolbar, container) : toolbar;
|
48
50
|
};
|
49
51
|
exports.Toolbar = Toolbar;
|
@@ -104,13 +104,11 @@ const ImageForm = ({ data, onSubmit }) => {
|
|
104
104
|
setViewType(value);
|
105
105
|
// If its the URL field type we know what the imageType should be
|
106
106
|
if (value === ViewTypes.URL) {
|
107
|
-
console.log(`handleChangeViewType: ${value} NodeName.Image`);
|
108
107
|
setValue('imageType', Extensions_1.NodeName.Image);
|
109
108
|
}
|
110
109
|
else {
|
111
110
|
// Need a value here and this is the assumed default elsewhere
|
112
111
|
// Will be set again later once Resource Browser returns a resource value
|
113
|
-
console.log(`handleChangeViewType: ${value} NodeName.AssetImage`);
|
114
112
|
setValue('imageType', Extensions_1.NodeName.AssetImage);
|
115
113
|
}
|
116
114
|
}, [setViewType, setValue]);
|
@@ -178,7 +176,6 @@ const ImageForm = ({ data, onSubmit }) => {
|
|
178
176
|
return matrixValidation && damValidation;
|
179
177
|
},
|
180
178
|
}, render: ({ field: { onChange, value }, fieldState: { error } }) => (react_1.default.createElement(ResourceBrowserSelector_1.ResourceBrowserSelector, { modalTitle: "Insert image", allowedTypes: ['image'], value: value, onChange: (value) => {
|
181
|
-
console.log(`onChange: ${value}`);
|
182
179
|
setValue('imageType', value.target.value.nodeType);
|
183
180
|
onChange(value);
|
184
181
|
}, error: error?.message })) })))));
|
@@ -1,5 +1,15 @@
|
|
1
|
-
import {
|
1
|
+
import { ApplySchemaAttributes, CommandFunction, NodeExtension, NodeExtensionSpec, NodeSpecOverride } from '@remirror/core';
|
2
2
|
import { NodeViewMethod } from 'remirror';
|
3
|
-
export
|
4
|
-
|
3
|
+
export type CodeBlockOptions = {
|
4
|
+
enableDecorations?: boolean;
|
5
|
+
};
|
6
|
+
export declare class CodeBlockExtension extends NodeExtension<CodeBlockOptions> {
|
7
|
+
get name(): "codeBlock";
|
8
|
+
createTags(): ("block" | "code")[];
|
9
|
+
createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;
|
10
|
+
createNodeViews(): NodeViewMethod | Record<string, never>;
|
11
|
+
/**
|
12
|
+
* Toggle the <code> for the current block.
|
13
|
+
*/
|
14
|
+
toggleCodeBlock(): CommandFunction;
|
5
15
|
}
|
@@ -1,18 +1,65 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const
|
5
|
-
|
9
|
+
exports.CodeBlockExtension = void 0;
|
10
|
+
const core_1 = require("@remirror/core");
|
11
|
+
const remirror_1 = require("remirror");
|
12
|
+
let CodeBlockExtension = class CodeBlockExtension extends core_1.NodeExtension {
|
13
|
+
get name() {
|
14
|
+
return 'codeBlock';
|
15
|
+
}
|
16
|
+
createTags() {
|
17
|
+
return [core_1.ExtensionTag.Block, core_1.ExtensionTag.Code];
|
18
|
+
}
|
19
|
+
createNodeSpec(extra, override) {
|
20
|
+
return {
|
21
|
+
content: 'text*',
|
22
|
+
marks: '',
|
23
|
+
defining: true,
|
24
|
+
isolating: true,
|
25
|
+
draggable: false,
|
26
|
+
...override,
|
27
|
+
code: true,
|
28
|
+
attrs: {
|
29
|
+
...extra.defaults(),
|
30
|
+
},
|
31
|
+
parseDOM: [
|
32
|
+
{
|
33
|
+
tag: 'code',
|
34
|
+
preserveWhitespace: 'full',
|
35
|
+
},
|
36
|
+
{
|
37
|
+
tag: 'pre',
|
38
|
+
preserveWhitespace: 'full',
|
39
|
+
getAttrs: (node) => {
|
40
|
+
if (!(0, remirror_1.isElementDomNode)(node) || !(0, remirror_1.isElementDomNode)(node.querySelector('code'))) {
|
41
|
+
return false;
|
42
|
+
}
|
43
|
+
return extra.parse(node);
|
44
|
+
},
|
45
|
+
},
|
46
|
+
],
|
47
|
+
toDOM: (node) => {
|
48
|
+
return ['code', extra.dom(node), 0];
|
49
|
+
},
|
50
|
+
};
|
51
|
+
}
|
6
52
|
createNodeViews() {
|
7
|
-
|
8
|
-
|
53
|
+
if (!this.options.enableDecorations) {
|
54
|
+
return {};
|
55
|
+
}
|
56
|
+
return () => {
|
9
57
|
// This is the pre container for the code block
|
10
58
|
const dom = document.createElement('pre');
|
11
59
|
dom.setAttribute('spellcheck', 'false');
|
12
60
|
dom.classList.add(`code-block`);
|
13
61
|
// This is the actual code content in the code block
|
14
62
|
const contentDOM = document.createElement('code');
|
15
|
-
contentDOM.setAttribute('data-code-block-language', language);
|
16
63
|
// Divider between code block and pre container
|
17
64
|
const dividerElement = document.createElement('div');
|
18
65
|
dividerElement.classList.add('block-divider');
|
@@ -26,5 +73,24 @@ class ExtendedCodeBlockExtension extends extension_code_block_1.CodeBlockExtensi
|
|
26
73
|
return { dom, contentDOM };
|
27
74
|
};
|
28
75
|
}
|
29
|
-
|
30
|
-
|
76
|
+
/**
|
77
|
+
* Toggle the <code> for the current block.
|
78
|
+
*/
|
79
|
+
toggleCodeBlock() {
|
80
|
+
return (0, core_1.toggleBlockItem)({
|
81
|
+
type: this.type,
|
82
|
+
toggleType: 'paragraph',
|
83
|
+
});
|
84
|
+
}
|
85
|
+
};
|
86
|
+
__decorate([
|
87
|
+
(0, core_1.command)()
|
88
|
+
], CodeBlockExtension.prototype, "toggleCodeBlock", null);
|
89
|
+
CodeBlockExtension = __decorate([
|
90
|
+
(0, core_1.extension)({
|
91
|
+
defaultOptions: {
|
92
|
+
enableDecorations: false,
|
93
|
+
},
|
94
|
+
})
|
95
|
+
], CodeBlockExtension);
|
96
|
+
exports.CodeBlockExtension = CodeBlockExtension;
|
@@ -15,4 +15,4 @@ export declare enum MarkName {
|
|
15
15
|
Link = "link",
|
16
16
|
AssetLink = "assetLink"
|
17
17
|
}
|
18
|
-
export declare const createExtensions: (context: EditorContextOptions) => () => Extension[];
|
18
|
+
export declare const createExtensions: (context: EditorContextOptions, enableDecorations?: boolean) => () => Extension[];
|
@@ -32,7 +32,7 @@ var MarkName;
|
|
32
32
|
MarkName["Link"] = "link";
|
33
33
|
MarkName["AssetLink"] = "assetLink";
|
34
34
|
})(MarkName = exports.MarkName || (exports.MarkName = {}));
|
35
|
-
const createExtensions = (context) => {
|
35
|
+
const createExtensions = (context, enableDecorations = true) => {
|
36
36
|
return () => {
|
37
37
|
return [
|
38
38
|
new CommandsExtension_1.CommandsExtension(),
|
@@ -43,8 +43,8 @@ const createExtensions = (context) => {
|
|
43
43
|
new extensions_1.NodeFormattingExtension({ indents: [] }),
|
44
44
|
new extensions_1.ParagraphExtension(),
|
45
45
|
new extensions_1.HardBreakExtension(),
|
46
|
-
new
|
47
|
-
new
|
46
|
+
new CodeBlockExtension_1.CodeBlockExtension({ enableDecorations }),
|
47
|
+
new PreformattedExtension_1.PreformattedExtension({ enableDecorations }),
|
48
48
|
new extensions_1.UnderlineExtension(),
|
49
49
|
new extensions_1.HistoryExtension(),
|
50
50
|
new ImageExtension_1.ImageExtension(),
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { ApplySchemaAttributes, CommandFunction, NodeExtension, NodeExtensionSpec, NodeSpecOverride } from '@remirror/core';
|
2
2
|
import { NodeViewMethod } from 'remirror';
|
3
|
-
export
|
3
|
+
export type PreformattedExtensionOptions = {
|
4
|
+
enableDecorations?: boolean;
|
5
|
+
};
|
6
|
+
export declare class PreformattedExtension extends NodeExtension<PreformattedExtensionOptions> {
|
4
7
|
get name(): "preformatted";
|
5
8
|
createTags(): ("block" | "formattingNode" | "textBlock")[];
|
6
9
|
createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;
|
7
|
-
createNodeViews(): NodeViewMethod
|
10
|
+
createNodeViews(): NodeViewMethod | Record<string, never>;
|
8
11
|
/**
|
9
12
|
* Toggle the <pre> for the current block.
|
10
13
|
*/
|
@@ -35,6 +35,9 @@ let PreformattedExtension = class PreformattedExtension extends core_1.NodeExten
|
|
35
35
|
};
|
36
36
|
}
|
37
37
|
createNodeViews() {
|
38
|
+
if (!this.options.enableDecorations) {
|
39
|
+
return {};
|
40
|
+
}
|
38
41
|
return (node) => {
|
39
42
|
const { nodeTextAlignment } = node.attrs;
|
40
43
|
// This is the pre container for the code block
|
@@ -71,6 +74,10 @@ __decorate([
|
|
71
74
|
(0, core_1.command)()
|
72
75
|
], PreformattedExtension.prototype, "togglePreformatted", null);
|
73
76
|
PreformattedExtension = __decorate([
|
74
|
-
(0, core_1.extension)({
|
77
|
+
(0, core_1.extension)({
|
78
|
+
defaultOptions: {
|
79
|
+
enableDecorations: false,
|
80
|
+
},
|
81
|
+
})
|
75
82
|
], PreformattedExtension);
|
76
83
|
exports.PreformattedExtension = PreformattedExtension;
|
package/lib/hooks/index.d.ts
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
export * from './useExtensionNames';
|
2
|
-
export * from './useExpandedSelection';
|
1
|
+
export * from './useExtensionNames/useExtensionNames';
|
2
|
+
export * from './useExpandedSelection/useExpandedSelection';
|
3
|
+
export * from './useFocus/useFocus';
|
package/lib/hooks/index.js
CHANGED
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./useExtensionNames"), exports);
|
18
|
-
__exportStar(require("./useExpandedSelection"), exports);
|
17
|
+
__exportStar(require("./useExtensionNames/useExtensionNames"), exports);
|
18
|
+
__exportStar(require("./useExpandedSelection/useExpandedSelection"), exports);
|
19
|
+
__exportStar(require("./useFocus/useFocus"), exports);
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { FocusEvent as ReactFocusEvent, FocusEventHandler } from 'react';
|
2
|
+
export declare const useFocus: (initialState: boolean, isChildElement: (element: Element) => boolean) => {
|
3
|
+
handleFocus: (event: ReactFocusEvent) => void;
|
4
|
+
handleBlur: FocusEventHandler<HTMLDivElement>;
|
5
|
+
isFocused: boolean;
|
6
|
+
};
|
@@ -1,16 +1,23 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useFocus = void 0;
|
3
4
|
const react_1 = require("react");
|
4
|
-
const useFocus = (initialState) => {
|
5
|
-
const
|
6
|
-
const
|
5
|
+
const useFocus = (initialState, isChildElement) => {
|
6
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(initialState);
|
7
|
+
const getFocusedElement = (0, react_1.useCallback)(() => {
|
8
|
+
let element = document.activeElement;
|
9
|
+
while (element instanceof HTMLIFrameElement) {
|
10
|
+
element = element.contentDocument?.activeElement || null;
|
11
|
+
}
|
12
|
+
return element?.parentElement ? element : null;
|
13
|
+
}, []);
|
7
14
|
const handleFocus = (0, react_1.useCallback)((event) => {
|
8
15
|
// Ignore elements flagged to be ignored, this allows us to add extra, clickable, elements
|
9
16
|
// without triggering a focus, such as action menus.
|
10
17
|
if (!event.target?.classList?.contains('fte-ignore') && !event.target?.closest('.fte-ignore')) {
|
11
|
-
|
18
|
+
setIsFocused(true);
|
12
19
|
}
|
13
|
-
}, [
|
20
|
+
}, []);
|
14
21
|
const handleBlur = (0, react_1.useCallback)((event) => {
|
15
22
|
// React event bubbling is interesting, it bubbles up the React tree rather than the DOM tree.
|
16
23
|
// The tree deviates when rendering portals (eg. for modals).
|
@@ -30,14 +37,21 @@ const useFocus = (initialState) => {
|
|
30
37
|
//
|
31
38
|
// An assumption here is that anything in a portal will only blur to another element that is also in the portal
|
32
39
|
// (and therefore still in our React tree resulting in the element still effectively being focused).
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
// TODO: PLATFORM-1611 this shit still doesn't work properly, notably issues with the link/image modals.
|
41
|
+
requestAnimationFrame(() => {
|
42
|
+
// "relatedTarget" in the event object will be null if the element gaining focus is in a different
|
43
|
+
// document to the element being blurred (eg. floating toolbar rendered in top level frame,
|
44
|
+
// editor rendered in iframe). instead grab the active element to determine current focus.
|
45
|
+
const isBlurringEditor = isChildElement(event.target);
|
46
|
+
const focusedElement = event.relatedTarget || getFocusedElement();
|
47
|
+
const isFocusedInEditor = focusedElement && isChildElement(focusedElement);
|
48
|
+
// Detect if the blur event happens when the related/clicked target is the floating popover
|
49
|
+
const isClickingFloatingToolbar = !!focusedElement?.closest('.squiz-fte-scope__floating-popover');
|
50
|
+
if (isBlurringEditor && !isFocusedInEditor && !isClickingFloatingToolbar) {
|
51
|
+
setIsFocused(false);
|
52
|
+
}
|
53
|
+
});
|
54
|
+
}, [getFocusedElement, isChildElement]);
|
55
|
+
return { handleFocus, handleBlur, isFocused };
|
42
56
|
};
|
43
|
-
exports.
|
57
|
+
exports.useFocus = useFocus;
|
package/lib/index.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded";
|
2
2
|
|
3
|
-
/* node_modules/@squiz/sds/lib/package.css */
|
3
|
+
/* ../../node_modules/@squiz/sds/lib/package.css */
|
4
4
|
.squiz-fte-scope code[class*=language-],
|
5
5
|
.squiz-fte-scope pre[class*=language-] {
|
6
6
|
color: #ccc;
|
@@ -280,6 +280,9 @@
|
|
280
280
|
margin-right: 0.5rem;
|
281
281
|
max-width: 100%;
|
282
282
|
}
|
283
|
+
.squiz-fte-scope .sds-alert__title .svg-wrapper svg {
|
284
|
+
fill: #3d3d3d;
|
285
|
+
}
|
283
286
|
.squiz-fte-scope .sds-alert__buttons {
|
284
287
|
display: flex;
|
285
288
|
margin-bottom: 0.375rem;
|
@@ -1100,6 +1103,9 @@
|
|
1100
1103
|
letter-spacing: -0.5px;
|
1101
1104
|
line-height: 1.5rem;
|
1102
1105
|
}
|
1106
|
+
.squiz-fte-scope .sds-card-title .svg-wrapper svg {
|
1107
|
+
fill: #3d3d3d;
|
1108
|
+
}
|
1103
1109
|
.squiz-fte-scope .sds-card-subtitle {
|
1104
1110
|
font-size: 1rem;
|
1105
1111
|
font-weight: 700;
|
@@ -2020,6 +2026,9 @@
|
|
2020
2026
|
line-height: 1.25rem;
|
2021
2027
|
color: #3d3d3d;
|
2022
2028
|
}
|
2029
|
+
.squiz-fte-scope .sds-data-list__title .svg-wrapper svg {
|
2030
|
+
fill: #3d3d3d;
|
2031
|
+
}
|
2023
2032
|
@media screen and (min-width: 768px) {
|
2024
2033
|
.squiz-fte-scope .sds-data-list__icon + div {
|
2025
2034
|
align-items: center;
|
@@ -2136,6 +2145,9 @@
|
|
2136
2145
|
letter-spacing: -0.5px;
|
2137
2146
|
line-height: 1.5rem;
|
2138
2147
|
}
|
2148
|
+
.squiz-fte-scope .sds-dialog__heading span .svg-wrapper svg {
|
2149
|
+
fill: #3d3d3d;
|
2150
|
+
}
|
2139
2151
|
.squiz-fte-scope .sds-dialog__icon {
|
2140
2152
|
flex-shrink: 0;
|
2141
2153
|
margin-right: 0.75rem;
|
@@ -2318,7 +2330,7 @@
|
|
2318
2330
|
.squiz-fte-scope .sds-dropdown-label {
|
2319
2331
|
display: block;
|
2320
2332
|
padding: 0.5rem;
|
2321
|
-
word-break: break-
|
2333
|
+
word-break: break-word;
|
2322
2334
|
}
|
2323
2335
|
.squiz-fte-scope .sds-empty-state-card {
|
2324
2336
|
align-items: center;
|
@@ -2355,6 +2367,9 @@
|
|
2355
2367
|
margin-top: 1rem;
|
2356
2368
|
text-align: center;
|
2357
2369
|
}
|
2370
|
+
.squiz-fte-scope .sds-empty-state-card__title .svg-wrapper svg {
|
2371
|
+
fill: #3d3d3d;
|
2372
|
+
}
|
2358
2373
|
.squiz-fte-scope .sds-empty-state-card__icon > svg {
|
2359
2374
|
height: 11rem;
|
2360
2375
|
width: auto;
|
@@ -2818,11 +2833,21 @@
|
|
2818
2833
|
font-weight: 600;
|
2819
2834
|
margin-bottom: 0.25rem;
|
2820
2835
|
}
|
2836
|
+
.squiz-fte-scope .sds-form-control-text {
|
2837
|
+
align-items: center;
|
2838
|
+
display: flex;
|
2839
|
+
}
|
2821
2840
|
.squiz-fte-scope .sds-form-control-label {
|
2822
2841
|
color: #3d3d3d;
|
2823
2842
|
flex-grow: 1;
|
2824
2843
|
text-align: left;
|
2825
|
-
word-break: break-
|
2844
|
+
word-break: break-word;
|
2845
|
+
}
|
2846
|
+
.squiz-fte-scope .sds-form-control--prominent .sds-form-control-item {
|
2847
|
+
margin-bottom: 1.25rem;
|
2848
|
+
}
|
2849
|
+
.squiz-fte-scope .sds-form-control--prominent .sds-form-control-item:last-child {
|
2850
|
+
margin-bottom: 0;
|
2826
2851
|
}
|
2827
2852
|
.squiz-fte-scope ::-moz-placeholder {
|
2828
2853
|
color: #949494;
|
@@ -2941,6 +2966,9 @@
|
|
2941
2966
|
display: block;
|
2942
2967
|
margin-bottom: 0.75rem;
|
2943
2968
|
}
|
2969
|
+
.squiz-fte-scope .sds-link-list__heading .svg-wrapper svg {
|
2970
|
+
fill: #3d3d3d;
|
2971
|
+
}
|
2944
2972
|
.squiz-fte-scope .sds-link-list {
|
2945
2973
|
list-style-type: none;
|
2946
2974
|
margin: 0;
|
@@ -3045,6 +3073,9 @@
|
|
3045
3073
|
display: block;
|
3046
3074
|
margin-bottom: 0.75rem;
|
3047
3075
|
}
|
3076
|
+
.squiz-fte-scope .sds-row__title .svg-wrapper svg {
|
3077
|
+
fill: #3d3d3d;
|
3078
|
+
}
|
3048
3079
|
.squiz-fte-scope .sds-row__title:only-child,
|
3049
3080
|
.squiz-fte-scope .sds-row__title:last-child {
|
3050
3081
|
margin-bottom: 0;
|
@@ -3057,36 +3088,54 @@
|
|
3057
3088
|
margin-bottom: 1.75rem;
|
3058
3089
|
margin-top: 1.75rem;
|
3059
3090
|
}
|
3091
|
+
.squiz-fte-scope .sds-heading--level-1 .svg-wrapper svg {
|
3092
|
+
fill: #3d3d3d;
|
3093
|
+
}
|
3060
3094
|
.squiz-fte-scope .sds-heading--level-2 {
|
3061
3095
|
font-size: 1.25rem;
|
3062
3096
|
font-weight: 600;
|
3063
3097
|
letter-spacing: -0.5px;
|
3064
3098
|
line-height: 1.5rem;
|
3065
3099
|
}
|
3100
|
+
.squiz-fte-scope .sds-heading--level-2 .svg-wrapper svg {
|
3101
|
+
fill: #3d3d3d;
|
3102
|
+
}
|
3066
3103
|
.squiz-fte-scope .sds-heading--level-3 {
|
3067
3104
|
font-size: 1.125rem;
|
3068
3105
|
font-weight: 600;
|
3069
3106
|
letter-spacing: -0.2px;
|
3070
3107
|
line-height: 1.375rem;
|
3071
3108
|
}
|
3109
|
+
.squiz-fte-scope .sds-heading--level-3 .svg-wrapper svg {
|
3110
|
+
fill: #3d3d3d;
|
3111
|
+
}
|
3072
3112
|
.squiz-fte-scope .sds-heading--level-4 {
|
3073
3113
|
font-size: 1rem;
|
3074
3114
|
font-weight: 700;
|
3075
3115
|
letter-spacing: -0.2px;
|
3076
3116
|
line-height: 1.25rem;
|
3077
3117
|
}
|
3118
|
+
.squiz-fte-scope .sds-heading--level-4 .svg-wrapper svg {
|
3119
|
+
fill: #3d3d3d;
|
3120
|
+
}
|
3078
3121
|
.squiz-fte-scope .sds-heading--level-5 {
|
3079
3122
|
font-size: 1rem;
|
3080
3123
|
font-weight: 600;
|
3081
3124
|
letter-spacing: -0.2px;
|
3082
3125
|
line-height: 1.25rem;
|
3083
3126
|
}
|
3127
|
+
.squiz-fte-scope .sds-heading--level-5 .svg-wrapper svg {
|
3128
|
+
fill: #3d3d3d;
|
3129
|
+
}
|
3084
3130
|
.squiz-fte-scope .sds-heading--level-6 {
|
3085
3131
|
font-size: 0.875rem;
|
3086
3132
|
font-weight: 600;
|
3087
3133
|
letter-spacing: -0.2px;
|
3088
3134
|
line-height: 1.25rem;
|
3089
3135
|
}
|
3136
|
+
.squiz-fte-scope .sds-heading--level-6 .svg-wrapper svg {
|
3137
|
+
fill: #3d3d3d;
|
3138
|
+
}
|
3090
3139
|
.squiz-fte-scope .sds-text--sm-regular {
|
3091
3140
|
font-size: 0.8125rem;
|
3092
3141
|
font-weight: 400;
|
@@ -4175,6 +4224,9 @@
|
|
4175
4224
|
margin-bottom: 1rem;
|
4176
4225
|
margin-top: 0;
|
4177
4226
|
}
|
4227
|
+
.squiz-fte-scope .sds-popover__title .svg-wrapper svg {
|
4228
|
+
fill: #3d3d3d;
|
4229
|
+
}
|
4178
4230
|
.squiz-fte-scope .sds-popover--left .sds-popover__content-wrapper {
|
4179
4231
|
bottom: 50%;
|
4180
4232
|
right: calc(100% + 1rem);
|
@@ -4214,6 +4266,108 @@
|
|
4214
4266
|
.squiz-fte-scope .sds-popover--medium .sds-popover__content-wrapper {
|
4215
4267
|
width: 400px;
|
4216
4268
|
}
|
4269
|
+
.squiz-fte-scope .sds-sequence-list.presentation-only .sds-sequence-list__item-content {
|
4270
|
+
margin-right: unset;
|
4271
|
+
}
|
4272
|
+
.squiz-fte-scope .sds-sequence-list__item {
|
4273
|
+
background-color: #ededed;
|
4274
|
+
border-radius: 0.25rem;
|
4275
|
+
display: flex;
|
4276
|
+
gap: 0.75rem;
|
4277
|
+
padding: 0.75rem 1rem;
|
4278
|
+
position: relative;
|
4279
|
+
transition: 0.3s background-color ease-in;
|
4280
|
+
}
|
4281
|
+
.squiz-fte-scope .sds-sequence-list__item--dragging {
|
4282
|
+
background-color: #e0e0e0;
|
4283
|
+
}
|
4284
|
+
.squiz-fte-scope .sds-sequence-list__item:last-of-type::before {
|
4285
|
+
content: none;
|
4286
|
+
}
|
4287
|
+
.squiz-fte-scope .sds-sequence-list__list {
|
4288
|
+
display: flex;
|
4289
|
+
flex-direction: column;
|
4290
|
+
gap: 0.75rem;
|
4291
|
+
list-style-type: none;
|
4292
|
+
}
|
4293
|
+
.squiz-fte-scope .sds-sequence-list__list--dragging .sds-sequence-list__item-dots {
|
4294
|
+
display: none;
|
4295
|
+
}
|
4296
|
+
.squiz-fte-scope .sds-sequence-list__list--dragging .sds-tooltip {
|
4297
|
+
visibility: hidden;
|
4298
|
+
}
|
4299
|
+
.squiz-fte-scope .sds-sequence-list__item-content {
|
4300
|
+
display: flex;
|
4301
|
+
flex-direction: column;
|
4302
|
+
gap: 0.5rem;
|
4303
|
+
margin-right: 1.5rem;
|
4304
|
+
width: 100%;
|
4305
|
+
}
|
4306
|
+
@media screen and (min-width: 576px) {
|
4307
|
+
.squiz-fte-scope .sds-sequence-list__item-content {
|
4308
|
+
flex-direction: row;
|
4309
|
+
gap: 1rem;
|
4310
|
+
justify-content: space-evenly;
|
4311
|
+
}
|
4312
|
+
}
|
4313
|
+
.squiz-fte-scope .sds-sequence-list__item-content .sds-form-field {
|
4314
|
+
width: 100%;
|
4315
|
+
}
|
4316
|
+
.squiz-fte-scope .sds-sequence-list .sds-tooltip__wrapper {
|
4317
|
+
height: -moz-min-content;
|
4318
|
+
height: min-content;
|
4319
|
+
}
|
4320
|
+
.squiz-fte-scope .sds-sequence-list .sds-tooltip__wrapper:has(.sds-sequence-list__item-remove) {
|
4321
|
+
position: absolute;
|
4322
|
+
right: 1rem;
|
4323
|
+
top: 0.75rem;
|
4324
|
+
}
|
4325
|
+
.squiz-fte-scope .sds-sequence-list__item-remove--disabled {
|
4326
|
+
cursor: not-allowed;
|
4327
|
+
opacity: 0.5;
|
4328
|
+
}
|
4329
|
+
.squiz-fte-scope .sds-sequence-list__item-dots {
|
4330
|
+
left: -30px;
|
4331
|
+
position: absolute;
|
4332
|
+
width: 0.25rem;
|
4333
|
+
}
|
4334
|
+
.squiz-fte-scope .sds-sequence-list__item-index-mark {
|
4335
|
+
font-size: 0.875rem;
|
4336
|
+
font-weight: 400;
|
4337
|
+
letter-spacing: -0.2px;
|
4338
|
+
line-height: 1.25rem;
|
4339
|
+
background-color: #f5bb8c;
|
4340
|
+
border-radius: 100%;
|
4341
|
+
display: grid;
|
4342
|
+
height: 2rem;
|
4343
|
+
left: -0.75rem;
|
4344
|
+
place-items: center;
|
4345
|
+
position: absolute;
|
4346
|
+
top: 50%;
|
4347
|
+
transform: translate(-100%, -50%);
|
4348
|
+
width: 2rem;
|
4349
|
+
}
|
4350
|
+
.squiz-fte-scope .sds-sequence-list__item-drag-btn {
|
4351
|
+
align-self: baseline;
|
4352
|
+
}
|
4353
|
+
.squiz-fte-scope .sds-sequence-list__item-drag-btn svg {
|
4354
|
+
height: 1.5rem;
|
4355
|
+
width: 1.5rem;
|
4356
|
+
}
|
4357
|
+
.squiz-fte-scope .sds-sequence-list__item-drag-btn--disabled {
|
4358
|
+
opacity: 0.5;
|
4359
|
+
pointer-events: none;
|
4360
|
+
}
|
4361
|
+
.squiz-fte-scope .sds-sequence-list__add-item-btn {
|
4362
|
+
font-size: 0.875rem;
|
4363
|
+
font-weight: 600;
|
4364
|
+
letter-spacing: -0.2px;
|
4365
|
+
line-height: 1.25rem;
|
4366
|
+
align-items: center;
|
4367
|
+
display: flex;
|
4368
|
+
gap: 0.75rem;
|
4369
|
+
margin-left: 3rem;
|
4370
|
+
}
|
4217
4371
|
|
4218
4372
|
/* ../../node_modules/@squiz/dxp-content-tools-modal/lib/package.css */
|
4219
4373
|
.dxp-ctm-section .squiz-fte-scope.squiz-fte-scope__editor.squiz-fte-scope__editor--is-disabled.squiz-fte-scope__editor--bordered {
|
@@ -5145,6 +5299,11 @@
|
|
5145
5299
|
border-width: 2px;
|
5146
5300
|
border-style: solid;
|
5147
5301
|
}
|
5302
|
+
.squiz-fte-scope.squiz-fte-scope__editor--empty {
|
5303
|
+
height: 0px;
|
5304
|
+
width: 0px;
|
5305
|
+
border-width: 0px;
|
5306
|
+
}
|
5148
5307
|
.squiz-fte-scope.squiz-fte-scope__editor--is-disabled {
|
5149
5308
|
cursor: not-allowed;
|
5150
5309
|
border-width: 0px;
|
@@ -5511,11 +5670,11 @@
|
|
5511
5670
|
padding: 6px 8px;
|
5512
5671
|
}
|
5513
5672
|
.squiz-fte-scope .header-toolbar {
|
5673
|
+
opacity: 0;
|
5674
|
+
max-height: 0;
|
5514
5675
|
transition-duration: 0.3s;
|
5515
5676
|
transition-property: max-height, opacity;
|
5516
5677
|
transition-timing-function: ease-out;
|
5517
|
-
opacity: 0;
|
5518
|
-
max-height: 0;
|
5519
5678
|
}
|
5520
5679
|
.squiz-fte-scope .header-toolbar.show-toolbar {
|
5521
5680
|
opacity: 1;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.EditorInput = void 0;
|
27
|
+
const react_1 = require("@remirror/react");
|
28
|
+
const react_2 = __importStar(require("react"));
|
29
|
+
const react_dom_1 = require("react-dom");
|
30
|
+
const EditorInput = ({ container, ...other }) => {
|
31
|
+
const { getRootProps } = (0, react_1.useRemirrorContext)();
|
32
|
+
const { key, ...rootProps } = getRootProps();
|
33
|
+
const preventImagePaste = (0, react_2.useCallback)((event) => {
|
34
|
+
const { clipboardData } = event;
|
35
|
+
const pastedData = clipboardData?.files[0];
|
36
|
+
if (pastedData?.type &&
|
37
|
+
pastedData?.type.startsWith('image/') &&
|
38
|
+
// Still allow paste of any text that came through (Word, etc)
|
39
|
+
!clipboardData?.types.includes('text/plain')) {
|
40
|
+
event.preventDefault();
|
41
|
+
}
|
42
|
+
// Allow other paste event handlers to be run.
|
43
|
+
return false;
|
44
|
+
}, []);
|
45
|
+
const input = react_2.default.createElement("div", { key: key, ...rootProps, ...other });
|
46
|
+
(0, react_1.useEditorEvent)('paste', preventImagePaste);
|
47
|
+
return container ? (0, react_dom_1.createPortal)(input, container) : input;
|
48
|
+
};
|
49
|
+
exports.EditorInput = EditorInput;
|