@uxf/cms 11.128.2 → 11.130.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/components.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as contentBuilderStories from "./content-builder/content-builder.storie
2
2
  import * as inviteUserFormStories from "./forms/invite-user-form/invite-user-form.stories";
3
3
  import * as loginFormStories from "./forms/login-form/login-form.stories";
4
4
  import * as renewPasswordFormStories from "./forms/renew-password-form/renew-password-form.stories";
5
+ import * as wysiwygInputStories from "./forms/components/wysiwyg-input/wysiwyg-input.stories";
5
6
  export declare const components: {
6
7
  readonly "content-builder": {
7
8
  readonly title: "ContentBuilder";
@@ -19,4 +20,8 @@ export declare const components: {
19
20
  readonly title: "RenewPasswordForm";
20
21
  readonly stories: typeof renewPasswordFormStories;
21
22
  };
23
+ readonly "wysiwyg-input": {
24
+ readonly title: "WysiwygInput";
25
+ readonly stories: typeof wysiwygInputStories;
26
+ };
22
27
  };
package/components.js CHANGED
@@ -39,6 +39,7 @@ const contentBuilderStories = __importStar(require("./content-builder/content-bu
39
39
  const inviteUserFormStories = __importStar(require("./forms/invite-user-form/invite-user-form.stories"));
40
40
  const loginFormStories = __importStar(require("./forms/login-form/login-form.stories"));
41
41
  const renewPasswordFormStories = __importStar(require("./forms/renew-password-form/renew-password-form.stories"));
42
+ const wysiwygInputStories = __importStar(require("./forms/components/wysiwyg-input/wysiwyg-input.stories"));
42
43
  exports.components = {
43
44
  "content-builder": {
44
45
  title: "ContentBuilder",
@@ -56,4 +57,8 @@ exports.components = {
56
57
  title: "RenewPasswordForm",
57
58
  stories: renewPasswordFormStories
58
59
  },
60
+ "wysiwyg-input": {
61
+ title: "WysiwygInput",
62
+ stories: wysiwygInputStories
63
+ },
59
64
  };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ /**
3
+ * The editor as backoffice actually uses it: a field among other fields, inside a form that submits.
4
+ * The neighbours are what make tabbing in and out testable, and the submitted value is rendered so
5
+ * submitting is observable without the console.
6
+ *
7
+ * Image upload is faked here. `WysiwygInput` otherwise defaults to the real `uploadFile` API.
8
+ */
9
+ export declare function Default(): React.JSX.Element;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Default = Default;
37
+ const form_1 = require("@uxf/form/form");
38
+ const text_input_1 = require("@uxf/form/text-input");
39
+ const button_1 = require("@uxf/ui/button");
40
+ const react_1 = __importStar(require("react"));
41
+ const react_hook_form_1 = require("react-hook-form");
42
+ const widget_1 = require("../../../ui/widget");
43
+ const wysiwyg_input_1 = require("./wysiwyg-input");
44
+ /**
45
+ * The editor as backoffice actually uses it: a field among other fields, inside a form that submits.
46
+ * The neighbours are what make tabbing in and out testable, and the submitted value is rendered so
47
+ * submitting is observable without the console.
48
+ *
49
+ * Image upload is faked here. `WysiwygInput` otherwise defaults to the real `uploadFile` API.
50
+ */
51
+ function Default() {
52
+ const [submitted, setSubmitted] = (0, react_1.useState)(null);
53
+ const formApi = (0, react_hook_form_1.useForm)({
54
+ defaultValues: { content: [], perex: "", title: "" },
55
+ });
56
+ return (react_1.default.createElement("div", { className: "p-8" },
57
+ react_1.default.createElement(form_1.Form, { formApi: formApi, id: "article-form", onSubmit: (data) => setSubmitted(data) },
58
+ react_1.default.createElement(widget_1.Widget, { className: "[&>*]:p-4", footer: react_1.default.createElement("div", { className: "text-right" },
59
+ react_1.default.createElement(button_1.Button, { type: "submit" }, "Ulo\u017Eit")), withDividers: true },
60
+ react_1.default.createElement(text_input_1.TextInput, { control: formApi.control, label: "Titulek", name: "title" }),
61
+ react_1.default.createElement(wysiwyg_input_1.WysiwygInput, { allPluginsOptions: {
62
+ image: {
63
+ getImageUrl: (file) => file.name,
64
+ uploadImage: async (file) => ({
65
+ extension: ".ext",
66
+ id: 1,
67
+ name: URL.createObjectURL(file),
68
+ namespace: "wysiwyg",
69
+ uuid: "this-should-be-some-random-uuid",
70
+ }),
71
+ },
72
+ }, control: formApi.control, isRequired: true, label: "Obsah", name: "content", placeholder: "Za\u010Dni ps\u00E1t\u2026", requiredMessage: "Obsah je povinn\u00FD" }),
73
+ react_1.default.createElement(text_input_1.TextInput, { control: formApi.control, label: "Perex", name: "perex" }))),
74
+ submitted && (react_1.default.createElement("pre", { className: "mt-8 overflow-x-auto rounded bg-gray-100 p-4 text-xs", "data-testid": "submitted-value" }, JSON.stringify(submitted, null, 2)))));
75
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/cms",
3
- "version": "11.128.2",
3
+ "version": "11.130.0",
4
4
  "description": "UXF Cms",
5
5
  "author": "UXFans <dev@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/cms#readme",
@@ -32,14 +32,14 @@
32
32
  "@dnd-kit/sortable": "^10.0.0",
33
33
  "@dnd-kit/utilities": "^3.2.2",
34
34
  "@floating-ui/react": "^0.27.20",
35
- "@uxf/core": "11.128.0",
36
- "@uxf/core-react": "11.128.0",
37
- "@uxf/data-grid": "11.128.1",
38
- "@uxf/form": "11.128.1",
39
- "@uxf/router": "11.128.0",
40
- "@uxf/styles": "11.128.0",
41
- "@uxf/ui": "11.128.1",
42
- "@uxf/wysiwyg": "11.128.2",
35
+ "@uxf/core": "11.129.0",
36
+ "@uxf/core-react": "11.129.0",
37
+ "@uxf/data-grid": "11.129.0",
38
+ "@uxf/form": "11.129.0",
39
+ "@uxf/router": "11.129.0",
40
+ "@uxf/styles": "11.129.0",
41
+ "@uxf/ui": "11.129.0",
42
+ "@uxf/wysiwyg": "11.130.0",
43
43
  "axios": "^1.19.0",
44
44
  "axios-hooks": "^5.1.1",
45
45
  "next": ">=13.2.0",
@@ -56,14 +56,14 @@
56
56
  "@types/node": "24",
57
57
  "@types/react": "18.3.31",
58
58
  "@types/react-dom": "18.3.7",
59
- "@uxf/core": "11.128.0",
60
- "@uxf/core-react": "11.128.0",
61
- "@uxf/data-grid": "11.128.1",
62
- "@uxf/form": "11.128.1",
63
- "@uxf/router": "11.128.0",
64
- "@uxf/styles": "11.128.0",
65
- "@uxf/ui": "11.128.1",
66
- "@uxf/wysiwyg": "11.128.2",
59
+ "@uxf/core": "11.129.0",
60
+ "@uxf/core-react": "11.129.0",
61
+ "@uxf/data-grid": "11.129.0",
62
+ "@uxf/form": "11.129.0",
63
+ "@uxf/router": "11.129.0",
64
+ "@uxf/styles": "11.129.0",
65
+ "@uxf/ui": "11.129.0",
66
+ "@uxf/wysiwyg": "11.130.0",
67
67
  "axios": "^1.19.0",
68
68
  "axios-hooks": "^5.1.1",
69
69
  "next": "16.3.0",