@contentful/field-editor-markdown 1.5.3 → 1.5.5
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/utils/linkOrganizer.js +2 -3
- package/dist/esm/utils/linkOrganizer.js +2 -3
- package/dist/types/MarkdownEditor.d.ts +3 -3
- package/dist/types/components/HeadingSelector.d.ts +1 -1
- package/dist/types/components/InsertLinkSelector.d.ts +2 -2
- package/dist/types/components/MarkdownBottomBar.d.ts +3 -3
- package/dist/types/components/MarkdownConstraints.d.ts +2 -2
- package/dist/types/components/MarkdownPreview.d.ts +1 -1
- package/dist/types/components/MarkdownPreviewSkeleton.d.ts +2 -2
- package/dist/types/components/MarkdownTabs.d.ts +2 -2
- package/dist/types/components/MarkdownTextarea/MarkdownTextarea.d.ts +1 -1
- package/dist/types/components/MarkdownToolbar.d.ts +3 -3
- package/dist/types/components/icons.d.ts +11 -11
- package/dist/types/dialogs/CheatsheetModalDialog.d.ts +2 -2
- package/dist/types/dialogs/ConfirmInsertAssetModalDialog.d.ts +2 -2
- package/dist/types/dialogs/EmdebExternalContentDialog.d.ts +2 -2
- package/dist/types/dialogs/InsertLinkModalDialog.d.ts +2 -2
- package/dist/types/dialogs/InsertTableModalDialog.d.ts +2 -2
- package/dist/types/dialogs/SpecialCharacterModalDialog.d.ts +2 -2
- package/dist/types/dialogs/ZenModeModalDialog.d.ts +2 -2
- package/dist/types/dialogs/renderMarkdownDialog.d.ts +2 -2
- package/package.json +7 -4
|
@@ -30,7 +30,6 @@ _export(exports, {
|
|
|
30
30
|
});
|
|
31
31
|
const _extend = _interop_require_default(require("lodash/extend"));
|
|
32
32
|
const _isObject = _interop_require_default(require("lodash/isObject"));
|
|
33
|
-
const _isString = _interop_require_default(require("lodash/isString"));
|
|
34
33
|
const _max = _interop_require_default(require("lodash/max"));
|
|
35
34
|
const _isFinite = _interop_require_default(require("lodash/isFinite"));
|
|
36
35
|
const _forEach = _interop_require_default(require("lodash/forEach"));
|
|
@@ -154,7 +153,7 @@ function makeFinder(type) {
|
|
|
154
153
|
return (text)=>findAll(text, type).map(PROCESSORS[type]);
|
|
155
154
|
}
|
|
156
155
|
function findMaxLabelId(textOrLabels) {
|
|
157
|
-
if (
|
|
156
|
+
if (textOrLabels != null && typeof textOrLabels.valueOf() === 'string') {
|
|
158
157
|
textOrLabels = findLabels(textOrLabels);
|
|
159
158
|
}
|
|
160
159
|
const ids = textOrLabels.map((x)=>x.id).map((x)=>parseInt(x, 10)).filter((x)=>(0, _isFinite.default)(x) && x > 0);
|
|
@@ -173,7 +172,7 @@ function findAll(text, type) {
|
|
|
173
172
|
return matches;
|
|
174
173
|
}
|
|
175
174
|
function hasTitle(link) {
|
|
176
|
-
return (0, _isObject.default)(link) &&
|
|
175
|
+
return (0, _isObject.default)(link) && link.title !== null && typeof link.title.valueOf() === 'string' && link.title.length > 0;
|
|
177
176
|
}
|
|
178
177
|
function buildLabel(link, id) {
|
|
179
178
|
let markup = '[' + id + ']: ' + link.href;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import extend from 'lodash/extend';
|
|
2
2
|
import isObject from 'lodash/isObject';
|
|
3
|
-
import isString from 'lodash/isString';
|
|
4
3
|
import max from 'lodash/max';
|
|
5
4
|
import isFinite from 'lodash/isFinite';
|
|
6
5
|
import forEach from 'lodash/forEach';
|
|
@@ -119,7 +118,7 @@ function makeFinder(type) {
|
|
|
119
118
|
return (text)=>findAll(text, type).map(PROCESSORS[type]);
|
|
120
119
|
}
|
|
121
120
|
export function findMaxLabelId(textOrLabels) {
|
|
122
|
-
if (
|
|
121
|
+
if (textOrLabels != null && typeof textOrLabels.valueOf() === 'string') {
|
|
123
122
|
textOrLabels = findLabels(textOrLabels);
|
|
124
123
|
}
|
|
125
124
|
const ids = textOrLabels.map((x)=>x.id).map((x)=>parseInt(x, 10)).filter((x)=>isFinite(x) && x > 0);
|
|
@@ -138,7 +137,7 @@ function findAll(text, type) {
|
|
|
138
137
|
return matches;
|
|
139
138
|
}
|
|
140
139
|
function hasTitle(link) {
|
|
141
|
-
return isObject(link) &&
|
|
140
|
+
return isObject(link) && link.title !== null && typeof link.title.valueOf() === 'string' && link.title.length > 0;
|
|
142
141
|
}
|
|
143
142
|
function buildLabel(link, id) {
|
|
144
143
|
let markup = '[' + id + ']: ' + link.href;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
import { PreviewComponents } from './types';
|
|
4
4
|
export interface MarkdownEditorProps {
|
|
@@ -19,5 +19,5 @@ export declare function MarkdownEditor(props: MarkdownEditorProps & {
|
|
|
19
19
|
value: string | null | undefined;
|
|
20
20
|
saveValueToSDK: Function;
|
|
21
21
|
externalReset?: number;
|
|
22
|
-
}):
|
|
23
|
-
export declare function MarkdownEditorConnected(props: MarkdownEditorProps):
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
export declare function MarkdownEditorConnected(props: MarkdownEditorProps): JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
interface InsertLinkSelectorProps {
|
|
3
3
|
onSelectExisting: Function;
|
|
4
4
|
onAddNew: Function;
|
|
5
5
|
canAddNew: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const InsertLinkSelector: (props: InsertLinkSelectorProps) =>
|
|
8
|
+
export declare const InsertLinkSelector: (props: InsertLinkSelectorProps) => JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -3,13 +3,13 @@ import { MarkdownTab } from 'types';
|
|
|
3
3
|
export declare function MarkdownCounter(props: {
|
|
4
4
|
words: number;
|
|
5
5
|
characters: number;
|
|
6
|
-
}):
|
|
6
|
+
}): JSX.Element;
|
|
7
7
|
type HelpMode = MarkdownTab | 'zen';
|
|
8
8
|
export declare function MarkdownHelp(props: {
|
|
9
9
|
onClick: () => void;
|
|
10
10
|
mode: HelpMode;
|
|
11
|
-
}):
|
|
11
|
+
}): JSX.Element;
|
|
12
12
|
export declare function MarkdownBottomBar(props: {
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
}):
|
|
14
|
+
}): JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -10,5 +10,5 @@ type MarkdownPreviewProps = {
|
|
|
10
10
|
value: string;
|
|
11
11
|
previewComponents?: PreviewComponents;
|
|
12
12
|
};
|
|
13
|
-
declare const MarkdownPreview: React.MemoExoticComponent<(props: MarkdownPreviewProps) =>
|
|
13
|
+
declare const MarkdownPreview: React.MemoExoticComponent<(props: MarkdownPreviewProps) => JSX.Element>;
|
|
14
14
|
export default MarkdownPreview;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default function MarkdownPreviewSkeleton():
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export default function MarkdownPreviewSkeleton(): JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { MarkdownTab } from '../types';
|
|
3
3
|
interface MarkdownTabsProps {
|
|
4
4
|
active: MarkdownTab;
|
|
5
5
|
onSelect: (selected: MarkdownTab) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function MarkdownTabs(props: MarkdownTabsProps):
|
|
7
|
+
export declare function MarkdownTabs(props: MarkdownTabsProps): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -13,5 +13,5 @@ type MarkdownTextareaProps = {
|
|
|
13
13
|
visible: boolean;
|
|
14
14
|
onReady: (editor: InitializedEditorType) => void;
|
|
15
15
|
};
|
|
16
|
-
export declare const MarkdownTextarea: React.MemoExoticComponent<(props: MarkdownTextareaProps) =>
|
|
16
|
+
export declare const MarkdownTextarea: React.MemoExoticComponent<(props: MarkdownTextareaProps) => JSX.Element>;
|
|
17
17
|
export {};
|
|
@@ -6,7 +6,7 @@ interface MarkdownToolbarProps {
|
|
|
6
6
|
actions: MarkdownActions;
|
|
7
7
|
mode: 'default' | 'zen';
|
|
8
8
|
}
|
|
9
|
-
export declare function DefaultMarkdownToolbar(props: MarkdownToolbarProps):
|
|
10
|
-
export declare function ZenMarkdownToolbar(props: MarkdownToolbarProps):
|
|
11
|
-
export declare const MarkdownToolbar: React.MemoExoticComponent<(props: MarkdownToolbarProps) =>
|
|
9
|
+
export declare function DefaultMarkdownToolbar(props: MarkdownToolbarProps): JSX.Element;
|
|
10
|
+
export declare function ZenMarkdownToolbar(props: MarkdownToolbarProps): JSX.Element;
|
|
11
|
+
export declare const MarkdownToolbar: React.MemoExoticComponent<(props: MarkdownToolbarProps) => JSX.Element>;
|
|
12
12
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
type IconProps = {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
className?: string;
|
|
6
6
|
label: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const Zen: ({ label, ...rest }: IconProps) =>
|
|
9
|
-
export declare const Strikethrough: ({ label, ...rest }: IconProps) =>
|
|
10
|
-
export declare const Indent: ({ label, ...rest }: IconProps) =>
|
|
11
|
-
export declare const Dedent: ({ label, ...rest }: IconProps) =>
|
|
12
|
-
export declare const Cubes: ({ label, ...rest }: IconProps) =>
|
|
13
|
-
export declare const Table: ({ label, ...rest }: IconProps) =>
|
|
14
|
-
export declare const SpecialChar: ({ label, ...rest }: IconProps) =>
|
|
15
|
-
export declare const OrgLinks: ({ label, ...rest }: IconProps) =>
|
|
16
|
-
export declare const Undo: ({ label, ...rest }: IconProps) =>
|
|
17
|
-
export declare const Redo: ({ label, ...rest }: IconProps) =>
|
|
8
|
+
export declare const Zen: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
9
|
+
export declare const Strikethrough: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
10
|
+
export declare const Indent: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
11
|
+
export declare const Dedent: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
12
|
+
export declare const Cubes: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
13
|
+
export declare const Table: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
14
|
+
export declare const SpecialChar: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
15
|
+
export declare const OrgLinks: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
16
|
+
export declare const Undo: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
17
|
+
export declare const Redo: ({ label, ...rest }: IconProps) => JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
|
-
export declare const CheatsheetModalDialog: () =>
|
|
3
|
+
export declare const CheatsheetModalDialog: () => JSX.Element;
|
|
4
4
|
export declare const openCheatsheetModal: (dialogs: DialogsAPI) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
interface ConfirmInsertAssetModalDialogProps {
|
|
4
4
|
onClose: (result: boolean) => void;
|
|
@@ -10,7 +10,7 @@ interface ConfirmInsertAssetModalDialogProps {
|
|
|
10
10
|
}>;
|
|
11
11
|
locale: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const ConfirmInsertAssetModalDialog: ({ onClose, assets, locale, }: ConfirmInsertAssetModalDialogProps) =>
|
|
13
|
+
export declare const ConfirmInsertAssetModalDialog: ({ onClose, assets, locale, }: ConfirmInsertAssetModalDialogProps) => JSX.Element;
|
|
14
14
|
export declare const openConfirmInsertAsset: (dialogs: DialogsAPI, options: {
|
|
15
15
|
locale: string;
|
|
16
16
|
assets: Array<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
export type EmbedExternalContentModalResult = string | false | undefined;
|
|
4
4
|
type EmbedExternalContentModalProps = {
|
|
5
5
|
onClose: (result: EmbedExternalContentModalResult) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare const EmbedExternalContentModal: ({ onClose }: EmbedExternalContentModalProps) =>
|
|
7
|
+
export declare const EmbedExternalContentModal: ({ onClose }: EmbedExternalContentModalProps) => JSX.Element;
|
|
8
8
|
export declare const openEmbedExternalContentDialog: (dialogs: DialogsAPI) => Promise<EmbedExternalContentModalResult>;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
type InsertLinkModalPositiveResult = {
|
|
4
4
|
url: string;
|
|
@@ -10,7 +10,7 @@ type InsertLinkModalProps = {
|
|
|
10
10
|
selectedText?: string;
|
|
11
11
|
onClose: (result: InsertLinkModalResult) => void;
|
|
12
12
|
};
|
|
13
|
-
export declare const InsertLinkModal: ({ selectedText, onClose }: InsertLinkModalProps) =>
|
|
13
|
+
export declare const InsertLinkModal: ({ selectedText, onClose }: InsertLinkModalProps) => JSX.Element;
|
|
14
14
|
export declare const openInsertLinkDialog: (dialogs: DialogsAPI, params: {
|
|
15
15
|
selectedText?: string;
|
|
16
16
|
}) => Promise<InsertLinkModalResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
type InsertTableModalPositiveResult = {
|
|
4
4
|
cols: number;
|
|
@@ -8,6 +8,6 @@ export type InsertTableModalResult = InsertTableModalPositiveResult | false | un
|
|
|
8
8
|
type InsertTableModalProps = {
|
|
9
9
|
onClose: (result: InsertTableModalResult) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const InsertTableModal: ({ onClose }: InsertTableModalProps) =>
|
|
11
|
+
export declare const InsertTableModal: ({ onClose }: InsertTableModalProps) => JSX.Element;
|
|
12
12
|
export declare const openInsertTableDialog: (dialogs: DialogsAPI) => Promise<InsertTableModalResult>;
|
|
13
13
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
export type SpecialCharacterModalResult = string | false | undefined;
|
|
4
4
|
type SpecialCharacterModalDialogProps = {
|
|
5
5
|
onClose: (result: SpecialCharacterModalResult) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare const SpecialCharacterModalDialog: ({ onClose }: SpecialCharacterModalDialogProps) =>
|
|
7
|
+
export declare const SpecialCharacterModalDialog: ({ onClose }: SpecialCharacterModalDialogProps) => JSX.Element;
|
|
8
8
|
export declare const openInsertSpecialCharacter: (dialogs: DialogsAPI) => Promise<SpecialCharacterModalResult>;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogAppSDK, DialogsAPI } from '@contentful/app-sdk';
|
|
3
3
|
import { PreviewComponents } from '../types';
|
|
4
4
|
export type ZenModeResult = {
|
|
@@ -16,7 +16,7 @@ type ZenModeDialogProps = {
|
|
|
16
16
|
sdk: DialogAppSDK;
|
|
17
17
|
previewComponents?: PreviewComponents;
|
|
18
18
|
};
|
|
19
|
-
export declare const ZenModeModalDialog: (props: ZenModeDialogProps) =>
|
|
19
|
+
export declare const ZenModeModalDialog: (props: ZenModeDialogProps) => JSX.Element;
|
|
20
20
|
export declare const openZenMode: (dialogs: DialogsAPI, options: {
|
|
21
21
|
initialValue: string;
|
|
22
22
|
locale: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DialogAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
import { MarkdownDialogsParams } from '../types';
|
|
4
4
|
export declare const renderMarkdownDialog: (sdk: DialogAppSDK & {
|
|
5
5
|
parameters: {
|
|
6
6
|
invocation: MarkdownDialogsParams;
|
|
7
7
|
};
|
|
8
|
-
}) =>
|
|
8
|
+
}) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-markdown",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-icons": "^4.1.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.0",
|
|
41
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
41
|
+
"@contentful/field-editor-shared": "^1.4.4",
|
|
42
42
|
"@types/codemirror": "0.0.109",
|
|
43
43
|
"codemirror": "^5.65.11",
|
|
44
44
|
"constate": "^3.2.0",
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/core": "^7.5.5",
|
|
54
54
|
"@contentful/app-sdk": "^4.17.1",
|
|
55
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
55
|
+
"@contentful/field-editor-test-utils": "^1.4.5"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@contentful/app-sdk": "^4.17.1",
|
|
59
59
|
"react": ">=16.8.0"
|
|
60
60
|
},
|
|
61
|
-
"
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"registry": "https://npm.pkg.github.com/"
|
|
63
|
+
},
|
|
64
|
+
"gitHead": "b1f62d6b934520b6d4dc328921dd500381d1e22c"
|
|
62
65
|
}
|