@rebasepro/cms 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CollectionEditorDialog-DQjLtp1W.js → CollectionEditorDialog-C-A_NCKB.js} +15 -14
- package/dist/CollectionEditorDialog-C-A_NCKB.js.map +1 -0
- package/dist/JsonPreviewBinding-v0w3H0fp.js +35 -0
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +1 -0
- package/dist/{PropertyEditView-BMCCD2OI.js → PropertyEditView-Dv7496fx.js} +2 -57
- package/dist/{PropertyEditView-BMCCD2OI.js.map → PropertyEditView-Dv7496fx.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-DwsbIAqr.js → RouterCollectionsStudioView-DuDFEYuL.js} +4 -4
- package/dist/{RouterCollectionsStudioView-DwsbIAqr.js.map → RouterCollectionsStudioView-DuDFEYuL.js.map} +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +126 -2
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +201 -2
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +92 -2
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +43 -2
- package/dist/collection_editor_ui.js +4 -4
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +6 -2
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +11 -1
- package/dist/components/DeleteEntityDialog.d.ts +11 -3
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_export/export/fetch_export_data.d.ts +10 -16
- package/dist/editor/editor.d.ts +1 -6
- package/dist/editor.js +1 -1
- package/dist/editor.js.map +1 -1
- package/dist/{export-DJoGYb89.js → export-DtSmLT6u.js} +54 -42
- package/dist/export-DtSmLT6u.js.map +1 -0
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/{history-BBpsdTrJ.js → history-C6kUDQ3f.js} +2 -2
- package/dist/{history-BBpsdTrJ.js.map → history-C6kUDQ3f.js.map} +1 -1
- package/dist/{import-C4VQ0rwO.js → import-BciQBH5t.js} +2 -2
- package/dist/{import-C4VQ0rwO.js.map → import-BciQBH5t.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/selection/SelectionMenu.d.ts +27 -0
- package/dist/selection/index.d.ts +2 -0
- package/dist/selection/resolve_selection.d.ts +62 -0
- package/dist/types/components/EntityFormProps.d.ts +13 -0
- package/dist/util/entity_pages.d.ts +36 -0
- package/dist/util/map_with_concurrency.d.ts +16 -0
- package/dist/{util-4oPxPkbp.js → util-h6jhiiBE.js} +674 -195
- package/dist/util-h6jhiiBE.js.map +1 -0
- package/package.json +9 -9
- package/dist/CollectionEditorDialog-DQjLtp1W.js.map +0 -1
- package/dist/export-DJoGYb89.js.map +0 -1
- package/dist/util-4oPxPkbp.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { useModeController } from "@rebasepro/app";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Highlight, themes } from "prism-react-renderer";
|
|
5
|
+
//#region src/components/JsonPreviewBinding.tsx
|
|
6
|
+
function JsonPreviewBinding({ values }) {
|
|
7
|
+
const code = JSON.stringify(values, null, " ");
|
|
8
|
+
const { mode } = useModeController();
|
|
9
|
+
const preRef = useRef(null);
|
|
10
|
+
return /* @__PURE__ */ jsx(Highlight, {
|
|
11
|
+
theme: mode === "dark" ? themes.vsDark : themes.github,
|
|
12
|
+
code,
|
|
13
|
+
language: "json",
|
|
14
|
+
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx("pre", {
|
|
15
|
+
ref: preRef,
|
|
16
|
+
style: {
|
|
17
|
+
...style,
|
|
18
|
+
backgroundColor: "inherit"
|
|
19
|
+
},
|
|
20
|
+
className: "max-w-6xl mx-auto p-8 rounded-xs text-sm",
|
|
21
|
+
children: tokens.map((line, i) => /* @__PURE__ */ jsx("div", {
|
|
22
|
+
...getLineProps({ line }),
|
|
23
|
+
className: "text-wrap",
|
|
24
|
+
children: line.map((token, key) => /* @__PURE__ */ jsx("span", {
|
|
25
|
+
...getTokenProps({ token }),
|
|
26
|
+
className: "word-break"
|
|
27
|
+
}, key))
|
|
28
|
+
}, i))
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { JsonPreviewBinding };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=JsonPreviewBinding-v0w3H0fp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonPreviewBinding-v0w3H0fp.js","names":[],"sources":["../src/components/JsonPreviewBinding.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { Highlight, themes } from \"prism-react-renderer\";\nimport { useModeController } from \"@rebasepro/app\";\n\nexport function JsonPreviewBinding({ values }: { values: object }) {\n const code = JSON.stringify(values, null, \"\\t\");\n const { mode } = useModeController();\n const preRef = useRef<HTMLPreElement>(null);\n\n // Global keydown handler\n // const handleGlobalKeyDown = useCallback((e: KeyboardEvent) => {\n // // Check for Control (Windows/Linux) or Command (macOS) + \"a\":\n // if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === \"a\") {\n // // If our code view is mounted, perform selection\n // if (preRef.current) {\n // e.preventDefault();\n // e.stopPropagation();\n //\n // const selection = window.getSelection();\n // const range = document.createRange();\n // range.selectNodeContents(preRef.current);\n // if (selection) {\n // selection.removeAllRanges();\n // selection.addRange(range);\n // }\n // }\n // }\n // }, []);\n\n // // Attach the global keydown listener when component mounts,\n // // and remove it when it unmounts.\n // useEffect(() => {\n // document.addEventListener(\"keydown\", handleGlobalKeyDown);\n // return () => {\n // document.removeEventListener(\"keydown\", handleGlobalKeyDown);\n // };\n // }, [handleGlobalKeyDown]);\n\n return (\n <Highlight\n theme={mode === \"dark\" ? themes.vsDark : themes.github}\n code={code}\n language=\"json\"\n >\n {({ style, tokens, getLineProps, getTokenProps }) => (\n <pre\n // Bind the ref to our pre element so we can select its contents.\n ref={preRef}\n style={{\n ...style,\n backgroundColor: \"inherit\"\n }}\n className=\"max-w-6xl mx-auto p-8 rounded-xs text-sm\"\n >\n {tokens.map((line, i) => (\n <div key={i} {...getLineProps({ line })} className=\"text-wrap\">\n {line.map((token, key) => (\n <span key={key} {...getTokenProps({ token })} className=\"word-break\"/>\n ))}\n </div>\n ))}\n </pre>\n )}\n </Highlight>\n );\n}\n"],"mappings":";;;;;AAIA,SAAgB,mBAAmB,EAAE,UAA8B;CAC/D,MAAM,OAAO,KAAK,UAAU,QAAQ,MAAM,GAAI;CAC9C,MAAM,EAAE,SAAS,kBAAkB;CACnC,MAAM,SAAS,OAAuB,IAAI;CA+B1C,OACI,oBAAC,WAAD;EACI,OAAO,SAAS,SAAS,OAAO,SAAS,OAAO;EAC1C;EACN,UAAS;aAEP,EAAE,OAAO,QAAQ,cAAc,oBAC7B,oBAAC,OAAD;GAEI,KAAK;GACL,OAAO;IACH,GAAG;IACH,iBAAiB;GACrB;GACA,WAAU;aAEnB,OAAO,KAAK,MAAM,MACf,oBAAC,OAAD;IAAa,GAAI,aAAa,EAAE,KAAK,CAAC;IAAG,WAAU;cAC9C,KAAK,KAAK,OAAO,QACd,oBAAC,QAAD;KAAgB,GAAI,cAAc,EAAE,MAAM,CAAC;KAAG,WAAU;IAAa,GAA1D,GAA0D,CACxE;GACA,GAJK,CAIL,CACR;EACE,CAAA;CAEM,CAAA;AAEnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { A as getFieldId, E as DEFAULT_FIELD_CONFIGS,
|
|
2
|
+
import { A as getFieldId, E as DEFAULT_FIELD_CONFIGS, Kt as FieldCaption, Ut as ArrayContainer, Wt as PropertyConfigBadge, a as namespaceToPropertiesPath, ct as useSafeSnackbarController, g as toSerializableProperty, i as namespaceToPropertiesOrderPath, k as getFieldConfig, m as toSerializableCollectionConfig, n as getFullIdPath, r as idToPropertiesPath, t as getFullId, tr as useCollectionRegistryController } from "./util-h6jhiiBE.js";
|
|
3
3
|
import React, { createContext, useCallback, useContext, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { deepEqual } from "fast-equals";
|
|
5
5
|
import { AlertTriangleIcon, ArrowDownToLineIcon, ArrowUpToLineIcon, Badge, BooleanSwitchWithLabel, Button, Card, CheckSquareIcon, CircularProgress, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, ExpandablePanel, FileSearchIcon, FunctionSquareIcon, IconButton, InfoLabel, ListIcon, Menu, MenuItem, MinusCircleIcon, MoreVerticalIcon, MultiSelect, MultiSelectItem, Paper, PlusIcon, RefreshCcwIcon, Select, SelectItem, SettingsIcon, TextField, Tooltip, Trash2Icon, Typography, UploadCloudIcon, cls, defaultBorderMixin, iconSize } from "@rebasepro/ui";
|
|
@@ -3086,21 +3086,8 @@ function MarkdownPropertyField({ disabled, showErrors }) {
|
|
|
3086
3086
|
const fileNameValue = getIn(values, fileName) ?? "{rand}_{file}";
|
|
3087
3087
|
const storagePathValue = getIn(values, storagePath) ?? "/";
|
|
3088
3088
|
const maxSizeValue = getIn(values, maxSize);
|
|
3089
|
-
const markdownValue = getIn(values, "markdown");
|
|
3090
|
-
const isMarkdownObject = typeof markdownValue === "object" && markdownValue !== null;
|
|
3091
|
-
const htmlValue = isMarkdownObject ? markdownValue.html ?? true : true;
|
|
3092
|
-
const transformPastedTextValue = isMarkdownObject ? markdownValue.transformPastedText ?? false : false;
|
|
3093
3089
|
const hasFilenameCallback = typeof fileNameValue === "function";
|
|
3094
3090
|
const hasStoragePathCallback = typeof storagePathValue === "function";
|
|
3095
|
-
const updateMarkdownConfig = useCallback((key, value) => {
|
|
3096
|
-
const currentMarkdown = getIn(values, "markdown");
|
|
3097
|
-
if (typeof currentMarkdown === "object" && currentMarkdown !== null) setFieldValue(`markdown.${key}`, value);
|
|
3098
|
-
else setFieldValue("markdown", {
|
|
3099
|
-
html: true,
|
|
3100
|
-
transformPastedText: false,
|
|
3101
|
-
[key]: value
|
|
3102
|
-
});
|
|
3103
|
-
}, [values, setFieldValue]);
|
|
3104
3091
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3105
3092
|
/* @__PURE__ */ jsx("div", {
|
|
3106
3093
|
className: "col-span-12",
|
|
@@ -3115,48 +3102,6 @@ function MarkdownPropertyField({ disabled, showErrors }) {
|
|
|
3115
3102
|
showErrors
|
|
3116
3103
|
}) })
|
|
3117
3104
|
}),
|
|
3118
|
-
/* @__PURE__ */ jsx("div", {
|
|
3119
|
-
className: "col-span-12",
|
|
3120
|
-
children: /* @__PURE__ */ jsx(ExpandablePanel, {
|
|
3121
|
-
title: /* @__PURE__ */ jsxs("div", {
|
|
3122
|
-
className: "flex flex-row text-surface-500",
|
|
3123
|
-
children: [/* @__PURE__ */ jsx(SettingsIcon, {}), /* @__PURE__ */ jsx(Typography, {
|
|
3124
|
-
variant: "subtitle2",
|
|
3125
|
-
className: "ml-4",
|
|
3126
|
-
children: "Paste behavior"
|
|
3127
|
-
})]
|
|
3128
|
-
}),
|
|
3129
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
3130
|
-
className: "flex flex-col gap-2 p-4",
|
|
3131
|
-
children: [
|
|
3132
|
-
/* @__PURE__ */ jsx(BooleanSwitchWithLabel, {
|
|
3133
|
-
size: "small",
|
|
3134
|
-
disabled,
|
|
3135
|
-
value: !htmlValue,
|
|
3136
|
-
onValueChange: (value) => updateMarkdownConfig("html", !value),
|
|
3137
|
-
label: t("markdown_strip_html")
|
|
3138
|
-
}),
|
|
3139
|
-
/* @__PURE__ */ jsx(Typography, {
|
|
3140
|
-
variant: "caption",
|
|
3141
|
-
className: "ml-3.5 mt-1 mb-2",
|
|
3142
|
-
children: "Remove HTML tags and inline styles when pasting content from external sources"
|
|
3143
|
-
}),
|
|
3144
|
-
/* @__PURE__ */ jsx(BooleanSwitchWithLabel, {
|
|
3145
|
-
size: "small",
|
|
3146
|
-
disabled,
|
|
3147
|
-
value: transformPastedTextValue,
|
|
3148
|
-
onValueChange: (value) => updateMarkdownConfig("transformPastedText", value),
|
|
3149
|
-
label: t("markdown_convert_pasted")
|
|
3150
|
-
}),
|
|
3151
|
-
/* @__PURE__ */ jsx(Typography, {
|
|
3152
|
-
variant: "caption",
|
|
3153
|
-
className: "ml-3.5 mt-1 mb-2",
|
|
3154
|
-
children: "Convert rich text (from Google Docs, Word, etc.) to clean markdown format"
|
|
3155
|
-
})
|
|
3156
|
-
]
|
|
3157
|
-
})
|
|
3158
|
-
})
|
|
3159
|
-
}),
|
|
3160
3105
|
/* @__PURE__ */ jsx("div", {
|
|
3161
3106
|
className: "col-span-12",
|
|
3162
3107
|
children: /* @__PURE__ */ jsx(ExpandablePanel, {
|
|
@@ -3857,4 +3802,4 @@ function WidgetSelectViewItem({ onClick, initialProperty, propertyConfig, existi
|
|
|
3857
3802
|
//#endregion
|
|
3858
3803
|
export { updatePropertyFromWidget as a, useAIModifiedPaths as c, supportedFields as i, PropertyForm as n, PropertyTree as o, PropertyFormDialog as r, AIModifiedPathsProvider as s, PropertyEditView_exports as t };
|
|
3859
3804
|
|
|
3860
|
-
//# sourceMappingURL=PropertyEditView-
|
|
3805
|
+
//# sourceMappingURL=PropertyEditView-Dv7496fx.js.map
|