dn-react-router-toolkit 0.5.8 → 0.6.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/auth/cookie_store.d.mts +1 -1
- package/dist/auth/cookie_store.d.ts +1 -1
- package/dist/auth/cookie_store.js +4 -4
- package/dist/auth/cookie_store.mjs +4 -4
- package/dist/auth/index.js +4 -4
- package/dist/auth/index.mjs +4 -4
- package/dist/client/env_loader.d.mts +2 -2
- package/dist/client/env_loader.d.ts +2 -2
- package/dist/client/file_input.d.mts +10 -0
- package/dist/client/file_input.d.ts +10 -0
- package/dist/client/file_input.js +80 -0
- package/dist/client/file_input.mjs +45 -0
- package/dist/client/index.d.mts +4 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +104 -0
- package/dist/client/index.mjs +102 -0
- package/dist/client/store_text_editor.d.mts +13 -0
- package/dist/client/store_text_editor.d.ts +13 -0
- package/dist/client/store_text_editor.js +94 -0
- package/dist/client/store_text_editor.mjs +59 -0
- package/dist/crud/crud_form.d.mts +4 -6
- package/dist/crud/crud_form.d.ts +4 -6
- package/dist/crud/crud_form.js +147 -100
- package/dist/crud/crud_form.mjs +148 -106
- package/dist/crud/crud_form_provider.d.mts +10 -10
- package/dist/crud/crud_form_provider.d.ts +10 -10
- package/dist/crud/crud_form_provider.js +5 -6
- package/dist/crud/crud_form_provider.mjs +4 -5
- package/dist/crud/crud_page.d.mts +8 -8
- package/dist/crud/crud_page.d.ts +8 -8
- package/dist/crud/crud_page.js +203 -160
- package/dist/crud/crud_page.mjs +200 -162
- package/dist/crud/generate_pages.d.mts +3 -3
- package/dist/crud/generate_pages.d.ts +3 -3
- package/dist/crud/index.d.mts +1 -1
- package/dist/crud/index.d.ts +1 -1
- package/dist/crud/index.js +256 -213
- package/dist/crud/index.mjs +240 -202
- package/dist/form/create_form_component.d.mts +28 -0
- package/dist/form/create_form_component.d.ts +28 -0
- package/dist/form/create_form_component.js +47 -0
- package/dist/form/create_form_component.mjs +12 -0
- package/dist/form/form_components.d.mts +7 -0
- package/dist/form/form_components.d.ts +7 -0
- package/dist/form/form_components.js +64 -0
- package/dist/form/form_components.mjs +25 -0
- package/dist/form/index.d.mts +3 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +66 -0
- package/dist/form/index.mjs +26 -0
- package/dist/post/index.d.mts +2 -0
- package/dist/post/index.d.ts +2 -0
- package/dist/post/index.js +33 -0
- package/dist/post/index.mjs +4 -0
- package/dist/post/thumbnail_picker.d.mts +18 -0
- package/dist/post/thumbnail_picker.d.ts +18 -0
- package/dist/post/thumbnail_picker.js +101 -0
- package/dist/post/thumbnail_picker.mjs +70 -0
- package/dist/seo/seo.d.mts +2 -2
- package/dist/seo/seo.d.ts +2 -2
- package/dist/table/buttons.d.mts +2 -2
- package/dist/table/buttons.d.ts +2 -2
- package/dist/table/index.js +44 -47
- package/dist/table/index.mjs +44 -47
- package/dist/table/page.d.mts +5 -7
- package/dist/table/page.d.ts +5 -7
- package/dist/table/page.js +44 -47
- package/dist/table/page.mjs +44 -47
- package/dist/table/table.d.mts +4 -4
- package/dist/table/table.d.ts +4 -4
- package/package.json +14 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React__default, { HTMLElementType, DetailedHTMLProps, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FormHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type ElementPropsMap = {
|
|
4
|
+
div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
5
|
+
p: DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
|
|
6
|
+
span: DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
7
|
+
input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
8
|
+
textarea: DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
|
|
9
|
+
select: DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
10
|
+
button: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
11
|
+
label: DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
|
|
12
|
+
h1: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
13
|
+
h2: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
14
|
+
h3: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
15
|
+
h4: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
16
|
+
h5: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
17
|
+
h6: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
18
|
+
form: DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
|
|
19
|
+
section: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
20
|
+
header: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
21
|
+
footer: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
22
|
+
};
|
|
23
|
+
type Props<T extends HTMLElementType> = T extends keyof ElementPropsMap ? ElementPropsMap[T] : DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
24
|
+
declare function createComponent<T extends HTMLElementType>(tag: T, options: {
|
|
25
|
+
className?: string;
|
|
26
|
+
}): ({ className, ...props }: Props<T>) => React__default.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { createComponent };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React__default, { HTMLElementType, DetailedHTMLProps, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FormHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type ElementPropsMap = {
|
|
4
|
+
div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
5
|
+
p: DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
|
|
6
|
+
span: DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
7
|
+
input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
8
|
+
textarea: DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
|
|
9
|
+
select: DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
10
|
+
button: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
11
|
+
label: DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
|
|
12
|
+
h1: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
13
|
+
h2: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
14
|
+
h3: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
15
|
+
h4: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
16
|
+
h5: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
17
|
+
h6: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
18
|
+
form: DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
|
|
19
|
+
section: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
20
|
+
header: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
21
|
+
footer: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
22
|
+
};
|
|
23
|
+
type Props<T extends HTMLElementType> = T extends keyof ElementPropsMap ? ElementPropsMap[T] : DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
24
|
+
declare function createComponent<T extends HTMLElementType>(tag: T, options: {
|
|
25
|
+
className?: string;
|
|
26
|
+
}): ({ className, ...props }: Props<T>) => React__default.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { createComponent };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/form/create_form_component.tsx
|
|
31
|
+
var create_form_component_exports = {};
|
|
32
|
+
__export(create_form_component_exports, {
|
|
33
|
+
createComponent: () => createComponent
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(create_form_component_exports);
|
|
36
|
+
var import_utils = require("dn-react-toolkit/utils");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
function createComponent(tag, options) {
|
|
39
|
+
return function FormComponent({ className, ...props }) {
|
|
40
|
+
const Tag = tag;
|
|
41
|
+
return /* @__PURE__ */ import_react.default.createElement(Tag, { ...props, className: (0, import_utils.cn)(options.className, className) });
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
createComponent
|
|
47
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/form/create_form_component.tsx
|
|
2
|
+
import { cn } from "dn-react-toolkit/utils";
|
|
3
|
+
import React from "react";
|
|
4
|
+
function createComponent(tag, options) {
|
|
5
|
+
return function FormComponent({ className, ...props }) {
|
|
6
|
+
const Tag = tag;
|
|
7
|
+
return /* @__PURE__ */ React.createElement(Tag, { ...props, className: cn(options.className, className) });
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
createComponent
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const FormEntry: ({ className, ...props }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => React.JSX.Element;
|
|
4
|
+
declare const FormRow: ({ className, ...props }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => React.JSX.Element;
|
|
5
|
+
declare const FormLabel: ({ className, ...props }: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>) => React.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { FormEntry, FormLabel, FormRow };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const FormEntry: ({ className, ...props }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => React.JSX.Element;
|
|
4
|
+
declare const FormRow: ({ className, ...props }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => React.JSX.Element;
|
|
5
|
+
declare const FormLabel: ({ className, ...props }: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>) => React.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { FormEntry, FormLabel, FormRow };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/form/form_components.tsx
|
|
31
|
+
var form_components_exports = {};
|
|
32
|
+
__export(form_components_exports, {
|
|
33
|
+
FormEntry: () => FormEntry,
|
|
34
|
+
FormLabel: () => FormLabel,
|
|
35
|
+
FormRow: () => FormRow
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(form_components_exports);
|
|
38
|
+
|
|
39
|
+
// src/form/create_form_component.tsx
|
|
40
|
+
var import_utils = require("dn-react-toolkit/utils");
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
function createComponent(tag, options) {
|
|
43
|
+
return function FormComponent({ className, ...props }) {
|
|
44
|
+
const Tag = tag;
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(Tag, { ...props, className: (0, import_utils.cn)(options.className, className) });
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/form/form_components.tsx
|
|
50
|
+
var FormEntry = createComponent("div", {
|
|
51
|
+
className: "flex-1"
|
|
52
|
+
});
|
|
53
|
+
var FormRow = createComponent("div", {
|
|
54
|
+
className: "flex-1 flex gap-4 mb-6"
|
|
55
|
+
});
|
|
56
|
+
var FormLabel = createComponent("label", {
|
|
57
|
+
className: "flex-1 font-semibold mb-2.5 block"
|
|
58
|
+
});
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
FormEntry,
|
|
62
|
+
FormLabel,
|
|
63
|
+
FormRow
|
|
64
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/form/create_form_component.tsx
|
|
2
|
+
import { cn } from "dn-react-toolkit/utils";
|
|
3
|
+
import React from "react";
|
|
4
|
+
function createComponent(tag, options) {
|
|
5
|
+
return function FormComponent({ className, ...props }) {
|
|
6
|
+
const Tag = tag;
|
|
7
|
+
return /* @__PURE__ */ React.createElement(Tag, { ...props, className: cn(options.className, className) });
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/form/form_components.tsx
|
|
12
|
+
var FormEntry = createComponent("div", {
|
|
13
|
+
className: "flex-1"
|
|
14
|
+
});
|
|
15
|
+
var FormRow = createComponent("div", {
|
|
16
|
+
className: "flex-1 flex gap-4 mb-6"
|
|
17
|
+
});
|
|
18
|
+
var FormLabel = createComponent("label", {
|
|
19
|
+
className: "flex-1 font-semibold mb-2.5 block"
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
FormEntry,
|
|
23
|
+
FormLabel,
|
|
24
|
+
FormRow
|
|
25
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/form/index.ts
|
|
31
|
+
var form_exports = {};
|
|
32
|
+
__export(form_exports, {
|
|
33
|
+
FormEntry: () => FormEntry,
|
|
34
|
+
FormLabel: () => FormLabel,
|
|
35
|
+
FormRow: () => FormRow,
|
|
36
|
+
createComponent: () => createComponent
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(form_exports);
|
|
39
|
+
|
|
40
|
+
// src/form/create_form_component.tsx
|
|
41
|
+
var import_utils = require("dn-react-toolkit/utils");
|
|
42
|
+
var import_react = __toESM(require("react"));
|
|
43
|
+
function createComponent(tag, options) {
|
|
44
|
+
return function FormComponent({ className, ...props }) {
|
|
45
|
+
const Tag = tag;
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(Tag, { ...props, className: (0, import_utils.cn)(options.className, className) });
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/form/form_components.tsx
|
|
51
|
+
var FormEntry = createComponent("div", {
|
|
52
|
+
className: "flex-1"
|
|
53
|
+
});
|
|
54
|
+
var FormRow = createComponent("div", {
|
|
55
|
+
className: "flex-1 flex gap-4 mb-6"
|
|
56
|
+
});
|
|
57
|
+
var FormLabel = createComponent("label", {
|
|
58
|
+
className: "flex-1 font-semibold mb-2.5 block"
|
|
59
|
+
});
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
FormEntry,
|
|
63
|
+
FormLabel,
|
|
64
|
+
FormRow,
|
|
65
|
+
createComponent
|
|
66
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/form/create_form_component.tsx
|
|
2
|
+
import { cn } from "dn-react-toolkit/utils";
|
|
3
|
+
import React from "react";
|
|
4
|
+
function createComponent(tag, options) {
|
|
5
|
+
return function FormComponent({ className, ...props }) {
|
|
6
|
+
const Tag = tag;
|
|
7
|
+
return /* @__PURE__ */ React.createElement(Tag, { ...props, className: cn(options.className, className) });
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/form/form_components.tsx
|
|
12
|
+
var FormEntry = createComponent("div", {
|
|
13
|
+
className: "flex-1"
|
|
14
|
+
});
|
|
15
|
+
var FormRow = createComponent("div", {
|
|
16
|
+
className: "flex-1 flex gap-4 mb-6"
|
|
17
|
+
});
|
|
18
|
+
var FormLabel = createComponent("label", {
|
|
19
|
+
className: "flex-1 font-semibold mb-2.5 block"
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
FormEntry,
|
|
23
|
+
FormLabel,
|
|
24
|
+
FormRow,
|
|
25
|
+
createComponent
|
|
26
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// src/post/index.ts
|
|
27
|
+
var post_exports = {};
|
|
28
|
+
module.exports = __toCommonJS(post_exports);
|
|
29
|
+
|
|
30
|
+
// src/post/thumbnail_picker.tsx
|
|
31
|
+
var import_react_store_input = require("react-store-input");
|
|
32
|
+
var import_utils = require("dn-react-toolkit/utils");
|
|
33
|
+
var import_react = __toESM(require("react"));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Store } from 'react-store-input';
|
|
2
|
+
import React__default, { RefObject } from 'react';
|
|
3
|
+
import { TextEditorController } from 'dn-react-text-editor';
|
|
4
|
+
|
|
5
|
+
declare function PostThumbnailPicker<T extends {
|
|
6
|
+
thumbnail: string | null;
|
|
7
|
+
}>({ store, textEditorRef, ResponsiveImage, }: {
|
|
8
|
+
store: Store<T>;
|
|
9
|
+
textEditorRef: RefObject<TextEditorController>;
|
|
10
|
+
ResponsiveImage: React__default.FC<{
|
|
11
|
+
src: string;
|
|
12
|
+
alt: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
sizes?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}): React__default.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { PostThumbnailPicker as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Store } from 'react-store-input';
|
|
2
|
+
import React__default, { RefObject } from 'react';
|
|
3
|
+
import { TextEditorController } from 'dn-react-text-editor';
|
|
4
|
+
|
|
5
|
+
declare function PostThumbnailPicker<T extends {
|
|
6
|
+
thumbnail: string | null;
|
|
7
|
+
}>({ store, textEditorRef, ResponsiveImage, }: {
|
|
8
|
+
store: Store<T>;
|
|
9
|
+
textEditorRef: RefObject<TextEditorController>;
|
|
10
|
+
ResponsiveImage: React__default.FC<{
|
|
11
|
+
src: string;
|
|
12
|
+
alt: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
sizes?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}): React__default.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { PostThumbnailPicker as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/post/thumbnail_picker.tsx
|
|
31
|
+
var thumbnail_picker_exports = {};
|
|
32
|
+
__export(thumbnail_picker_exports, {
|
|
33
|
+
default: () => PostThumbnailPicker
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(thumbnail_picker_exports);
|
|
36
|
+
var import_react_store_input = require("react-store-input");
|
|
37
|
+
var import_utils = require("dn-react-toolkit/utils");
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
function PostThumbnailPicker({
|
|
40
|
+
store,
|
|
41
|
+
textEditorRef,
|
|
42
|
+
ResponsiveImage
|
|
43
|
+
}) {
|
|
44
|
+
const thumbnail = (0, import_react_store_input.useSelector)(store, (state) => state.thumbnail);
|
|
45
|
+
const [thumbnails, setThumbnails] = (0, import_react.useState)([]);
|
|
46
|
+
(0, import_react.useEffect)(() => {
|
|
47
|
+
const update = () => {
|
|
48
|
+
if (!textEditorRef.current) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const html = textEditorRef.current.value;
|
|
52
|
+
if (!html) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const parser = new DOMParser();
|
|
56
|
+
const docHtml = parser.parseFromString(html, "text/html");
|
|
57
|
+
const images = docHtml.querySelectorAll("img");
|
|
58
|
+
const thumbnails2 = Array.from(images).map((img) => img.src);
|
|
59
|
+
setThumbnails(thumbnails2);
|
|
60
|
+
if (thumbnails2.length > 0 && !store.state.thumbnail) {
|
|
61
|
+
store.dispatch((state) => {
|
|
62
|
+
state.thumbnail = thumbnails2[0];
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const sub = textEditorRef.current.subject.subscribe((tr) => {
|
|
67
|
+
update();
|
|
68
|
+
});
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
update();
|
|
71
|
+
}, 0);
|
|
72
|
+
return () => {
|
|
73
|
+
sub.unsubscribe();
|
|
74
|
+
};
|
|
75
|
+
}, []);
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "grid grid-cols-2 gap-1" }, thumbnails.map((url, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
key: index,
|
|
80
|
+
type: "button",
|
|
81
|
+
className: (0, import_utils.cn)(
|
|
82
|
+
"border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
|
|
83
|
+
thumbnail === url && "border-transparent ring-2 ring-primary"
|
|
84
|
+
),
|
|
85
|
+
onClick: () => {
|
|
86
|
+
store.dispatch((state) => {
|
|
87
|
+
state.thumbnail = url;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
92
|
+
ResponsiveImage,
|
|
93
|
+
{
|
|
94
|
+
src: url,
|
|
95
|
+
alt: `Thumbnail ${index + 1}`,
|
|
96
|
+
className: "w-full h-full object-cover",
|
|
97
|
+
sizes: "200px"
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
)));
|
|
101
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/post/thumbnail_picker.tsx
|
|
2
|
+
import { useSelector } from "react-store-input";
|
|
3
|
+
import { cn } from "dn-react-toolkit/utils";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
|
+
function PostThumbnailPicker({
|
|
6
|
+
store,
|
|
7
|
+
textEditorRef,
|
|
8
|
+
ResponsiveImage
|
|
9
|
+
}) {
|
|
10
|
+
const thumbnail = useSelector(store, (state) => state.thumbnail);
|
|
11
|
+
const [thumbnails, setThumbnails] = useState([]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const update = () => {
|
|
14
|
+
if (!textEditorRef.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const html = textEditorRef.current.value;
|
|
18
|
+
if (!html) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const parser = new DOMParser();
|
|
22
|
+
const docHtml = parser.parseFromString(html, "text/html");
|
|
23
|
+
const images = docHtml.querySelectorAll("img");
|
|
24
|
+
const thumbnails2 = Array.from(images).map((img) => img.src);
|
|
25
|
+
setThumbnails(thumbnails2);
|
|
26
|
+
if (thumbnails2.length > 0 && !store.state.thumbnail) {
|
|
27
|
+
store.dispatch((state) => {
|
|
28
|
+
state.thumbnail = thumbnails2[0];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const sub = textEditorRef.current.subject.subscribe((tr) => {
|
|
33
|
+
update();
|
|
34
|
+
});
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
update();
|
|
37
|
+
}, 0);
|
|
38
|
+
return () => {
|
|
39
|
+
sub.unsubscribe();
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
return /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-2 gap-1" }, thumbnails.map((url, index) => /* @__PURE__ */ React.createElement(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
key: index,
|
|
46
|
+
type: "button",
|
|
47
|
+
className: cn(
|
|
48
|
+
"border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
|
|
49
|
+
thumbnail === url && "border-transparent ring-2 ring-primary"
|
|
50
|
+
),
|
|
51
|
+
onClick: () => {
|
|
52
|
+
store.dispatch((state) => {
|
|
53
|
+
state.thumbnail = url;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
/* @__PURE__ */ React.createElement(
|
|
58
|
+
ResponsiveImage,
|
|
59
|
+
{
|
|
60
|
+
src: url,
|
|
61
|
+
alt: `Thumbnail ${index + 1}`,
|
|
62
|
+
className: "w-full h-full object-cover",
|
|
63
|
+
sizes: "200px"
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
)));
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
PostThumbnailPicker as default
|
|
70
|
+
};
|
package/dist/seo/seo.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ declare function configSEO(config: {
|
|
|
65
65
|
thumbnail: SEOImage | null | undefined;
|
|
66
66
|
};
|
|
67
67
|
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
-
StructedData: () =>
|
|
68
|
+
StructedData: () => React__default.JSX.Element;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export { type SEO, type SEOImage, configSEO };
|
package/dist/seo/seo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ declare function configSEO(config: {
|
|
|
65
65
|
thumbnail: SEOImage | null | undefined;
|
|
66
66
|
};
|
|
67
67
|
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
-
StructedData: () =>
|
|
68
|
+
StructedData: () => React__default.JSX.Element;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export { type SEO, type SEOImage, configSEO };
|
package/dist/table/buttons.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
declare function TablePageButtons({ MAX_PAGES_TO_SHOW, total, limit, offset, }: {
|
|
4
4
|
MAX_PAGES_TO_SHOW: number;
|
|
5
5
|
total: number;
|
|
6
6
|
limit: number;
|
|
7
7
|
offset: number;
|
|
8
|
-
}):
|
|
8
|
+
}): React__default.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { TablePageButtons as default };
|
package/dist/table/buttons.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
declare function TablePageButtons({ MAX_PAGES_TO_SHOW, total, limit, offset, }: {
|
|
4
4
|
MAX_PAGES_TO_SHOW: number;
|
|
5
5
|
total: number;
|
|
6
6
|
limit: number;
|
|
7
7
|
offset: number;
|
|
8
|
-
}):
|
|
8
|
+
}): React__default.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { TablePageButtons as default };
|