tinacms 0.0.0-c8b1d84-20241003015733 → 0.0.0-c9e72f6-20251216031141
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/README.md +1 -1
- package/dist/admin/api.d.ts +5 -1
- package/dist/admin/components/{Sidebar.d.ts → AdminNav.d.ts} +0 -3
- package/dist/admin/components/GetCollection.d.ts +2 -2
- package/dist/admin/components/Page.d.ts +3 -9
- package/dist/admin/components/ui/tooltip.d.ts +7 -0
- package/dist/admin/pages/CollectionCreatePage.d.ts +1 -1
- package/dist/admin/pages/CollectionListPage.d.ts +2 -2
- package/dist/admin/pages/DashboardPage.d.ts +0 -3
- package/dist/admin/pages/ScreenPage.d.ts +0 -3
- package/dist/admin/types.d.ts +3 -0
- package/dist/auth/AuthModal.d.ts +1 -4
- package/dist/auth/TinaCloudProvider.d.ts +1 -2
- package/dist/cache/node-cache.d.ts +6 -1
- package/dist/client.js +244 -147
- package/dist/hooks/create-page-plugin.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +122165 -31833
- package/dist/internalClient/index.d.ts +28 -3
- package/dist/react.d.ts +14 -6
- package/dist/react.js +209 -192
- package/dist/rich-text/index.d.ts +9 -0
- package/dist/rich-text/index.js +235 -192
- package/dist/rich-text/prism.js +16 -18
- package/dist/rich-text/static.d.ts +154 -0
- package/dist/rich-text/static.js +243 -0
- package/dist/tina-cms.d.ts +1 -1
- package/dist/toolkit/components/ProgressBar.d.ts +11 -0
- package/dist/toolkit/components/media/media-item.d.ts +11 -1
- package/dist/toolkit/components/media/media-manager.d.ts +1 -1
- package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
- package/dist/toolkit/components/ui/button.d.ts +11 -0
- package/dist/toolkit/components/ui/calendar.d.ts +8 -0
- package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
- package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/toolkit/components/ui/input.d.ts +3 -0
- package/dist/toolkit/components/ui/popover.d.ts +7 -0
- package/dist/toolkit/components/ui/select.d.ts +13 -0
- package/dist/toolkit/fields/components/color-picker/block-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/color-picker/color-input.d.ts +35 -0
- package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +6 -2
- package/dist/toolkit/fields/components/color-picker/color-utils.d.ts +37 -0
- package/dist/toolkit/fields/components/color-picker/sketch-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/password-field.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/components/button.d.ts +2 -2
- package/dist/toolkit/fields/components/reference/components/command.d.ts +21 -33
- package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
- package/dist/toolkit/fields/components/select.d.ts +2 -2
- package/dist/toolkit/fields/components/text-field.d.ts +1 -1
- package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +1 -0
- package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
- package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
- package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
- package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
- package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +5 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +20 -18
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/fixed-toolbar-buttons.d.ts +0 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +14 -10
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +5 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +17 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/error-message.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-combobox.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-toolbar-button.d.ts +6 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-leaf.d.ts +2 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +14 -10
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-syntax-leaf.d.ts +2 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +112 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dialog.d.ts +12 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dropdown-menu.d.ts +10 -10
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/floating-toolbar.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-element.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-toolbar-button.d.ts +18 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +4 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/image-toolbar-button.d.ts +6 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +6 -7
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/inline-combobox.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/input.d.ts +3 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-element.d.ts +4 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-floating-toolbar.d.ts +4 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-toolbar-button.d.ts +4 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +28 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +4 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +18 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +15 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/popover.d.ts +7 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/quote-toolbar-button.d.ts +6 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/raw-markdown-toolbar-button.d.ts +6 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +42 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/separator.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +15 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/block-selection.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +33 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-dropdown-menu.d.ts +4 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +15 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/toolbar.d.ts +7 -7
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +10 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-state.d.ts +22 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/use-create-editor.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-lists.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-marks.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-utils.d.ts +3 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +12 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +18 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/index.d.ts +0 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-html-block/index.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +5 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +7 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/index.d.ts +3 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +520 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +264 -156
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/floating-toolbar-plugin.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +11 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +3 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/is-url.d.ts +1 -2
- package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
- package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
- package/dist/toolkit/form-builder/form-builder.d.ts +8 -9
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/forms/field.d.ts +3 -0
- package/dist/toolkit/forms/form.d.ts +22 -3
- package/dist/toolkit/git-client/git-client.d.ts +25 -2
- package/dist/toolkit/git-client/git-file.d.ts +18 -0
- package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
- package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
- package/dist/toolkit/icons/Tina.d.ts +0 -5
- package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
- package/dist/toolkit/icons/index.d.ts +1 -0
- package/dist/toolkit/index.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +4 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
- package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
- package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/VersionInfo.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
- package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
- package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
- package/dist/toolkit/react-sidebar/components/nav.d.ts +6 -3
- package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +33 -11
- package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
- package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
- package/dist/toolkit/react-sidebar/index.d.ts +4 -1
- package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
- package/dist/toolkit/styles/button.d.ts +2 -2
- package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
- package/dist/toolkit/styles/index.d.ts +1 -0
- package/dist/toolkit/tina-cms.d.ts +3 -3
- package/dist/toolkit/tina-state.d.ts +15 -0
- package/dist/unifiedClient/index.d.ts +9 -2
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +91 -113
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
- package/dist/admin/pages/IndexingPage.d.ts +0 -2
- package/dist/client.mjs +0 -109
- package/dist/index.mjs +0 -33192
- package/dist/node-cache-7fa2452c.mjs +0 -43
- package/dist/react.mjs +0 -234
- package/dist/rich-text/index.mjs +0 -210
- package/dist/rich-text/prism.mjs +0 -16
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-element.d.ts +0 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/with-correct-void-behavior.d.ts +0 -8
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts +0 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +0 -15
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/create-soft-break-plugin.d.ts +0 -7
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/index.d.ts +0 -6
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/on-key-down-soft-break.d.ts +0 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/types.d.ts +0 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +0 -9
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/insert-empty-block.d.ts +0 -2
- package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
- package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
- package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const path = await import("./__vite-browser-external-d06ac358.mjs");
|
|
3
|
-
const os = await import("./__vite-browser-external-d06ac358.mjs");
|
|
4
|
-
const parts = dir.split(path.sep).filter(Boolean);
|
|
5
|
-
let cacheDir = dir;
|
|
6
|
-
if (!fs.existsSync(path.join(path.sep, parts[0]))) {
|
|
7
|
-
cacheDir = path.join(os.tmpdir(), parts[parts.length - 1]);
|
|
8
|
-
}
|
|
9
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
10
|
-
return cacheDir;
|
|
11
|
-
};
|
|
12
|
-
const NodeCache = async (dir) => {
|
|
13
|
-
const fs = await import("./__vite-browser-external-d06ac358.mjs");
|
|
14
|
-
const { createHash } = await import("./__vite-browser-external-d06ac358.mjs");
|
|
15
|
-
const cacheDir = await makeCacheDir(dir, fs);
|
|
16
|
-
return {
|
|
17
|
-
makeKey: (key) => {
|
|
18
|
-
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
19
|
-
return createHash("sha256").update(input).digest("hex");
|
|
20
|
-
},
|
|
21
|
-
get: async (key) => {
|
|
22
|
-
try {
|
|
23
|
-
const data = await fs.promises.readFile(`${cacheDir}/${key}`, "utf-8");
|
|
24
|
-
return JSON.parse(data);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
if (e.code === "ENOENT") {
|
|
27
|
-
return void 0;
|
|
28
|
-
}
|
|
29
|
-
throw e;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
set: async (key, value) => {
|
|
33
|
-
await fs.promises.writeFile(
|
|
34
|
-
`${cacheDir}/${key}`,
|
|
35
|
-
JSON.stringify(value),
|
|
36
|
-
"utf-8"
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
NodeCache
|
|
43
|
-
};
|
package/dist/react.mjs
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
function useTina(props) {
|
|
3
|
-
const stringifiedQuery = JSON.stringify({
|
|
4
|
-
query: props.query,
|
|
5
|
-
variables: props.variables
|
|
6
|
-
});
|
|
7
|
-
const id = React.useMemo(
|
|
8
|
-
() => hashFromQuery(stringifiedQuery),
|
|
9
|
-
[stringifiedQuery]
|
|
10
|
-
);
|
|
11
|
-
const [data, setData] = React.useState(props.data);
|
|
12
|
-
const [isClient, setIsClient] = React.useState(false);
|
|
13
|
-
const [quickEditEnabled, setQuickEditEnabled] = React.useState(false);
|
|
14
|
-
const [isInTinaIframe, setIsInTinaIframe] = React.useState(false);
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
setIsClient(true);
|
|
17
|
-
setData(props.data);
|
|
18
|
-
}, [id]);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (quickEditEnabled) {
|
|
21
|
-
let mouseDownHandler = function(e) {
|
|
22
|
-
const attributeNames = e.target.getAttributeNames();
|
|
23
|
-
const tinaAttribute = attributeNames.find(
|
|
24
|
-
(name) => name.startsWith("data-tina-field")
|
|
25
|
-
);
|
|
26
|
-
let fieldName;
|
|
27
|
-
if (tinaAttribute) {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
e.stopPropagation();
|
|
30
|
-
fieldName = e.target.getAttribute(tinaAttribute);
|
|
31
|
-
} else {
|
|
32
|
-
const ancestor = e.target.closest(
|
|
33
|
-
"[data-tina-field], [data-tina-field-overlay]"
|
|
34
|
-
);
|
|
35
|
-
if (ancestor) {
|
|
36
|
-
const attributeNames2 = ancestor.getAttributeNames();
|
|
37
|
-
const tinaAttribute2 = attributeNames2.find(
|
|
38
|
-
(name) => name.startsWith("data-tina-field")
|
|
39
|
-
);
|
|
40
|
-
if (tinaAttribute2) {
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
e.stopPropagation();
|
|
43
|
-
fieldName = ancestor.getAttribute(tinaAttribute2);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (fieldName) {
|
|
48
|
-
if (isInTinaIframe) {
|
|
49
|
-
parent.postMessage(
|
|
50
|
-
{ type: "field:selected", fieldName },
|
|
51
|
-
window.location.origin
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const style = document.createElement("style");
|
|
57
|
-
style.type = "text/css";
|
|
58
|
-
style.textContent = `
|
|
59
|
-
[data-tina-field] {
|
|
60
|
-
outline: 2px dashed rgba(34,150,254,0.5);
|
|
61
|
-
transition: box-shadow ease-out 150ms;
|
|
62
|
-
}
|
|
63
|
-
[data-tina-field]:hover {
|
|
64
|
-
box-shadow: inset 100vi 100vh rgba(34,150,254,0.3);
|
|
65
|
-
outline: 2px solid rgba(34,150,254,1);
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
}
|
|
68
|
-
[data-tina-field-overlay] {
|
|
69
|
-
outline: 2px dashed rgba(34,150,254,0.5);
|
|
70
|
-
position: relative;
|
|
71
|
-
}
|
|
72
|
-
[data-tina-field-overlay]:hover {
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
outline: 2px solid rgba(34,150,254,1);
|
|
75
|
-
}
|
|
76
|
-
[data-tina-field-overlay]::after {
|
|
77
|
-
content: '';
|
|
78
|
-
position: absolute;
|
|
79
|
-
inset: 0;
|
|
80
|
-
z-index: 20;
|
|
81
|
-
transition: opacity ease-out 150ms;
|
|
82
|
-
background-color: rgba(34,150,254,0.3);
|
|
83
|
-
opacity: 0;
|
|
84
|
-
}
|
|
85
|
-
[data-tina-field-overlay]:hover::after {
|
|
86
|
-
opacity: 1;
|
|
87
|
-
}
|
|
88
|
-
`;
|
|
89
|
-
document.head.appendChild(style);
|
|
90
|
-
document.body.classList.add("__tina-quick-editing-enabled");
|
|
91
|
-
document.addEventListener("click", mouseDownHandler, true);
|
|
92
|
-
return () => {
|
|
93
|
-
document.removeEventListener("click", mouseDownHandler, true);
|
|
94
|
-
document.body.classList.remove("__tina-quick-editing-enabled");
|
|
95
|
-
style.remove();
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}, [quickEditEnabled, isInTinaIframe]);
|
|
99
|
-
React.useEffect(() => {
|
|
100
|
-
parent.postMessage({ type: "open", ...props, id }, window.location.origin);
|
|
101
|
-
window.addEventListener("message", (event) => {
|
|
102
|
-
if (event.data.type === "quickEditEnabled") {
|
|
103
|
-
setQuickEditEnabled(event.data.value);
|
|
104
|
-
}
|
|
105
|
-
if (event.data.id === id && event.data.type === "updateData") {
|
|
106
|
-
setData(event.data.data);
|
|
107
|
-
setIsInTinaIframe(true);
|
|
108
|
-
const anyTinaField = document.querySelector("[data-tina-field]");
|
|
109
|
-
if (anyTinaField) {
|
|
110
|
-
parent.postMessage(
|
|
111
|
-
{ type: "quick-edit", value: true },
|
|
112
|
-
window.location.origin
|
|
113
|
-
);
|
|
114
|
-
} else {
|
|
115
|
-
parent.postMessage(
|
|
116
|
-
{ type: "quick-edit", value: false },
|
|
117
|
-
window.location.origin
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return () => {
|
|
123
|
-
parent.postMessage({ type: "close", id }, window.location.origin);
|
|
124
|
-
};
|
|
125
|
-
}, [id, setQuickEditEnabled]);
|
|
126
|
-
return { data, isClient };
|
|
127
|
-
}
|
|
128
|
-
function useEditState() {
|
|
129
|
-
const [edit, setEdit] = React.useState(false);
|
|
130
|
-
React.useEffect(() => {
|
|
131
|
-
if (typeof window !== "undefined") {
|
|
132
|
-
parent.postMessage({ type: "isEditMode" }, window.location.origin);
|
|
133
|
-
window.addEventListener("message", (event) => {
|
|
134
|
-
var _a;
|
|
135
|
-
if (((_a = event.data) == null ? void 0 : _a.type) === "tina:editMode") {
|
|
136
|
-
setEdit(true);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}, []);
|
|
141
|
-
return { edit };
|
|
142
|
-
}
|
|
143
|
-
const tinaField = (object, property, index) => {
|
|
144
|
-
var _a, _b, _c;
|
|
145
|
-
if (!object) {
|
|
146
|
-
return "";
|
|
147
|
-
}
|
|
148
|
-
if (object._content_source) {
|
|
149
|
-
if (!property) {
|
|
150
|
-
return [
|
|
151
|
-
(_a = object._content_source) == null ? void 0 : _a.queryId,
|
|
152
|
-
object._content_source.path.join(".")
|
|
153
|
-
].join("---");
|
|
154
|
-
}
|
|
155
|
-
if (typeof index === "number") {
|
|
156
|
-
return [
|
|
157
|
-
(_b = object._content_source) == null ? void 0 : _b.queryId,
|
|
158
|
-
[...object._content_source.path, property, index].join(".")
|
|
159
|
-
].join("---");
|
|
160
|
-
}
|
|
161
|
-
return [
|
|
162
|
-
(_c = object._content_source) == null ? void 0 : _c.queryId,
|
|
163
|
-
[...object._content_source.path, property].join(".")
|
|
164
|
-
].join("---");
|
|
165
|
-
}
|
|
166
|
-
return "";
|
|
167
|
-
};
|
|
168
|
-
const addMetadata = (id, object, path) => {
|
|
169
|
-
Object.entries(object).forEach(([key, value]) => {
|
|
170
|
-
if (Array.isArray(value)) {
|
|
171
|
-
value.forEach((item, index) => {
|
|
172
|
-
if (isScalarOrUndefined(item)) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (Array.isArray(item)) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const itemObject = item;
|
|
179
|
-
addMetadata(id, itemObject, [...path, key, index]);
|
|
180
|
-
});
|
|
181
|
-
} else {
|
|
182
|
-
if (isScalarOrUndefined(value)) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const itemObject = value;
|
|
186
|
-
addMetadata(id, itemObject, [...path, key]);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
if ((object == null ? void 0 : object.type) === "root") {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
object._content_source = {
|
|
193
|
-
queryId: id,
|
|
194
|
-
path
|
|
195
|
-
};
|
|
196
|
-
return object;
|
|
197
|
-
};
|
|
198
|
-
function isScalarOrUndefined(value) {
|
|
199
|
-
const type = typeof value;
|
|
200
|
-
if (type === "string")
|
|
201
|
-
return true;
|
|
202
|
-
if (type === "number")
|
|
203
|
-
return true;
|
|
204
|
-
if (type === "boolean")
|
|
205
|
-
return true;
|
|
206
|
-
if (type === "undefined")
|
|
207
|
-
return true;
|
|
208
|
-
if (value == null)
|
|
209
|
-
return true;
|
|
210
|
-
if (value instanceof String)
|
|
211
|
-
return true;
|
|
212
|
-
if (value instanceof Number)
|
|
213
|
-
return true;
|
|
214
|
-
if (value instanceof Boolean)
|
|
215
|
-
return true;
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
const hashFromQuery = (input) => {
|
|
219
|
-
let hash = 0;
|
|
220
|
-
for (let i = 0; i < input.length; i++) {
|
|
221
|
-
const char = input.charCodeAt(i);
|
|
222
|
-
hash = (hash << 5) - hash + char & 4294967295;
|
|
223
|
-
}
|
|
224
|
-
const nonNegativeHash = Math.abs(hash);
|
|
225
|
-
const alphanumericHash = nonNegativeHash.toString(36);
|
|
226
|
-
return alphanumericHash;
|
|
227
|
-
};
|
|
228
|
-
export {
|
|
229
|
-
addMetadata,
|
|
230
|
-
hashFromQuery,
|
|
231
|
-
tinaField,
|
|
232
|
-
useEditState,
|
|
233
|
-
useTina
|
|
234
|
-
};
|
package/dist/rich-text/index.mjs
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
const TinaMarkdown = ({
|
|
3
|
-
content,
|
|
4
|
-
components = {}
|
|
5
|
-
}) => {
|
|
6
|
-
if (!content) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const nodes = Array.isArray(content) ? content : content.children;
|
|
10
|
-
if (!nodes) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, nodes.map((child, index) => {
|
|
14
|
-
return /* @__PURE__ */ React.createElement(MemoNode, { components, key: index, child });
|
|
15
|
-
}));
|
|
16
|
-
};
|
|
17
|
-
const Leaf = (props) => {
|
|
18
|
-
if (props.bold) {
|
|
19
|
-
const { bold, ...rest } = props;
|
|
20
|
-
if (props.components.bold) {
|
|
21
|
-
const Component = props.components.bold;
|
|
22
|
-
return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ React.createElement("strong", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
25
|
-
}
|
|
26
|
-
if (props.italic) {
|
|
27
|
-
const { italic, ...rest } = props;
|
|
28
|
-
if (props.components.italic) {
|
|
29
|
-
const Component = props.components.italic;
|
|
30
|
-
return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ React.createElement("em", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
33
|
-
}
|
|
34
|
-
if (props.underline) {
|
|
35
|
-
const { underline, ...rest } = props;
|
|
36
|
-
if (props.components.underline) {
|
|
37
|
-
const Component = props.components.underline;
|
|
38
|
-
return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
39
|
-
}
|
|
40
|
-
return /* @__PURE__ */ React.createElement("u", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
41
|
-
}
|
|
42
|
-
if (props.strikethrough) {
|
|
43
|
-
const { strikethrough, ...rest } = props;
|
|
44
|
-
if (props.components.strikethrough) {
|
|
45
|
-
const Component = props.components.strikethrough;
|
|
46
|
-
return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ React.createElement("s", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
49
|
-
}
|
|
50
|
-
if (props.code) {
|
|
51
|
-
const { code, ...rest } = props;
|
|
52
|
-
if (props.components.code) {
|
|
53
|
-
const Component = props.components.code;
|
|
54
|
-
return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
55
|
-
}
|
|
56
|
-
return /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
|
|
57
|
-
}
|
|
58
|
-
if (props.components.text) {
|
|
59
|
-
const Component = props.components.text;
|
|
60
|
-
return /* @__PURE__ */ React.createElement(Component, null, props.text);
|
|
61
|
-
}
|
|
62
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
|
|
63
|
-
};
|
|
64
|
-
const MemoNode = (props) => {
|
|
65
|
-
const MNode = React.useMemo(
|
|
66
|
-
() => /* @__PURE__ */ React.createElement(Node, { ...props }),
|
|
67
|
-
[JSON.stringify(props)]
|
|
68
|
-
);
|
|
69
|
-
return MNode;
|
|
70
|
-
};
|
|
71
|
-
const Node = ({ components, child }) => {
|
|
72
|
-
var _a, _b, _c, _d, _e, _f;
|
|
73
|
-
const { children, ...props } = child;
|
|
74
|
-
switch (child.type) {
|
|
75
|
-
case "h1":
|
|
76
|
-
case "h2":
|
|
77
|
-
case "h3":
|
|
78
|
-
case "h4":
|
|
79
|
-
case "h5":
|
|
80
|
-
case "h6":
|
|
81
|
-
case "p":
|
|
82
|
-
case "blockquote":
|
|
83
|
-
case "ol":
|
|
84
|
-
case "ul":
|
|
85
|
-
case "li":
|
|
86
|
-
if (components[child.type]) {
|
|
87
|
-
const Component2 = components[child.type];
|
|
88
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
|
|
89
|
-
}
|
|
90
|
-
return React.createElement(child.type, {
|
|
91
|
-
children: /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children })
|
|
92
|
-
});
|
|
93
|
-
case "lic":
|
|
94
|
-
if (components.lic) {
|
|
95
|
-
const Component2 = components.lic;
|
|
96
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
|
|
97
|
-
}
|
|
98
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: child.children }));
|
|
99
|
-
case "img":
|
|
100
|
-
if (components[child.type]) {
|
|
101
|
-
const Component2 = components[child.type];
|
|
102
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props });
|
|
103
|
-
}
|
|
104
|
-
return /* @__PURE__ */ React.createElement("img", { src: child.url, alt: child.alt });
|
|
105
|
-
case "a":
|
|
106
|
-
if (components[child.type]) {
|
|
107
|
-
const Component2 = components[child.type];
|
|
108
|
-
return (
|
|
109
|
-
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
110
|
-
/* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
return (
|
|
114
|
-
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
115
|
-
/* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
116
|
-
);
|
|
117
|
-
case "code_block":
|
|
118
|
-
const value = child.value;
|
|
119
|
-
if (components[child.type]) {
|
|
120
|
-
const Component2 = components[child.type];
|
|
121
|
-
return (
|
|
122
|
-
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
123
|
-
/* @__PURE__ */ React.createElement(Component2, { ...props })
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
|
|
127
|
-
case "hr":
|
|
128
|
-
if (components[child.type]) {
|
|
129
|
-
const Component2 = components[child.type];
|
|
130
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props });
|
|
131
|
-
}
|
|
132
|
-
return /* @__PURE__ */ React.createElement("hr", null);
|
|
133
|
-
case "break":
|
|
134
|
-
if (components[child.type]) {
|
|
135
|
-
const Component2 = components[child.type];
|
|
136
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props });
|
|
137
|
-
}
|
|
138
|
-
return /* @__PURE__ */ React.createElement("br", null);
|
|
139
|
-
case "text":
|
|
140
|
-
return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
|
|
141
|
-
case "mdxJsxTextElement":
|
|
142
|
-
case "mdxJsxFlowElement":
|
|
143
|
-
const Component = components[child.name];
|
|
144
|
-
if (Component) {
|
|
145
|
-
const props2 = child.props ? child.props : {};
|
|
146
|
-
return /* @__PURE__ */ React.createElement(Component, { ...props2 });
|
|
147
|
-
} else {
|
|
148
|
-
if (child.name === "table") {
|
|
149
|
-
const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
|
|
150
|
-
const rows = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
|
|
151
|
-
const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
|
|
152
|
-
const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
|
|
153
|
-
const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
|
|
154
|
-
const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
155
|
-
const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
156
|
-
const align = ((_f = child.props) == null ? void 0 : _f.align) || [];
|
|
157
|
-
return /* @__PURE__ */ React.createElement(TableComponent, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent, null, header.tableCells.map((c, i) => {
|
|
158
|
-
return /* @__PURE__ */ React.createElement(
|
|
159
|
-
TinaMarkdown,
|
|
160
|
-
{
|
|
161
|
-
key: i,
|
|
162
|
-
components: {
|
|
163
|
-
p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align[i], ...props2 })
|
|
164
|
-
},
|
|
165
|
-
content: c.value
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}))), /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
|
|
169
|
-
var _a2;
|
|
170
|
-
return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
|
|
171
|
-
return /* @__PURE__ */ React.createElement(
|
|
172
|
-
TinaMarkdown,
|
|
173
|
-
{
|
|
174
|
-
key: i2,
|
|
175
|
-
components: {
|
|
176
|
-
p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
|
|
177
|
-
},
|
|
178
|
-
content: c.value
|
|
179
|
-
}
|
|
180
|
-
);
|
|
181
|
-
}));
|
|
182
|
-
})));
|
|
183
|
-
}
|
|
184
|
-
const ComponentMissing = components["component_missing"];
|
|
185
|
-
if (ComponentMissing) {
|
|
186
|
-
return /* @__PURE__ */ React.createElement(ComponentMissing, { name: child.name });
|
|
187
|
-
} else {
|
|
188
|
-
return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
case "maybe_mdx":
|
|
192
|
-
return null;
|
|
193
|
-
case "html":
|
|
194
|
-
case "html_inline":
|
|
195
|
-
if (components[child.type]) {
|
|
196
|
-
const Component2 = components[child.type];
|
|
197
|
-
return /* @__PURE__ */ React.createElement(Component2, { ...props });
|
|
198
|
-
}
|
|
199
|
-
return child.value;
|
|
200
|
-
case "invalid_markdown":
|
|
201
|
-
return /* @__PURE__ */ React.createElement("pre", null, child.value);
|
|
202
|
-
default:
|
|
203
|
-
if (typeof child.text === "string") {
|
|
204
|
-
return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
export {
|
|
209
|
-
TinaMarkdown
|
|
210
|
-
};
|
package/dist/rich-text/prism.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Highlight, themes } from "prism-react-renderer";
|
|
3
|
-
const Prism = (props) => {
|
|
4
|
-
return /* @__PURE__ */ React.createElement(
|
|
5
|
-
Highlight,
|
|
6
|
-
{
|
|
7
|
-
theme: themes[props.theme || "github"],
|
|
8
|
-
code: props.value,
|
|
9
|
-
language: props.lang || ""
|
|
10
|
-
},
|
|
11
|
-
({ className, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React.createElement("pre", { className, style }, tokens.map((line, i) => /* @__PURE__ */ React.createElement("div", { ...getLineProps({ line, key: i }) }, line.map((token, key) => /* @__PURE__ */ React.createElement("span", { ...getTokenProps({ token, key }) })))))
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
Prism
|
|
16
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const CodeBlockElement: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
3
|
-
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
4
|
-
} & Omit<{
|
|
5
|
-
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
6
|
-
asChild?: boolean | undefined;
|
|
7
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
8
|
-
ref?: React.Ref<any>;
|
|
9
|
-
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
10
|
-
element: import("@udecode/plate-common").TElement;
|
|
11
|
-
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* This fixes a bug where you can't delete between two void nodes
|
|
4
|
-
* without deleting the first node.
|
|
5
|
-
*
|
|
6
|
-
* https://github.com/ianstormtaylor/slate/issues/3991#issuecomment-832160304
|
|
7
|
-
*/
|
|
8
|
-
export declare const withCorrectVoidBehavior: (editor: any) => any;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const createCodeBlockPlugin: <OP = import("@udecode/plate-common").AnyObject, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
|
2
|
-
export declare const createHTMLBlockPlugin: <OP = import("@udecode/plate-common").AnyObject, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
|
3
|
-
export declare const createHTMLInlinePlugin: <OP = import("@udecode/plate-common").AnyObject, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type BaseRange } from 'slate';
|
|
3
|
-
import { createLinkPlugin } from '@udecode/plate-link';
|
|
4
|
-
import { type PlateEditor } from '@udecode/plate-common';
|
|
5
|
-
export { createLinkPlugin };
|
|
6
|
-
type LinkElement = {
|
|
7
|
-
url?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
text: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
export declare const wrapOrRewrapLink: (editor: any) => void;
|
|
12
|
-
export declare const LinkForm: (props: any) => React.JSX.Element;
|
|
13
|
-
export declare const unwrapLink: (editor: PlateEditor, selection?: BaseRange) => void;
|
|
14
|
-
export declare const getLinks: (editor: any) => Generator<import("@udecode/plate-common").TNodeEntry<LinkElement>, void, undefined>;
|
|
15
|
-
export declare const isLinkActive: (editor: any) => boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SoftBreakPlugin } from './types';
|
|
2
|
-
export declare const KEY_SOFT_BREAK = "break";
|
|
3
|
-
/**
|
|
4
|
-
* This code is mostly copied from the plate soft-break plugin
|
|
5
|
-
* [here](https://github.com/udecode/plate/blob/3c0de39a66308a9b718cf9f35623502702ae2af4/packages/editor/break/src/soft-break/index.ts)
|
|
6
|
-
*/
|
|
7
|
-
export declare const createSoftBreakPlugin: <OP = SoftBreakPlugin, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { QueryNodeOptions } from '@udecode/plate-common';
|
|
2
|
-
export interface SoftBreakRule {
|
|
3
|
-
hotkey: string;
|
|
4
|
-
/**
|
|
5
|
-
* Filter the block types where the rule applies.
|
|
6
|
-
*/
|
|
7
|
-
query?: QueryNodeOptions;
|
|
8
|
-
}
|
|
9
|
-
export interface SoftBreakPlugin {
|
|
10
|
-
rules?: SoftBreakRule[];
|
|
11
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type PlateEditor, type TElement } from '@udecode/plate-common';
|
|
3
|
-
export declare const CodeBlock: ({ attributes, editor, element, language: restrictLanguage, ...props }: {
|
|
4
|
-
attributes: Record<string, unknown>;
|
|
5
|
-
element: TElement;
|
|
6
|
-
editor: PlateEditor;
|
|
7
|
-
language?: string;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}) => React.JSX.Element;
|