@squiz/formatted-text-editor 1.21.1-alpha.6 → 1.21.1-alpha.9

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/demo/App.tsx CHANGED
@@ -1,13 +1,24 @@
1
1
  import React, { useState } from 'react';
2
2
  import FormattedTextEditor from '../src/FormattedTextEditor';
3
3
  import { RemirrorEventListener, Extension } from '@remirror/core';
4
+ import { remirrorNodeToSquizNode } from '../src/utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode';
5
+ import { squizNodeToRemirrorNode } from '../src/utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode';
6
+ import ReactDiffViewer from 'react-diff-viewer-continued';
4
7
 
5
8
  function App() {
6
- const [doc, setDoc] = useState(null as any);
9
+ const [doc, setDoc] = useState('');
10
+ const [squizDoc, setSquizDoc] = useState('');
11
+ const [reconvertedDoc, setReconvertedDoc] = useState('');
7
12
  const [editable, setEditable] = useState(true);
13
+
8
14
  const handleEditorChange: RemirrorEventListener<Extension> = (parameter) => {
9
15
  if (doc !== parameter.state.doc) {
10
- setDoc(parameter.state.doc);
16
+ const newSquizDoc = remirrorNodeToSquizNode(parameter.state.doc);
17
+ const newReconvertedDoc = parameter.state.schema.nodeFromJSON(squizNodeToRemirrorNode(newSquizDoc));
18
+
19
+ setDoc(JSON.stringify(parameter.state.doc, null, 2));
20
+ setSquizDoc(JSON.stringify(newSquizDoc, null, 2));
21
+ setReconvertedDoc(JSON.stringify(newReconvertedDoc, null, 2));
11
22
  }
12
23
  };
13
24
 
@@ -24,13 +35,16 @@ function App() {
24
35
  <div className="page-section">
25
36
  <FormattedTextEditor
26
37
  editable={editable}
27
- content={`<p>Hello <a href="https://www.google.com"><strong>Mr Bean</strong></a>, nice to <a href="https://www.google.com">meet you</a>.</p>`}
38
+ content={`<p>Hello <a href="https://www.google.com"><strong>Mr Bean</strong></a>, nice to <a href="https://www.google.com">meet you</a>.<img src="https://media2.giphy.com/media/3o6ozsIxg5legYvggo/giphy.gif" height="150" width="200"/></p>`}
28
39
  onChange={handleEditorChange}
29
40
  />
30
41
  </div>
31
42
  <h1>Document</h1>
32
43
  <div className="page-section">
33
- <code>{JSON.stringify(doc, null, 2)}</code>
44
+ <div className="code-section">
45
+ <ReactDiffViewer oldValue={doc} newValue={reconvertedDoc} splitView={false} showDiffOnly={false} />
46
+ <ReactDiffViewer oldValue={squizDoc} newValue={squizDoc} splitView={false} showDiffOnly={false} />
47
+ </div>
34
48
  </div>
35
49
  </div>
36
50
  );
package/demo/index.scss CHANGED
@@ -22,19 +22,25 @@ h1 {
22
22
  align-items: center;
23
23
  }
24
24
 
25
- code {
26
- padding: 8px;
27
- display: block;
28
- white-space: pre;
29
- background-color: #eee;
30
- font-size: 0.8rem;
31
- height: 40vh;
32
- max-height: 40vh;
25
+ .code-section {
26
+ display: flex;
27
+ flex-direction: row;
28
+ gap: 8px;
29
+ height: 35vh;
33
30
  overflow: scroll;
34
31
  }
35
32
 
36
33
  .remirror-editor {
37
- height: 40vh;
38
- max-height: 40vh;
34
+ height: 35vh;
35
+ max-height: 35vh;
39
36
  overflow: scroll;
40
37
  }
38
+
39
+ .squiz-fte-modal-footer__button {
40
+ margin-top: 1rem;
41
+ }
42
+
43
+ .mock-buttons {
44
+ display: flex;
45
+ gap: 0.5rem;
46
+ }
@@ -1,5 +1,2 @@
1
- import { BoldExtension, HeadingExtension, ItalicExtension, NodeFormattingExtension, ParagraphExtension, UnderlineExtension, HistoryExtension } from 'remirror/extensions';
2
- import { PreformattedExtension } from './PreformattedExtension/PreformattedExtension';
3
- import { LinkExtension } from './LinkExtension/LinkExtension';
4
- import { ImageExtension } from './ImageExtension/ImageExtension';
5
- export declare const Extensions: () => (BoldExtension | HistoryExtension | HeadingExtension | ItalicExtension | NodeFormattingExtension | ParagraphExtension | UnderlineExtension | LinkExtension | PreformattedExtension | ImageExtension)[];
1
+ import { Extension } from '@remirror/core';
2
+ export declare const Extensions: () => Extension[];
@@ -9,7 +9,7 @@ const Extensions = () => [
9
9
  new extensions_1.BoldExtension(),
10
10
  new extensions_1.HeadingExtension(),
11
11
  new extensions_1.ItalicExtension(),
12
- new extensions_1.NodeFormattingExtension(),
12
+ new extensions_1.NodeFormattingExtension({ indents: [] }),
13
13
  new extensions_1.ParagraphExtension(),
14
14
  new PreformattedExtension_1.PreformattedExtension(),
15
15
  new extensions_1.UnderlineExtension(),
@@ -1,7 +1,7 @@
1
1
  import { ApplySchemaAttributes, CommandFunction, NodeExtension, NodeExtensionSpec, NodeSpecOverride } from '@remirror/core';
2
2
  export declare class PreformattedExtension extends NodeExtension {
3
3
  get name(): "preformatted";
4
- createTags(): ("formattingNode" | "block" | "textBlock")[];
4
+ createTags(): ("block" | "formattingNode" | "textBlock")[];
5
5
  createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;
6
6
  /**
7
7
  * Toggle the <pre> for the current block.
package/lib/index.css CHANGED
@@ -576,6 +576,9 @@
576
576
  --tw-blur: blur(8px) !important;
577
577
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
578
578
  }
579
+ .squiz-fte-scope .filter {
580
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
581
+ }
579
582
  .squiz-fte-scope a {
580
583
  --tw-text-opacity: 1;
581
584
  color: rgb(7 116 210 / var(--tw-text-opacity));
package/lib/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  import FormattedTextEditor from './FormattedTextEditor';
2
- export { FormattedTextEditor };
2
+ import { remirrorNodeToSquizNode } from './utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode';
3
+ import { squizNodeToRemirrorNode } from './utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode';
4
+ export { FormattedTextEditor, remirrorNodeToSquizNode, squizNodeToRemirrorNode };
package/lib/index.js CHANGED
@@ -3,6 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FormattedTextEditor = void 0;
6
+ exports.squizNodeToRemirrorNode = exports.remirrorNodeToSquizNode = exports.FormattedTextEditor = void 0;
7
7
  const FormattedTextEditor_1 = __importDefault(require("./FormattedTextEditor"));
8
8
  exports.FormattedTextEditor = FormattedTextEditor_1.default;
9
+ const remirrorNodeToSquizNode_1 = require("./utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode");
10
+ Object.defineProperty(exports, "remirrorNodeToSquizNode", { enumerable: true, get: function () { return remirrorNodeToSquizNode_1.remirrorNodeToSquizNode; } });
11
+ const squizNodeToRemirrorNode_1 = require("./utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode");
12
+ Object.defineProperty(exports, "squizNodeToRemirrorNode", { enumerable: true, get: function () { return squizNodeToRemirrorNode_1.squizNodeToRemirrorNode; } });
@@ -0,0 +1,10 @@
1
+ import { ProsemirrorNode } from 'remirror';
2
+ import { FORMATTED_TEXT_MODELS as FormattedTextModels } from '@squiz/dx-json-schema-lib';
3
+ export declare const resolveNodeTag: (node: ProsemirrorNode) => string | null;
4
+ /**
5
+ * Converts Remirror node JSON structure to Squiz component JSON structure.
6
+ * @param {ProsemirrorNode} node Remirror node to convert to component.
7
+ * @export
8
+ * @returns {FormattedText} The converted Squiz component JSON.
9
+ */
10
+ export declare const remirrorNodeToSquizNode: (node: ProsemirrorNode) => FormattedTextModels.v1.FormattedText;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.remirrorNodeToSquizNode = exports.resolveNodeTag = void 0;
4
+ const validNodeTypes_1 = require("../validNodeTypes");
5
+ const resolveNodeTag = (node) => {
6
+ if (node.type.spec?.toDOM) {
7
+ const domNode = node.type.spec.toDOM(node);
8
+ if (domNode instanceof window.Node) {
9
+ return domNode.nodeName.toLowerCase();
10
+ }
11
+ if (domNode?.dom instanceof window.Node) {
12
+ return domNode.dom.nodeName.toLowerCase();
13
+ }
14
+ if (domNode instanceof Array) {
15
+ // [ tag, attributes, ...children ]
16
+ return domNode[0].toLowerCase();
17
+ }
18
+ }
19
+ return null;
20
+ };
21
+ exports.resolveNodeTag = resolveNodeTag;
22
+ const resolveFormattingOptions = (node) => {
23
+ const formattingOptions = {};
24
+ if (node.attrs.nodeTextAlignment) {
25
+ formattingOptions.alignment = node.attrs.nodeTextAlignment;
26
+ }
27
+ return formattingOptions;
28
+ };
29
+ const resolveFontOptions = (node) => {
30
+ const fontOptions = {};
31
+ node.marks.forEach((mark) => {
32
+ switch (mark.type.name) {
33
+ case 'bold':
34
+ fontOptions.bold = true;
35
+ break;
36
+ case 'italic':
37
+ fontOptions.italics = true;
38
+ break;
39
+ case 'underline':
40
+ fontOptions.underline = true;
41
+ break;
42
+ default:
43
+ // Currently unsupported mark type
44
+ break;
45
+ }
46
+ });
47
+ return fontOptions;
48
+ };
49
+ const resolveAttributeOptions = (node, nodeType) => {
50
+ let attributeOptions = {};
51
+ if (nodeType === 'image') {
52
+ attributeOptions = { ...node.attrs };
53
+ }
54
+ else {
55
+ node.marks.forEach((mark) => {
56
+ switch (mark.type.name) {
57
+ case 'link':
58
+ attributeOptions = { ...mark.attrs };
59
+ break;
60
+ default:
61
+ // Currently unsupported mark type
62
+ break;
63
+ }
64
+ });
65
+ }
66
+ // Remove any non string elements from attributes, squiz component only accepts strings.
67
+ Object.keys(attributeOptions).forEach((key) => {
68
+ if (typeof attributeOptions[key] !== 'string' && typeof attributeOptions[key] !== 'number') {
69
+ delete attributeOptions[key];
70
+ // If it's a number we make it a string so its accepted by component service
71
+ }
72
+ else {
73
+ attributeOptions[key] = String(attributeOptions[key]);
74
+ }
75
+ });
76
+ return attributeOptions;
77
+ };
78
+ /**
79
+ * Converts Remirror node JSON structure to Squiz component JSON structure.
80
+ * @param {ProsemirrorNode} node Remirror node to convert to component.
81
+ * @export
82
+ * @returns {FormattedText} The converted Squiz component JSON.
83
+ */
84
+ const remirrorNodeToSquizNode = (node) => {
85
+ if (!(0, validNodeTypes_1.validRemirrorNode)(node))
86
+ return [];
87
+ const nodeType = node.type.name;
88
+ let nodeTag = (0, exports.resolveNodeTag)(node);
89
+ // Filter out any children nodes that aren't currently supported.
90
+ const children = (node.content.content || []).map((child) => (0, exports.remirrorNodeToSquizNode)(child));
91
+ let transformed = {
92
+ children,
93
+ formattingOptions: resolveFormattingOptions(node),
94
+ attributes: resolveAttributeOptions(node, nodeType),
95
+ font: resolveFontOptions(node),
96
+ };
97
+ if (nodeType === 'doc') {
98
+ return transformed.children;
99
+ }
100
+ // If we don't have a node tag yet, check if there is one needed
101
+ if (!nodeTag) {
102
+ node.marks.forEach((mark) => {
103
+ switch (mark.type.name) {
104
+ case 'link':
105
+ nodeTag = 'a';
106
+ break;
107
+ default:
108
+ // Currently unsupported mark type
109
+ break;
110
+ }
111
+ });
112
+ }
113
+ if (nodeTag) {
114
+ transformed = {
115
+ ...transformed,
116
+ type: 'tag',
117
+ tag: nodeTag,
118
+ };
119
+ }
120
+ if ((Object.keys(transformed.font).length > 0 || Object.keys(transformed.attributes).length > 0) &&
121
+ !transformed.type) {
122
+ // Wrap in span so we can apply formatting to it
123
+ transformed = { ...transformed, tag: 'span', type: 'tag' };
124
+ }
125
+ if (nodeType === 'text') {
126
+ if (transformed.type) {
127
+ // If we have a tag already nest the text beneath it so we can preserve formatting options, etc.
128
+ transformed = {
129
+ ...transformed,
130
+ children: [
131
+ {
132
+ type: 'text',
133
+ value: node.text,
134
+ },
135
+ ],
136
+ };
137
+ }
138
+ else {
139
+ // If we don't have a tag just rewrite the transformed value to be the text.
140
+ transformed = {
141
+ type: 'text',
142
+ value: node.text,
143
+ };
144
+ }
145
+ }
146
+ // Remove empty formatting options from transformed object.
147
+ if (transformed.formattingOptions && Object.keys(transformed.formattingOptions).length === 0) {
148
+ delete transformed.formattingOptions;
149
+ }
150
+ // Remove empty font options from transformed object.
151
+ if (transformed.font && Object.keys(transformed.font).length === 0) {
152
+ delete transformed.font;
153
+ }
154
+ // Remove empty attributes options from transformed object.
155
+ if (transformed.attributes && Object.keys(transformed.attributes).length === 0) {
156
+ delete transformed.attributes;
157
+ }
158
+ return transformed;
159
+ };
160
+ exports.remirrorNodeToSquizNode = remirrorNodeToSquizNode;
@@ -0,0 +1,9 @@
1
+ import { RemirrorJSON } from '@remirror/core';
2
+ import { FORMATTED_TEXT_MODELS as FormattedTextModels } from '@squiz/dx-json-schema-lib';
3
+ /**
4
+ * Converts Squiz component JSON structure to Remirror node JSON structure.
5
+ * @param {FormattedText} nodes Squiz nodes to convert to Remirror.
6
+ * @export
7
+ * @returns {RemirrorJSON} The converted Remirror JSON.
8
+ */
9
+ export declare const squizNodeToRemirrorNode: (nodes: FormattedTextModels.v1.FormattedText) => RemirrorJSON;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.squizNodeToRemirrorNode = void 0;
4
+ const getNodeType = (node) => {
5
+ const nodeTypeMap = {
6
+ h1: 'heading',
7
+ h2: 'heading',
8
+ h3: 'heading',
9
+ h4: 'heading',
10
+ h5: 'heading',
11
+ h6: 'heading',
12
+ img: 'image',
13
+ pre: 'preformatted',
14
+ p: 'paragraph',
15
+ text: 'paragraph',
16
+ };
17
+ const nodeType = nodeTypeMap[node.tag || node.type];
18
+ // Unsupported node type
19
+ if (!nodeType)
20
+ throw new Error(`Unsupported node type provided: ${node.tag}`);
21
+ return nodeType;
22
+ };
23
+ const getNodeAttributes = (node) => {
24
+ const { alignment } = node.formattingOptions || {};
25
+ return {
26
+ nodeIndent: null,
27
+ nodeTextAlignment: alignment ?? null,
28
+ nodeLineHeight: null,
29
+ style: '',
30
+ level: node.tag?.startsWith('h') ? parseInt(node.tag.substring(1)) : undefined,
31
+ };
32
+ };
33
+ const resolveChild = (child) => {
34
+ if (child.type === 'text') {
35
+ return { type: 'text', text: child.value };
36
+ }
37
+ let text = '';
38
+ const marks = [];
39
+ if (child.type === 'tag') {
40
+ // Handle link type
41
+ if (child.tag === 'a') {
42
+ marks.push({
43
+ type: 'link',
44
+ attrs: {
45
+ href: child.attributes?.href,
46
+ target: child.attributes?.target ?? null,
47
+ auto: false,
48
+ title: child.attributes?.title ?? null,
49
+ },
50
+ });
51
+ }
52
+ // Handle image type
53
+ if (child.tag === 'img') {
54
+ return {
55
+ type: 'image',
56
+ attrs: {
57
+ alt: child.attributes?.alt,
58
+ height: child.attributes?.height,
59
+ width: child.attributes?.width,
60
+ src: child.attributes?.src,
61
+ title: child.attributes?.title,
62
+ },
63
+ };
64
+ }
65
+ // Handle font formatting
66
+ child.font?.bold && marks.push({ type: 'bold' });
67
+ child.font?.italics && marks.push({ type: 'italic' });
68
+ child.font?.underline && marks.push({ type: 'underline' });
69
+ // For now all children types should be "text"
70
+ text = child.children[0].type === 'text' ? child.children[0].value : '';
71
+ }
72
+ return { type: 'text', marks, text };
73
+ };
74
+ const formatNode = (node) => {
75
+ let content;
76
+ if (node.type === 'tag') {
77
+ content = node.children.length ? node.children.map((child) => resolveChild(child)) : undefined;
78
+ }
79
+ if (node.type === 'text') {
80
+ content = [
81
+ {
82
+ type: 'text',
83
+ text: node.value,
84
+ },
85
+ ];
86
+ }
87
+ return {
88
+ type: getNodeType(node),
89
+ attrs: getNodeAttributes(node),
90
+ content,
91
+ };
92
+ };
93
+ /**
94
+ * Converts Squiz component JSON structure to Remirror node JSON structure.
95
+ * @param {FormattedText} nodes Squiz nodes to convert to Remirror.
96
+ * @export
97
+ * @returns {RemirrorJSON} The converted Remirror JSON.
98
+ */
99
+ const squizNodeToRemirrorNode = (nodes) => {
100
+ return {
101
+ type: 'doc',
102
+ content: nodes.filter((node) => getNodeType(node)).map(formatNode),
103
+ };
104
+ };
105
+ exports.squizNodeToRemirrorNode = squizNodeToRemirrorNode;
@@ -0,0 +1,2 @@
1
+ import { ProsemirrorNode } from 'remirror';
2
+ export declare const validRemirrorNode: (node: ProsemirrorNode) => boolean;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validRemirrorNode = void 0;
4
+ const Extensions_1 = require("../../Extensions/Extensions");
5
+ const validRemirrorNode = (node) => {
6
+ if (!node)
7
+ return false;
8
+ const nodeType = node.type.name;
9
+ const nodeMarks = node.marks;
10
+ // This is pulling in the currently supported extensions, this works for now...
11
+ // Could also just hard code these in as we go, but this should make it easier as we add more extensions
12
+ const supportedNodes = [...(0, Extensions_1.Extensions)().map((extension) => extension.name), 'doc', 'text'];
13
+ if (!supportedNodes.includes(nodeType))
14
+ return false;
15
+ for (let i = 0; i < nodeMarks.length; i++) {
16
+ if (!supportedNodes.includes(nodeMarks[i].type.name))
17
+ return false;
18
+ }
19
+ return true;
20
+ };
21
+ exports.validRemirrorNode = validRemirrorNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/formatted-text-editor",
3
- "version": "1.21.1-alpha.6",
3
+ "version": "1.21.1-alpha.9",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "@headlessui/react": "1.7.11",
21
21
  "@mui/icons-material": "5.11.0",
22
22
  "@remirror/react": "2.0.25",
23
+ "@squiz/dx-json-schema-lib": "1.21.1-alpha.2",
23
24
  "clsx": "1.2.1",
24
25
  "react-hook-form": "7.43.2",
25
26
  "react-image-size": "2.0.0"
@@ -44,6 +45,7 @@
44
45
  "postcss-nested": "6.0.0",
45
46
  "postcss-prefix-selector": "1.16.0",
46
47
  "react": "18.2.0",
48
+ "react-diff-viewer-continued": "3.2.6",
47
49
  "react-dom": "18.2.0",
48
50
  "rimraf": "4.1.2",
49
51
  "tailwindcss": "3.2.6",
@@ -68,5 +70,5 @@
68
70
  "volta": {
69
71
  "node": "16.19.0"
70
72
  },
71
- "gitHead": "a32356af1c21852bc6cab498923e8da07cc8fbac"
73
+ "gitHead": "64afcee1b33efbff451aa0ef4e727c4e8a079621"
72
74
  }
@@ -10,12 +10,13 @@ import {
10
10
  import { PreformattedExtension } from './PreformattedExtension/PreformattedExtension';
11
11
  import { LinkExtension } from './LinkExtension/LinkExtension';
12
12
  import { ImageExtension } from './ImageExtension/ImageExtension';
13
+ import { Extension } from '@remirror/core';
13
14
 
14
- export const Extensions = () => [
15
+ export const Extensions = (): Extension[] => [
15
16
  new BoldExtension(),
16
17
  new HeadingExtension(),
17
18
  new ItalicExtension(),
18
- new NodeFormattingExtension(),
19
+ new NodeFormattingExtension({ indents: [] }),
19
20
  new ParagraphExtension(),
20
21
  new PreformattedExtension(),
21
22
  new UnderlineExtension(),
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import FormattedTextEditor from './FormattedTextEditor';
2
+ import { remirrorNodeToSquizNode } from './utils/converters/remirrorNodeToSquizNode/remirrorNodeToSquizNode';
3
+ import { squizNodeToRemirrorNode } from './utils/converters/squizNodeToRemirrorNode/squizNodeToRemirrorNode';
2
4
 
3
- export { FormattedTextEditor };
5
+ export { FormattedTextEditor, remirrorNodeToSquizNode, squizNodeToRemirrorNode };
@@ -0,0 +1,75 @@
1
+ import { FORMATTED_TEXT_MODELS as FormattedTextModels } from '@squiz/dx-json-schema-lib';
2
+
3
+ export const mockSquizNodeJson: FormattedTextModels.v1.FormattedText = [
4
+ {
5
+ children: [
6
+ {
7
+ type: 'text',
8
+ value: 'Hello ',
9
+ },
10
+ {
11
+ children: [
12
+ {
13
+ type: 'text',
14
+ value: 'Mr Bean',
15
+ },
16
+ ],
17
+ attributes: {
18
+ href: 'https://www.google.com',
19
+ },
20
+ font: {
21
+ bold: true,
22
+ },
23
+ type: 'tag',
24
+ tag: 'a',
25
+ },
26
+ {
27
+ type: 'text',
28
+ value: ', nice to ',
29
+ },
30
+ {
31
+ children: [
32
+ {
33
+ type: 'text',
34
+ value: 'meet you',
35
+ },
36
+ ],
37
+ attributes: {
38
+ href: 'https://www.google.com',
39
+ },
40
+ type: 'tag',
41
+ tag: 'a',
42
+ },
43
+ {
44
+ type: 'text',
45
+ value: '.',
46
+ },
47
+ {
48
+ children: [],
49
+ attributes: {
50
+ alt: 'Test',
51
+ height: '150',
52
+ width: '200',
53
+ src: 'https://media2.giphy.com/media/3o6ozsIxg5legYvggo/giphy.gif',
54
+ title: '',
55
+ resizable: 'false',
56
+ },
57
+ type: 'tag',
58
+ tag: 'img',
59
+ },
60
+ ],
61
+ type: 'tag',
62
+ tag: 'p',
63
+ },
64
+ ];
65
+
66
+ export const mockSquizNodeTextJson: FormattedTextModels.v1.FormattedText = [
67
+ {
68
+ value: 'Hello world!',
69
+ type: 'text',
70
+ },
71
+ {
72
+ value: 'Another one...',
73
+ type: 'text',
74
+ },
75
+ ];