dn-react-router-toolkit 0.2.6 → 0.2.7
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/file/object_storage.d.mts +1 -0
- package/dist/file/object_storage.d.ts +1 -0
- package/dist/file/object_storage.js +12 -0
- package/dist/file/object_storage.mjs +13 -0
- package/dist/seo/seo.js +9 -1
- package/dist/seo/seo.mjs +9 -1
- package/dist/text_editor/text_editor.d.mts +2 -1
- package/dist/text_editor/text_editor.d.ts +2 -1
- package/dist/text_editor/text_editor.js +4 -0
- package/dist/text_editor/text_editor.mjs +4 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ declare class ObjectStorage {
|
|
|
10
10
|
contentType?: string;
|
|
11
11
|
expiresIn?: number;
|
|
12
12
|
}): Promise<string>;
|
|
13
|
+
head(key: string): Promise<boolean>;
|
|
13
14
|
find(key: string): Promise<Uint8Array<ArrayBufferLike> | undefined>;
|
|
14
15
|
put(key: string, buffer: Buffer, { contentType }?: {
|
|
15
16
|
contentType?: string;
|
|
@@ -10,6 +10,7 @@ declare class ObjectStorage {
|
|
|
10
10
|
contentType?: string;
|
|
11
11
|
expiresIn?: number;
|
|
12
12
|
}): Promise<string>;
|
|
13
|
+
head(key: string): Promise<boolean>;
|
|
13
14
|
find(key: string): Promise<Uint8Array<ArrayBufferLike> | undefined>;
|
|
14
15
|
put(key: string, buffer: Buffer, { contentType }?: {
|
|
15
16
|
contentType?: string;
|
|
@@ -47,6 +47,18 @@ var ObjectStorage = class {
|
|
|
47
47
|
});
|
|
48
48
|
return signedUrl;
|
|
49
49
|
}
|
|
50
|
+
async head(key) {
|
|
51
|
+
try {
|
|
52
|
+
const command = new import_client_s3.HeadObjectCommand({
|
|
53
|
+
Bucket: this.bucketName,
|
|
54
|
+
Key: key
|
|
55
|
+
});
|
|
56
|
+
await this.client.send(command);
|
|
57
|
+
return true;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
50
62
|
async find(key) {
|
|
51
63
|
try {
|
|
52
64
|
const command = new import_client_s3.GetObjectCommand({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/file/object_storage.ts
|
|
2
2
|
import {
|
|
3
3
|
GetObjectCommand,
|
|
4
|
+
HeadObjectCommand,
|
|
4
5
|
PutObjectCommand,
|
|
5
6
|
S3Client
|
|
6
7
|
} from "@aws-sdk/client-s3";
|
|
@@ -27,6 +28,18 @@ var ObjectStorage = class {
|
|
|
27
28
|
});
|
|
28
29
|
return signedUrl;
|
|
29
30
|
}
|
|
31
|
+
async head(key) {
|
|
32
|
+
try {
|
|
33
|
+
const command = new HeadObjectCommand({
|
|
34
|
+
Bucket: this.bucketName,
|
|
35
|
+
Key: key
|
|
36
|
+
});
|
|
37
|
+
await this.client.send(command);
|
|
38
|
+
return true;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
30
43
|
async find(key) {
|
|
31
44
|
try {
|
|
32
45
|
const command = new GetObjectCommand({
|
package/dist/seo/seo.js
CHANGED
|
@@ -279,7 +279,15 @@ function configSEO(config) {
|
|
|
279
279
|
})
|
|
280
280
|
].filter(Boolean)
|
|
281
281
|
};
|
|
282
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
282
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
283
|
+
"script",
|
|
284
|
+
{
|
|
285
|
+
type: "application/ld+json",
|
|
286
|
+
dangerouslySetInnerHTML: {
|
|
287
|
+
__html: JSON.stringify(structuredData)
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
);
|
|
283
291
|
}
|
|
284
292
|
return {
|
|
285
293
|
config,
|
package/dist/seo/seo.mjs
CHANGED
|
@@ -245,7 +245,15 @@ function configSEO(config) {
|
|
|
245
245
|
})
|
|
246
246
|
].filter(Boolean)
|
|
247
247
|
};
|
|
248
|
-
return /* @__PURE__ */ React.createElement(
|
|
248
|
+
return /* @__PURE__ */ React.createElement(
|
|
249
|
+
"script",
|
|
250
|
+
{
|
|
251
|
+
type: "application/ld+json",
|
|
252
|
+
dangerouslySetInnerHTML: {
|
|
253
|
+
__html: JSON.stringify(structuredData)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
);
|
|
249
257
|
}
|
|
250
258
|
return {
|
|
251
259
|
config,
|
|
@@ -7,6 +7,7 @@ import { EditorView, DirectEditorProps } from 'prosemirror-view';
|
|
|
7
7
|
import { FileUploader } from '../file/client/file_uploader.mjs';
|
|
8
8
|
|
|
9
9
|
type TextEditorProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
10
|
+
autofocus?: boolean;
|
|
10
11
|
name?: string;
|
|
11
12
|
state?: Partial<EditorStateConfig>;
|
|
12
13
|
editor?: Partial<DirectEditorProps>;
|
|
@@ -35,7 +36,7 @@ declare function createTextEditor<TFile extends {
|
|
|
35
36
|
readonly insertNode: (type: string, attrs?: Attrs, content?: Fragment | Node | Node[], marks?: Mark[]) => void;
|
|
36
37
|
readonly setHTML: (html: string) => void;
|
|
37
38
|
};
|
|
38
|
-
readonly Component: ({ name, placeholder, className, defaultValue, onClick, onHTMLChanged, editor, state, ...props }: TextEditorProps) => React.JSX.Element;
|
|
39
|
+
readonly Component: ({ autofocus, name, placeholder, className, defaultValue, onClick, onHTMLChanged, editor, state, ...props }: TextEditorProps) => React.JSX.Element;
|
|
39
40
|
readonly serialize: () => string;
|
|
40
41
|
readonly getTextContent: () => string;
|
|
41
42
|
};
|
|
@@ -7,6 +7,7 @@ import { EditorView, DirectEditorProps } from 'prosemirror-view';
|
|
|
7
7
|
import { FileUploader } from '../file/client/file_uploader.js';
|
|
8
8
|
|
|
9
9
|
type TextEditorProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
10
|
+
autofocus?: boolean;
|
|
10
11
|
name?: string;
|
|
11
12
|
state?: Partial<EditorStateConfig>;
|
|
12
13
|
editor?: Partial<DirectEditorProps>;
|
|
@@ -35,7 +36,7 @@ declare function createTextEditor<TFile extends {
|
|
|
35
36
|
readonly insertNode: (type: string, attrs?: Attrs, content?: Fragment | Node | Node[], marks?: Mark[]) => void;
|
|
36
37
|
readonly setHTML: (html: string) => void;
|
|
37
38
|
};
|
|
38
|
-
readonly Component: ({ name, placeholder, className, defaultValue, onClick, onHTMLChanged, editor, state, ...props }: TextEditorProps) => React.JSX.Element;
|
|
39
|
+
readonly Component: ({ autofocus, name, placeholder, className, defaultValue, onClick, onHTMLChanged, editor, state, ...props }: TextEditorProps) => React.JSX.Element;
|
|
39
40
|
readonly serialize: () => string;
|
|
40
41
|
readonly getTextContent: () => string;
|
|
41
42
|
};
|
|
@@ -663,6 +663,7 @@ function createTextEditor({
|
|
|
663
663
|
const observers = (0, import_react3.useMemo)(() => [], []);
|
|
664
664
|
const Component = (0, import_react3.useCallback)(
|
|
665
665
|
function Component2({
|
|
666
|
+
autofocus,
|
|
666
667
|
name,
|
|
667
668
|
placeholder,
|
|
668
669
|
className,
|
|
@@ -730,6 +731,9 @@ function createTextEditor({
|
|
|
730
731
|
}
|
|
731
732
|
});
|
|
732
733
|
view.current = editorView;
|
|
734
|
+
if (autofocus) {
|
|
735
|
+
editorView.focus();
|
|
736
|
+
}
|
|
733
737
|
return () => {
|
|
734
738
|
view.current = null;
|
|
735
739
|
editorView.destroy();
|
|
@@ -632,6 +632,7 @@ function createTextEditor({
|
|
|
632
632
|
const observers = useMemo(() => [], []);
|
|
633
633
|
const Component = useCallback(
|
|
634
634
|
function Component2({
|
|
635
|
+
autofocus,
|
|
635
636
|
name,
|
|
636
637
|
placeholder,
|
|
637
638
|
className,
|
|
@@ -699,6 +700,9 @@ function createTextEditor({
|
|
|
699
700
|
}
|
|
700
701
|
});
|
|
701
702
|
view.current = editorView;
|
|
703
|
+
if (autofocus) {
|
|
704
|
+
editorView.focus();
|
|
705
|
+
}
|
|
702
706
|
return () => {
|
|
703
707
|
view.current = null;
|
|
704
708
|
editorView.destroy();
|