@yimingliao/cms 0.0.223 → 0.0.226
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/export/client/components/index.js +1 -0
- package/dist/export/client/components/resources/index.js +6 -0
- package/dist/export/client/index.js +1 -0
- package/dist/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.js +52 -0
- package/dist/src/client/applications/resources/seo-metadata/use-upsert-form-data.js +43 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.js +1 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.js +1 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.js +1 -1
- package/dist/src/client/interfaces/components/resources/file/file-relations-section.js +1 -1
- package/dist/src/client/interfaces/components/resources/file/is-locked-buttons.js +1 -1
- package/dist/src/client/interfaces/components/resources/file/type-buttons.js +1 -1
- package/dist/src/client/interfaces/components/resources/folder/file-manager/file-manager-header.js +1 -1
- package/dist/src/client/interfaces/components/resources/folder/folder-card.js +1 -1
- package/dist/src/client/interfaces/components/resources/folder/folder-full-path.js +1 -0
- package/dist/src/client/interfaces/components/resources/inquiry/inquiry-card.js +1 -1
- package/dist/src/client/interfaces/components/resources/post/control-fields-buttons.js +1 -1
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.js +190 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js +78 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js +444 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js +126 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.js +82 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.js +56 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +150 -0
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +66 -0
- package/dist/src/client/interfaces/components/shadcn/avatar.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/badge.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/button.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/card.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/dialog.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/input-group.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/input.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/item.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/label.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/pagination.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/select.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/separator.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/sheet.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/sidebar.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/skeleton.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/spinner.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/table.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/tabs.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/textarea.js +1 -0
- package/dist/src/client/interfaces/components/shadcn/tooltip.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +1 -0
- package/dist/src/client/interfaces/components/ui/buttons/button.js +1 -0
- package/dist/src/client/interfaces/components/ui/buttons/return-button.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/action-buttons-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/feature-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.js +1 -1
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-text-content.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/resource-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/array-list.js +1 -1
- package/dist/src/client/interfaces/components/ui/display/badge.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/html-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/object-array-list.js +1 -1
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-header.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/external-link.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-name.js +1 -1
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.js +1 -1
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +1 -1
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/tick.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field-body.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/form.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/i18n-tabs-wrapper.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-editor.js +1 -1
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-number-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/editor/editor.js +1 -1
- package/dist/src/client/interfaces/components/ui/inputs/input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/select.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/auth-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/content-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/dashboard-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +1 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +1 -0
- package/dist/src/client/interfaces/pages/auth/change-password/page.js +1 -1
- package/dist/src/client/interfaces/pages/auth/email-unverified/page.js +1 -1
- package/dist/src/client/interfaces/pages/auth/forgot-password/page.js +1 -1
- package/dist/src/client/interfaces/pages/auth/reset-password/page.js +1 -1
- package/dist/src/client/interfaces/pages/auth/sign-in/page.js +1 -1
- package/dist/src/client/interfaces/pages/auth/verify-email/page.js +1 -0
- package/dist/types/export/client/components/resources/index.d.ts +1 -1
- package/dist/types/export/client/components/resources/index.d.ts.map +1 -1
- package/dist/types/export/client/index.d.ts +1 -1
- package/dist/types/export/client/index.d.ts.map +1 -1
- package/dist/types/src/client/applications/index.d.ts +1 -0
- package/dist/types/src/client/applications/index.d.ts.map +1 -1
- package/dist/types/src/client/applications/resources/index.d.ts +2 -0
- package/dist/types/src/client/applications/resources/index.d.ts.map +1 -0
- package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts +2 -0
- package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts.map +1 -0
- package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts +34 -0
- package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts.map +1 -0
- package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +82 -0
- package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +1 -0
- package/dist/types/src/client/index.d.ts +1 -1
- package/dist/types/src/client/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts +1 -0
- package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/seo-fields-context.d.ts +19 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/seo-fields-context.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +25 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/types.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/types.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +7 -0
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-array-input.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-array-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-date-input.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-date-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-input.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-json-input.d.ts +2 -3
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-json-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-number-input.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-number-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-textarea.d.ts +1 -2
- package/dist/types/src/client/interfaces/components/ui/i18n/inputs/i18n-textarea.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -25,5 +25,11 @@ export { createTopicList } from '../../../../src/client/interfaces/components/re
|
|
|
25
25
|
export { TagCard } from '../../../../src/client/interfaces/components/resources/tag/tag-card.js';
|
|
26
26
|
export { createTagList } from '../../../../src/client/interfaces/components/resources/tag/tag-list.js';
|
|
27
27
|
export { createTagRelationsSection } from '../../../../src/client/interfaces/components/resources/tag/tag-relations-section.js';
|
|
28
|
+
export { createSeoMetadataDialog } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js';
|
|
29
|
+
export { createSeoForm } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js';
|
|
30
|
+
export { createBasicTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.js';
|
|
31
|
+
export { createOpenGraphTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js';
|
|
32
|
+
export { createTwitterTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js';
|
|
33
|
+
export { createJsonLdTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js';
|
|
28
34
|
export { InquiryCard } from '../../../../src/client/interfaces/components/resources/inquiry/inquiry-card.js';
|
|
29
35
|
export { createInquiryList } from '../../../../src/client/interfaces/components/resources/inquiry/inquiry-list.js';
|
|
@@ -15,6 +15,7 @@ export { usePickItems } from '../../src/client/applications/form/use-pick-items.
|
|
|
15
15
|
export { getControlMeta } from '../../src/client/applications/form/get-control-meta.js';
|
|
16
16
|
export { getImgIdsFromHtmls } from '../../src/client/applications/form/get-img-ids-from-htmls.js';
|
|
17
17
|
export { createProcessContentHtml } from '../../src/client/applications/form/process-content-html.js';
|
|
18
|
+
export { createUseSeoMetadataUpsertFormData } from '../../src/client/applications/resources/seo-metadata/use-upsert-form-data.js';
|
|
18
19
|
export { cn } from '../../src/client/applications/shadcn/utils.js';
|
|
19
20
|
import 'next/navigation';
|
|
20
21
|
export { isConfirm } from '../../src/client/applications/ui/is-confirm.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const SEO_METADATA_EMPTY_TRANSLATIONS = (buildTranslations) => buildTranslations([
|
|
2
|
+
// -----------------------------------------------------------------------
|
|
3
|
+
// Basic
|
|
4
|
+
// -----------------------------------------------------------------------
|
|
5
|
+
{ key: "title", value: null },
|
|
6
|
+
{ key: "description", value: null },
|
|
7
|
+
// identity
|
|
8
|
+
{ key: "author", value: null },
|
|
9
|
+
// url
|
|
10
|
+
{ key: "canonical", value: null },
|
|
11
|
+
{ key: "alternate", value: [] },
|
|
12
|
+
// robots
|
|
13
|
+
{ key: "robots", value: null },
|
|
14
|
+
// -----------------------------------------------------------------------
|
|
15
|
+
// Open Graph
|
|
16
|
+
// -----------------------------------------------------------------------
|
|
17
|
+
{ key: "ogTitle", value: null },
|
|
18
|
+
{ key: "ogDescription", value: null },
|
|
19
|
+
// url
|
|
20
|
+
{ key: "ogUrl", value: null },
|
|
21
|
+
// identity
|
|
22
|
+
{ key: "ogType", value: null },
|
|
23
|
+
{ key: "ogSiteName", value: null },
|
|
24
|
+
// image
|
|
25
|
+
{ key: "ogImage", value: null },
|
|
26
|
+
{ key: "ogImageAlt", value: null },
|
|
27
|
+
{ key: "ogImageType", value: null },
|
|
28
|
+
{ key: "ogImageWidth", value: 0 },
|
|
29
|
+
{ key: "ogImageHeight", value: 0 },
|
|
30
|
+
// locale
|
|
31
|
+
{ key: "ogLocale", value: null },
|
|
32
|
+
{ key: "ogLocaleAlternate", value: [] },
|
|
33
|
+
// article
|
|
34
|
+
{ key: "ogArticlePublishedTime", value: null },
|
|
35
|
+
{ key: "ogArticleModifiedTime", value: null },
|
|
36
|
+
{ key: "ogArticleAuthor", value: null },
|
|
37
|
+
{ key: "ogArticleSection", value: null },
|
|
38
|
+
{ key: "ogArticleTag", value: [] },
|
|
39
|
+
// -----------------------------------------------------------------------
|
|
40
|
+
// Twitter
|
|
41
|
+
// -----------------------------------------------------------------------
|
|
42
|
+
{ key: "twitterCard", value: null },
|
|
43
|
+
// identity
|
|
44
|
+
{ key: "twitterSite", value: null },
|
|
45
|
+
{ key: "twitterCreator", value: null },
|
|
46
|
+
// -----------------------------------------------------------------------
|
|
47
|
+
// JSON-LD
|
|
48
|
+
// -----------------------------------------------------------------------
|
|
49
|
+
{ key: "jsonLd", value: [] }
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
export { SEO_METADATA_EMPTY_TRANSLATIONS };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import 'mime-types';
|
|
3
|
+
import { datetimeToUi } from '../../../../shared/form/normalizers/datetime-to-ui.js';
|
|
4
|
+
import { jsonArrayToUi } from '../../../../shared/form/normalizers/json-array-to-ui.js';
|
|
5
|
+
import { ensureArray } from '../../../../shared/utils/ensure-array.js';
|
|
6
|
+
import { SEO_METADATA_EMPTY_TRANSLATIONS } from './seo-metadata-empty-translation.js';
|
|
7
|
+
|
|
8
|
+
function createUseSeoMetadataUpsertFormData({
|
|
9
|
+
buildTranslations
|
|
10
|
+
}) {
|
|
11
|
+
return function useSeoMetadataUpsertFormData({
|
|
12
|
+
id,
|
|
13
|
+
post
|
|
14
|
+
}) {
|
|
15
|
+
const [formData, setFormData] = useState(() => ({
|
|
16
|
+
postId: id,
|
|
17
|
+
translations: SEO_METADATA_EMPTY_TRANSLATIONS(buildTranslations)
|
|
18
|
+
}));
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!post) return;
|
|
21
|
+
const seoMetadatas = ensureArray(post?.seoMetadatas);
|
|
22
|
+
if (seoMetadatas.length === 0) return;
|
|
23
|
+
setFormData({
|
|
24
|
+
postId: post.id,
|
|
25
|
+
translations: seoMetadatas.map((s) => {
|
|
26
|
+
return {
|
|
27
|
+
...s,
|
|
28
|
+
ogType: s.ogType,
|
|
29
|
+
twitterCard: s.twitterCard,
|
|
30
|
+
// Datetime to UI
|
|
31
|
+
ogArticlePublishedTime: datetimeToUi(s.ogArticlePublishedTime),
|
|
32
|
+
ogArticleModifiedTime: datetimeToUi(s.ogArticleModifiedTime),
|
|
33
|
+
// Json Array to UI
|
|
34
|
+
jsonLd: jsonArrayToUi(s.jsonLd)
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}, [post, setFormData]);
|
|
39
|
+
return { formData, setFormData };
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { createUseSeoMetadataUpsertFormData };
|
|
@@ -2,6 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useTranslator } from 'intor/react';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'ua-parser-js';
|
|
5
|
+
import 'mime-types';
|
|
5
6
|
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
6
7
|
import 'next/navigation';
|
|
7
8
|
import '@radix-ui/react-avatar';
|
|
@@ -29,7 +30,6 @@ import '../../../../../../constants/paths/auth.js';
|
|
|
29
30
|
import '../../../../../../constants/paths/main.js';
|
|
30
31
|
import '../../../../../../constants/paths/resources.js';
|
|
31
32
|
import '../../../../../../constants/redirect-paths.js';
|
|
32
|
-
import 'mime-types';
|
|
33
33
|
import '../../../../../../domain/resources/admin/constants.js';
|
|
34
34
|
import 'next/image';
|
|
35
35
|
|
|
@@ -4,6 +4,7 @@ import { useTranslator } from 'intor/react';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import 'lucide-react';
|
|
6
6
|
import 'ua-parser-js';
|
|
7
|
+
import 'mime-types';
|
|
7
8
|
import 'clsx';
|
|
8
9
|
import 'tailwind-merge';
|
|
9
10
|
import 'next/navigation';
|
|
@@ -28,7 +29,6 @@ import '../../../../../constants/paths/auth.js';
|
|
|
28
29
|
import '../../../../../constants/paths/main.js';
|
|
29
30
|
import '../../../../../constants/paths/resources.js';
|
|
30
31
|
import '../../../../../constants/redirect-paths.js';
|
|
31
|
-
import 'mime-types';
|
|
32
32
|
import { Accordion } from '../../ui/features/accordion/accordion.js';
|
|
33
33
|
import { AccordionContainer } from '../../ui/features/accordion/accordion-container.js';
|
|
34
34
|
import '../../../../../domain/resources/admin/constants.js';
|
|
@@ -2,6 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useTranslator } from 'intor/react';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'ua-parser-js';
|
|
5
|
+
import 'mime-types';
|
|
5
6
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
6
7
|
import 'next/navigation';
|
|
7
8
|
import 'lucide-react';
|
|
@@ -27,7 +28,6 @@ import '../../../../../constants/paths/auth.js';
|
|
|
27
28
|
import '../../../../../constants/paths/main.js';
|
|
28
29
|
import '../../../../../constants/paths/resources.js';
|
|
29
30
|
import '../../../../../constants/redirect-paths.js';
|
|
30
|
-
import 'mime-types';
|
|
31
31
|
import '../../../../../domain/resources/admin/constants.js';
|
|
32
32
|
import 'next/image';
|
|
33
33
|
|
|
@@ -4,6 +4,7 @@ import '../../../../../domain/resources/admin/constants.js';
|
|
|
4
4
|
import { FILE_TYPES } from '../../../../../domain/resources/file/props.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'ua-parser-js';
|
|
7
|
+
import 'mime-types';
|
|
7
8
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
8
9
|
import 'next/navigation';
|
|
9
10
|
import 'lucide-react';
|
|
@@ -29,7 +30,6 @@ import '../../../../../constants/paths/auth.js';
|
|
|
29
30
|
import '../../../../../constants/paths/main.js';
|
|
30
31
|
import '../../../../../constants/paths/resources.js';
|
|
31
32
|
import '../../../../../constants/redirect-paths.js';
|
|
32
|
-
import 'mime-types';
|
|
33
33
|
import 'next/image';
|
|
34
34
|
|
|
35
35
|
function TypeButtons({ type, setType }) {
|
package/dist/src/client/interfaces/components/resources/folder/file-manager/file-manager-header.js
CHANGED
|
@@ -9,6 +9,7 @@ import { normalizeFolderKey } from '../../../../../../domain/resources/folder/ut
|
|
|
9
9
|
import { ROOT_FOLDER_NAME } from '../../../../../../domain/resources/constants.js';
|
|
10
10
|
import 'react';
|
|
11
11
|
import 'ua-parser-js';
|
|
12
|
+
import 'mime-types';
|
|
12
13
|
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
13
14
|
import 'next/navigation';
|
|
14
15
|
import '@radix-ui/react-avatar';
|
|
@@ -30,7 +31,6 @@ import '@radix-ui/react-tooltip';
|
|
|
30
31
|
import { Button } from '../../../ui/buttons/button.js';
|
|
31
32
|
import { ReturnButton } from '../../../ui/buttons/return-button.js';
|
|
32
33
|
import 'next/link';
|
|
33
|
-
import 'mime-types';
|
|
34
34
|
import 'next/image';
|
|
35
35
|
|
|
36
36
|
function FileManagerHeader({
|
|
@@ -7,6 +7,7 @@ import '../../../../../domain/resources/admin/constants.js';
|
|
|
7
7
|
import { isFolderLocked } from '../../../../../domain/resources/folder/utils/is-folder-locked.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'ua-parser-js';
|
|
10
|
+
import 'mime-types';
|
|
10
11
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
11
12
|
import 'next/navigation';
|
|
12
13
|
import 'intor/react';
|
|
@@ -28,7 +29,6 @@ import '@radix-ui/react-tabs';
|
|
|
28
29
|
import '@radix-ui/react-tooltip';
|
|
29
30
|
import { ResourceCard } from '../../ui/cards/resource-card/resource-card.js';
|
|
30
31
|
import 'next/link';
|
|
31
|
-
import 'mime-types';
|
|
32
32
|
import 'next/image';
|
|
33
33
|
|
|
34
34
|
const WIDTH = "10rem";
|
|
@@ -4,6 +4,7 @@ import { PATHS } from '../../../../../constants/paths/index.js';
|
|
|
4
4
|
import '../../../../../constants/redirect-paths.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'ua-parser-js';
|
|
7
|
+
import 'mime-types';
|
|
7
8
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
8
9
|
import 'next/navigation';
|
|
9
10
|
import 'intor/react';
|
|
@@ -26,7 +27,6 @@ import '@radix-ui/react-tabs';
|
|
|
26
27
|
import '@radix-ui/react-tooltip';
|
|
27
28
|
import { ResourceCard } from '../../ui/cards/resource-card/resource-card.js';
|
|
28
29
|
import 'next/link';
|
|
29
|
-
import 'mime-types';
|
|
30
30
|
import '../../../../../domain/resources/admin/constants.js';
|
|
31
31
|
import 'next/image';
|
|
32
32
|
|
|
@@ -2,6 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useTranslator } from 'intor/react';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'ua-parser-js';
|
|
5
|
+
import 'mime-types';
|
|
5
6
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
6
7
|
import 'next/navigation';
|
|
7
8
|
import 'lucide-react';
|
|
@@ -27,7 +28,6 @@ import '../../../../../constants/paths/auth.js';
|
|
|
27
28
|
import '../../../../../constants/paths/main.js';
|
|
28
29
|
import '../../../../../constants/paths/resources.js';
|
|
29
30
|
import '../../../../../constants/redirect-paths.js';
|
|
30
|
-
import 'mime-types';
|
|
31
31
|
import '../../../../../domain/resources/admin/constants.js';
|
|
32
32
|
import 'next/image';
|
|
33
33
|
|
package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import 'lucide-react';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'ua-parser-js';
|
|
7
|
+
import 'mime-types';
|
|
8
|
+
import 'clsx';
|
|
9
|
+
import 'tailwind-merge';
|
|
10
|
+
import 'next/navigation';
|
|
11
|
+
import '@radix-ui/react-avatar';
|
|
12
|
+
import '../../../../shadcn/badge.js';
|
|
13
|
+
import '../../../../shadcn/button.js';
|
|
14
|
+
import '@radix-ui/react-collapsible';
|
|
15
|
+
import '@radix-ui/react-dialog';
|
|
16
|
+
import '@radix-ui/react-dropdown-menu';
|
|
17
|
+
import '../../../../shadcn/input-group.js';
|
|
18
|
+
import '../../../../shadcn/item.js';
|
|
19
|
+
import '@radix-ui/react-label';
|
|
20
|
+
import '@radix-ui/react-select';
|
|
21
|
+
import '@radix-ui/react-separator';
|
|
22
|
+
import '../../../../shadcn/sidebar.js';
|
|
23
|
+
import 'next-themes';
|
|
24
|
+
import 'sonner';
|
|
25
|
+
import '@radix-ui/react-tabs';
|
|
26
|
+
import '@radix-ui/react-tooltip';
|
|
27
|
+
import 'next/link';
|
|
28
|
+
import '../../../../../../../constants/paths/auth.js';
|
|
29
|
+
import '../../../../../../../constants/paths/main.js';
|
|
30
|
+
import '../../../../../../../constants/paths/resources.js';
|
|
31
|
+
import '../../../../../../../constants/redirect-paths.js';
|
|
32
|
+
import { Field } from '../../../../ui/form/field.js';
|
|
33
|
+
import { Accordion } from '../../../../ui/features/accordion/accordion.js';
|
|
34
|
+
import '../../../../../../../domain/resources/admin/constants.js';
|
|
35
|
+
import 'next/image';
|
|
36
|
+
|
|
37
|
+
function createBasicTags({
|
|
38
|
+
I18nInput,
|
|
39
|
+
I18nTextarea,
|
|
40
|
+
I18nObjectArrayInput
|
|
41
|
+
}) {
|
|
42
|
+
return function BasicTags({
|
|
43
|
+
formData,
|
|
44
|
+
setFormData,
|
|
45
|
+
errors,
|
|
46
|
+
isArticle,
|
|
47
|
+
allowField
|
|
48
|
+
}) {
|
|
49
|
+
const { t } = useTranslator();
|
|
50
|
+
if (!allowField("basic:all")) return;
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
Accordion,
|
|
53
|
+
{
|
|
54
|
+
hasBorder: true,
|
|
55
|
+
initialOpen: true,
|
|
56
|
+
accordionHeaderProps: { children: "Basic" },
|
|
57
|
+
deps: [formData],
|
|
58
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
59
|
+
allowField("title") && /* @__PURE__ */ jsx(Field, { htmlFor: "title", label: "title", hint: "<title>...</title>", children: /* @__PURE__ */ jsx(
|
|
60
|
+
I18nInput,
|
|
61
|
+
{
|
|
62
|
+
id: "title",
|
|
63
|
+
fieldName: "title",
|
|
64
|
+
translations: formData?.translations.map((t2) => ({
|
|
65
|
+
locale: t2.locale,
|
|
66
|
+
title: t2.title
|
|
67
|
+
})),
|
|
68
|
+
setFormData,
|
|
69
|
+
errors
|
|
70
|
+
}
|
|
71
|
+
) }),
|
|
72
|
+
allowField("description") && /* @__PURE__ */ jsx(
|
|
73
|
+
Field,
|
|
74
|
+
{
|
|
75
|
+
htmlFor: "description",
|
|
76
|
+
label: "description",
|
|
77
|
+
hint: `<meta name="description" content="..." />`,
|
|
78
|
+
children: /* @__PURE__ */ jsx(
|
|
79
|
+
I18nTextarea,
|
|
80
|
+
{
|
|
81
|
+
id: "description",
|
|
82
|
+
fieldName: "description",
|
|
83
|
+
translations: formData?.translations.map((t2) => ({
|
|
84
|
+
locale: t2.locale,
|
|
85
|
+
description: t2.description
|
|
86
|
+
})),
|
|
87
|
+
setFormData,
|
|
88
|
+
errors
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
allowField("author") && isArticle && /* @__PURE__ */ jsx(
|
|
94
|
+
Field,
|
|
95
|
+
{
|
|
96
|
+
htmlFor: "author",
|
|
97
|
+
label: "author",
|
|
98
|
+
hint: `<meta name="author" content="..."> (${t(
|
|
99
|
+
"resources.seo-metadata.defaults-to.text"
|
|
100
|
+
)} Author Name)`,
|
|
101
|
+
children: /* @__PURE__ */ jsx(
|
|
102
|
+
I18nInput,
|
|
103
|
+
{
|
|
104
|
+
id: "author",
|
|
105
|
+
fieldName: "author",
|
|
106
|
+
translations: formData?.translations.map((t2) => ({
|
|
107
|
+
locale: t2.locale,
|
|
108
|
+
author: t2.author
|
|
109
|
+
})),
|
|
110
|
+
setFormData,
|
|
111
|
+
errors
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
allowField("canonical") && /* @__PURE__ */ jsx(
|
|
117
|
+
Field,
|
|
118
|
+
{
|
|
119
|
+
htmlFor: "canonical",
|
|
120
|
+
label: "canonical",
|
|
121
|
+
hint: `<meta name="canonical" content="...">`,
|
|
122
|
+
children: /* @__PURE__ */ jsx(
|
|
123
|
+
I18nInput,
|
|
124
|
+
{
|
|
125
|
+
id: "canonical",
|
|
126
|
+
fieldName: "canonical",
|
|
127
|
+
translations: formData?.translations.map((t2) => ({
|
|
128
|
+
locale: t2.locale,
|
|
129
|
+
canonical: t2.canonical
|
|
130
|
+
})),
|
|
131
|
+
setFormData,
|
|
132
|
+
errors
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
allowField("alternate") && /* @__PURE__ */ jsx(
|
|
138
|
+
Field,
|
|
139
|
+
{
|
|
140
|
+
label: "alternate",
|
|
141
|
+
hint: `<link rel="alternate" hreflang="en-US" href="..." />`,
|
|
142
|
+
children: /* @__PURE__ */ jsx(
|
|
143
|
+
I18nObjectArrayInput,
|
|
144
|
+
{
|
|
145
|
+
fieldName: "alternate",
|
|
146
|
+
translations: formData?.translations.map((t2) => ({
|
|
147
|
+
locale: t2.locale,
|
|
148
|
+
alternate: t2.alternate
|
|
149
|
+
})),
|
|
150
|
+
setFormData,
|
|
151
|
+
errors,
|
|
152
|
+
fields: [
|
|
153
|
+
{ key: "hreflang", placeholder: "hreflang" },
|
|
154
|
+
{ key: "href", placeholder: "href" }
|
|
155
|
+
],
|
|
156
|
+
isResizable: false
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
allowField("robots") && /* @__PURE__ */ jsx(
|
|
162
|
+
Field,
|
|
163
|
+
{
|
|
164
|
+
htmlFor: "robots",
|
|
165
|
+
label: "robots",
|
|
166
|
+
hint: `<meta name="robots" content="..."> (${t(
|
|
167
|
+
"resources.seo-metadata.defaults-to.text"
|
|
168
|
+
)} index, follow, max-image-preview: large)`,
|
|
169
|
+
children: /* @__PURE__ */ jsx(
|
|
170
|
+
I18nInput,
|
|
171
|
+
{
|
|
172
|
+
id: "robots",
|
|
173
|
+
fieldName: "robots",
|
|
174
|
+
translations: formData?.translations.map((t2) => ({
|
|
175
|
+
locale: t2.locale,
|
|
176
|
+
robots: t2.robots
|
|
177
|
+
})),
|
|
178
|
+
setFormData,
|
|
179
|
+
errors
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { createBasicTags };
|
package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import 'intor/react';
|
|
4
|
+
import 'lucide-react';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'ua-parser-js';
|
|
7
|
+
import 'mime-types';
|
|
8
|
+
import 'clsx';
|
|
9
|
+
import 'tailwind-merge';
|
|
10
|
+
import 'next/navigation';
|
|
11
|
+
import '@radix-ui/react-avatar';
|
|
12
|
+
import '../../../../shadcn/badge.js';
|
|
13
|
+
import '../../../../shadcn/button.js';
|
|
14
|
+
import '@radix-ui/react-collapsible';
|
|
15
|
+
import '@radix-ui/react-dialog';
|
|
16
|
+
import '@radix-ui/react-dropdown-menu';
|
|
17
|
+
import '../../../../shadcn/input-group.js';
|
|
18
|
+
import '../../../../shadcn/item.js';
|
|
19
|
+
import '@radix-ui/react-label';
|
|
20
|
+
import '@radix-ui/react-select';
|
|
21
|
+
import '@radix-ui/react-separator';
|
|
22
|
+
import '../../../../shadcn/sidebar.js';
|
|
23
|
+
import 'next-themes';
|
|
24
|
+
import 'sonner';
|
|
25
|
+
import '@radix-ui/react-tabs';
|
|
26
|
+
import '@radix-ui/react-tooltip';
|
|
27
|
+
import 'next/link';
|
|
28
|
+
import '../../../../../../../constants/paths/auth.js';
|
|
29
|
+
import '../../../../../../../constants/paths/main.js';
|
|
30
|
+
import '../../../../../../../constants/paths/resources.js';
|
|
31
|
+
import '../../../../../../../constants/redirect-paths.js';
|
|
32
|
+
import { Field } from '../../../../ui/form/field.js';
|
|
33
|
+
import { Accordion } from '../../../../ui/features/accordion/accordion.js';
|
|
34
|
+
import '../../../../../../../domain/resources/admin/constants.js';
|
|
35
|
+
import 'next/image';
|
|
36
|
+
|
|
37
|
+
function createJsonLdTags({ I18nJsonInput }) {
|
|
38
|
+
return function JsonLdTags({
|
|
39
|
+
formData,
|
|
40
|
+
setFormData,
|
|
41
|
+
errors,
|
|
42
|
+
allowField
|
|
43
|
+
}) {
|
|
44
|
+
if (!allowField("json-ld")) return;
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Accordion,
|
|
47
|
+
{
|
|
48
|
+
hasBorder: true,
|
|
49
|
+
initialOpen: true,
|
|
50
|
+
accordionHeaderProps: { children: "JSON-LD" },
|
|
51
|
+
deps: [formData],
|
|
52
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", children: /* @__PURE__ */ jsx(
|
|
53
|
+
Field,
|
|
54
|
+
{
|
|
55
|
+
htmlFor: "jsonLd",
|
|
56
|
+
label: "JSON-LD",
|
|
57
|
+
hint: `<script type="application/ld+json">`,
|
|
58
|
+
children: /* @__PURE__ */ jsx(
|
|
59
|
+
I18nJsonInput,
|
|
60
|
+
{
|
|
61
|
+
id: "jsonLd",
|
|
62
|
+
fieldName: "jsonLd",
|
|
63
|
+
translations: formData?.translations.map((t) => ({
|
|
64
|
+
locale: t.locale,
|
|
65
|
+
jsonLd: t.jsonLd
|
|
66
|
+
})),
|
|
67
|
+
setFormData,
|
|
68
|
+
errors
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { createJsonLdTags };
|