@yimingliao/cms 0.0.159 → 0.0.162

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.
Files changed (79) hide show
  1. package/dist/export/client/components/resources/index.js +0 -6
  2. package/dist/export/client/index.js +4 -2
  3. package/dist/export/index.js +2 -0
  4. package/dist/export/server/index.js +2 -0
  5. package/dist/src/client/applications/form/get-img-ids-from-htmls.js +22 -0
  6. package/dist/src/client/applications/form/process-content-html.js +65 -0
  7. package/dist/src/server/interfaces/apis/emails/emails-api.js +116 -0
  8. package/dist/src/server/interfaces/apis/emails/preview-email-api.js +21 -0
  9. package/dist/types/export/client/components/resources/index.d.ts +1 -1
  10. package/dist/types/export/client/components/resources/index.d.ts.map +1 -1
  11. package/dist/types/export/client/index.d.ts +1 -1
  12. package/dist/types/export/client/index.d.ts.map +1 -1
  13. package/dist/types/export/index.d.ts +1 -1
  14. package/dist/types/export/index.d.ts.map +1 -1
  15. package/dist/types/export/server/index.d.ts +1 -1
  16. package/dist/types/export/server/index.d.ts.map +1 -1
  17. package/dist/types/src/client/applications/form/get-img-ids-from-htmls.d.ts +2 -0
  18. package/dist/types/src/client/applications/form/get-img-ids-from-htmls.d.ts.map +1 -0
  19. package/dist/types/src/client/applications/form/index.d.ts +2 -0
  20. package/dist/types/src/client/applications/form/index.d.ts.map +1 -1
  21. package/dist/types/src/client/applications/form/process-content-html.d.ts +6 -0
  22. package/dist/types/src/client/applications/form/process-content-html.d.ts.map +1 -0
  23. package/dist/types/src/client/applications/index.d.ts +1 -1
  24. package/dist/types/src/client/applications/index.d.ts.map +1 -1
  25. package/dist/types/src/client/index.d.ts +1 -1
  26. package/dist/types/src/client/index.d.ts.map +1 -1
  27. package/dist/types/src/client/interfaces/components/resources/index.d.ts +0 -1
  28. package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
  29. package/dist/types/src/server/index.d.ts +1 -1
  30. package/dist/types/src/server/index.d.ts.map +1 -1
  31. package/dist/types/src/server/interfaces/apis/emails/emails-api.d.ts +7 -0
  32. package/dist/types/src/server/interfaces/apis/emails/emails-api.d.ts.map +1 -0
  33. package/dist/types/src/server/interfaces/apis/emails/index.d.ts +3 -0
  34. package/dist/types/src/server/interfaces/apis/emails/index.d.ts.map +1 -0
  35. package/dist/types/src/server/interfaces/apis/emails/preview-email-api.d.ts +5 -0
  36. package/dist/types/src/server/interfaces/apis/emails/preview-email-api.d.ts.map +1 -0
  37. package/dist/types/src/server/interfaces/apis/index.d.ts +1 -0
  38. package/dist/types/src/server/interfaces/apis/index.d.ts.map +1 -1
  39. package/dist/types/src/server/interfaces/index.d.ts +1 -1
  40. package/dist/types/src/server/interfaces/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.js +0 -54
  43. package/dist/src/client/applications/resources/seo-metadata/use-upsert-form-data.js +0 -15
  44. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.js +0 -187
  45. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js +0 -78
  46. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js +0 -441
  47. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js +0 -125
  48. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.js +0 -85
  49. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.js +0 -56
  50. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +0 -186
  51. package/dist/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +0 -69
  52. package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts +0 -2
  53. package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts.map +0 -1
  54. package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts +0 -34
  55. package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts.map +0 -1
  56. package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +0 -79
  57. package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +0 -1
  58. package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts +0 -3
  59. package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts.map +0 -1
  60. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.d.ts +0 -11
  61. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.d.ts.map +0 -1
  62. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts +0 -5
  63. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts.map +0 -1
  64. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts +0 -9
  65. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts.map +0 -1
  66. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts +0 -13
  67. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts.map +0 -1
  68. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts +0 -9
  69. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts.map +0 -1
  70. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts +0 -3
  71. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts.map +0 -1
  72. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts +0 -2
  73. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts.map +0 -1
  74. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts +0 -8
  75. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts.map +0 -1
  76. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +0 -28
  77. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +0 -1
  78. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +0 -11
  79. package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +0 -1
@@ -1,125 +0,0 @@
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 'clsx';
8
- import 'tailwind-merge';
9
- import 'next/navigation';
10
- import '@radix-ui/react-avatar';
11
- import '../../../../shadcn/badge.js';
12
- import '../../../../shadcn/button.js';
13
- import '@radix-ui/react-collapsible';
14
- import '@radix-ui/react-dialog';
15
- import '@radix-ui/react-dropdown-menu';
16
- import '../../../../shadcn/input-group.js';
17
- import '../../../../shadcn/item.js';
18
- import '@radix-ui/react-label';
19
- import '@radix-ui/react-select';
20
- import '@radix-ui/react-separator';
21
- import '../../../../shadcn/sidebar.js';
22
- import 'next-themes';
23
- import 'sonner';
24
- import '@radix-ui/react-tabs';
25
- import '@radix-ui/react-tooltip';
26
- import 'next/link';
27
- import '../../../../../../../constants/paths/auth.js';
28
- import '../../../../../../../constants/paths/main.js';
29
- import '../../../../../../../constants/paths/resources.js';
30
- import '../../../../../../../constants/redirect-paths.js';
31
- import { Field } from '../../../../ui/form/field.js';
32
- import 'mime-types';
33
- import { Accordion } from '../../../../ui/features/accordion/accordion.js';
34
- import '../../../../../../../domain/resources/admin/constants.js';
35
- import 'next/image';
36
-
37
- function createTwitterTags({
38
- I18nInput
39
- }) {
40
- return function TwitterTags({
41
- formData,
42
- setFormData,
43
- errors
44
- }) {
45
- const { t } = useTranslator();
46
- return /* @__PURE__ */ jsx(
47
- Accordion,
48
- {
49
- hasBorder: true,
50
- initialOpen: true,
51
- accordionHeaderProps: { children: "Twitter" },
52
- deps: [formData],
53
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
54
- /* @__PURE__ */ jsx(
55
- Field,
56
- {
57
- htmlFor: "twitterCard",
58
- label: "twitter:card",
59
- hint: `<meta property="twitter:card" content="..." /> (${t(
60
- "resources.seo-metadata.defaults-to.text"
61
- )} summary_large_image)`,
62
- children: /* @__PURE__ */ jsx(
63
- I18nInput,
64
- {
65
- id: "twitterCard",
66
- fieldName: "twitterCard",
67
- translations: formData?.translations.map((t2) => ({
68
- locale: t2.locale,
69
- twitterCard: t2.twitterCard
70
- })),
71
- setFormData,
72
- errors
73
- }
74
- )
75
- }
76
- ),
77
- /* @__PURE__ */ jsx(
78
- Field,
79
- {
80
- htmlFor: "twitterSite",
81
- label: "twitter:site",
82
- hint: `<meta property="twitter:site" content="..." />`,
83
- children: /* @__PURE__ */ jsx(
84
- I18nInput,
85
- {
86
- id: "twitterSite",
87
- fieldName: "twitterSite",
88
- translations: formData?.translations.map((t2) => ({
89
- locale: t2.locale,
90
- twitterSite: t2.twitterSite
91
- })),
92
- setFormData,
93
- errors
94
- }
95
- )
96
- }
97
- ),
98
- /* @__PURE__ */ jsx(
99
- Field,
100
- {
101
- htmlFor: "twitterCreator",
102
- label: "twitter:creator",
103
- hint: `<meta property="twitter:creator" content="..." />`,
104
- children: /* @__PURE__ */ jsx(
105
- I18nInput,
106
- {
107
- id: "twitterCreator",
108
- fieldName: "twitterCreator",
109
- translations: formData?.translations.map((t2) => ({
110
- locale: t2.locale,
111
- twitterCreator: t2.twitterCreator
112
- })),
113
- setFormData,
114
- errors
115
- }
116
- )
117
- }
118
- )
119
- ] })
120
- }
121
- );
122
- };
123
- }
124
-
125
- export { createTwitterTags };
@@ -1,85 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useTranslator } from 'intor/react';
4
- import { Link2 } from 'lucide-react';
5
- import Link from 'next/link';
6
- import '../../../../../../constants/paths/auth.js';
7
- import '../../../../../../constants/paths/main.js';
8
- import '../../../../../../constants/paths/resources.js';
9
- import { NEW_TAB_REL, NEW_TAB_TARGET } from '../../../../../../constants/anchor.js';
10
- import '../../../../../../constants/redirect-paths.js';
11
- import '@radix-ui/react-avatar';
12
- import 'react';
13
- import 'ua-parser-js';
14
- import 'clsx';
15
- import 'tailwind-merge';
16
- import 'next/navigation';
17
- import '../../../shadcn/badge.js';
18
- import '../../../shadcn/button.js';
19
- import { Card } from '../../../shadcn/card.js';
20
- import '@radix-ui/react-collapsible';
21
- import '@radix-ui/react-dialog';
22
- import '@radix-ui/react-dropdown-menu';
23
- import '../../../shadcn/input-group.js';
24
- import '../../../shadcn/item.js';
25
- import '@radix-ui/react-label';
26
- import '@radix-ui/react-select';
27
- import '@radix-ui/react-separator';
28
- import '../../../shadcn/sidebar.js';
29
- import 'next-themes';
30
- import 'sonner';
31
- import '@radix-ui/react-tabs';
32
- import '@radix-ui/react-tooltip';
33
- import { Button } from '../../../ui/buttons/button.js';
34
- import 'mime-types';
35
- import '../../../../../../domain/resources/admin/constants.js';
36
- import 'next/image';
37
-
38
- function ReferenceCard() {
39
- const { t } = useTranslator();
40
- return /* @__PURE__ */ jsxs(Card, { className: "flex flex-col gap-2 p-4", children: [
41
- /* @__PURE__ */ jsxs("p", { className: "flex-center mb-2 gap-2 text-sm", children: [
42
- /* @__PURE__ */ jsx(Link2, { className: "size-5" }),
43
- t("resources.seo-metadata.quick-links.text")
44
- ] }),
45
- /* @__PURE__ */ jsx(
46
- Link,
47
- {
48
- href: "https://developers.google.com/search/docs",
49
- target: NEW_TAB_TARGET,
50
- rel: NEW_TAB_REL,
51
- children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", children: "Google SEO" })
52
- }
53
- ),
54
- /* @__PURE__ */ jsx(
55
- Link,
56
- {
57
- href: "https://search.google.com/test/rich-results",
58
- target: NEW_TAB_TARGET,
59
- rel: NEW_TAB_REL,
60
- children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", children: "Google Rich Results" })
61
- }
62
- ),
63
- /* @__PURE__ */ jsx(
64
- Link,
65
- {
66
- href: "https://validator.schema.org/",
67
- target: NEW_TAB_TARGET,
68
- rel: NEW_TAB_REL,
69
- children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", children: "Schema Validator" })
70
- }
71
- ),
72
- /* @__PURE__ */ jsx(Link, { href: "https://ogp.me/", target: NEW_TAB_TARGET, rel: NEW_TAB_REL, children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", children: "Open Graph" }) }),
73
- /* @__PURE__ */ jsx(
74
- Link,
75
- {
76
- href: "https://developer.x.com/en/docs/x-for-websites/cards/overview/abouts-cards",
77
- target: NEW_TAB_TARGET,
78
- rel: NEW_TAB_REL,
79
- children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", children: "Twitter Card" })
80
- }
81
- )
82
- ] });
83
- }
84
-
85
- export { ReferenceCard };
@@ -1,56 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import 'react';
4
- import 'ua-parser-js';
5
- import { cn } from '../../../../../applications/shadcn/utils.js';
6
- import 'next/navigation';
7
- import 'intor/react';
8
- import 'lucide-react';
9
- import '@radix-ui/react-avatar';
10
- import '../../../shadcn/badge.js';
11
- import '../../../shadcn/button.js';
12
- import '@radix-ui/react-collapsible';
13
- import '@radix-ui/react-dialog';
14
- import '@radix-ui/react-dropdown-menu';
15
- import '../../../shadcn/input-group.js';
16
- import '../../../shadcn/item.js';
17
- import '@radix-ui/react-label';
18
- import '@radix-ui/react-select';
19
- import '@radix-ui/react-separator';
20
- import '../../../shadcn/sidebar.js';
21
- import 'next-themes';
22
- import 'sonner';
23
- import '@radix-ui/react-tabs';
24
- import '@radix-ui/react-tooltip';
25
- import 'next/link';
26
- import '../../../../../../constants/paths/auth.js';
27
- import '../../../../../../constants/paths/main.js';
28
- import '../../../../../../constants/paths/resources.js';
29
- import '../../../../../../constants/redirect-paths.js';
30
- import 'mime-types';
31
- import { ActionButtonsCard } from '../../../ui/cards/action-buttons-card.js';
32
- import '../../../../../../domain/resources/admin/constants.js';
33
- import 'next/image';
34
- import { ReferenceCard } from './reference-card.js';
35
-
36
- function SeoFormSideFields({
37
- hasBeenCreated,
38
- isLoading,
39
- isTriggering,
40
- setIsOpen
41
- }) {
42
- return /* @__PURE__ */ jsxs("div", { className: cn("sticky top-0", "h-fit w-max", "flex flex-col gap-6"), children: [
43
- /* @__PURE__ */ jsx(
44
- ActionButtonsCard,
45
- {
46
- action: hasBeenCreated ? "update" : "create",
47
- isInitializing: isLoading,
48
- isProcessing: isTriggering,
49
- cancelButtonProps: { onClick: () => setIsOpen(false) }
50
- }
51
- ),
52
- /* @__PURE__ */ jsx(ReferenceCard, {})
53
- ] });
54
- }
55
-
56
- export { SeoFormSideFields };
@@ -1,186 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useEffect } from 'react';
4
- import '../../../../../../constants/paths/auth.js';
5
- import '../../../../../../constants/paths/main.js';
6
- import '../../../../../../constants/paths/resources.js';
7
- import { CACHE_KEYS } from '../../../../../../constants/cache-keys.js';
8
- import '../../../../../../constants/redirect-paths.js';
9
- import '../../../../../../domain/resources/admin/constants.js';
10
- import { POST_TYPES } from '../../../../../../domain/resources/post/props.js';
11
- import 'mime-types';
12
- import { datetimeToUi } from '../../../../../../shared/form/normalizers/datetime-to-ui.js';
13
- import { jsonArrayToUi } from '../../../../../../shared/form/normalizers/json-array-to-ui.js';
14
- import { ensureArray } from '../../../../../../shared/utils/ensure-array.js';
15
- import { useSeoMetadataUpsertFormData } from '../../../../../applications/resources/seo-metadata/use-upsert-form-data.js';
16
- import 'intor/react';
17
- import 'lucide-react';
18
- import 'ua-parser-js';
19
- import 'clsx';
20
- import 'tailwind-merge';
21
- import 'next/navigation';
22
- import '@radix-ui/react-avatar';
23
- import '../../../shadcn/badge.js';
24
- import '../../../shadcn/button.js';
25
- import '@radix-ui/react-collapsible';
26
- import '@radix-ui/react-dialog';
27
- import '@radix-ui/react-dropdown-menu';
28
- import '../../../shadcn/input-group.js';
29
- import '../../../shadcn/item.js';
30
- import '@radix-ui/react-label';
31
- import '@radix-ui/react-select';
32
- import '@radix-ui/react-separator';
33
- import '../../../shadcn/sidebar.js';
34
- import 'next-themes';
35
- import 'sonner';
36
- import '@radix-ui/react-tabs';
37
- import '@radix-ui/react-tooltip';
38
- import 'next/link';
39
- import { Form } from '../../../ui/form/form.js';
40
- import { FieldsContainer } from '../../../ui/form/containers/fields-container.js';
41
- import 'next/image';
42
- import { SeoFormSideFields } from './seo-form-side-fields.js';
43
-
44
- function createSeoForm({
45
- postFindFullAction,
46
- seoMetadataUpsertAction,
47
- useQuery,
48
- useCommand,
49
- buildTranslations,
50
- BaseTags,
51
- JsonLdTags,
52
- OpenGraphTags,
53
- TwitterTags
54
- }) {
55
- return function SeoForm({
56
- id,
57
- type = POST_TYPES.POST,
58
- slug,
59
- setIsOpen
60
- }) {
61
- const {
62
- data: post,
63
- isFetching,
64
- refetch
65
- } = useQuery(
66
- () => postFindFullAction({
67
- ...id && { id },
68
- type,
69
- ...slug && { slug }
70
- }),
71
- [CACHE_KEYS.findFull, id, type, slug],
72
- { select: (data) => data?.post, enabled: !!(id || slug) }
73
- );
74
- const postTranslations = ensureArray(post?.translations);
75
- const seoMetadatas = ensureArray(post?.seoMetadatas);
76
- const hasBeenCreated = seoMetadatas.length > 0;
77
- const { formData, setFormData } = useSeoMetadataUpsertFormData({
78
- ...id && { id },
79
- buildTranslations
80
- });
81
- const { execute, isPending, errors } = useCommand(
82
- () => seoMetadataUpsertAction({ formData }),
83
- { onSuccess: () => void refetch() }
84
- );
85
- useEffect(() => {
86
- if (post && seoMetadatas.length > 0) {
87
- queueMicrotask(
88
- () => setFormData({
89
- postId: post.id,
90
- translations: seoMetadatas.map((s) => {
91
- return {
92
- ...s,
93
- ogType: s.ogType,
94
- twitterCard: s.twitterCard,
95
- // Datetime to UI
96
- ogArticlePublishedTime: datetimeToUi(s.ogArticlePublishedTime),
97
- ogArticleModifiedTime: datetimeToUi(s.ogArticleModifiedTime),
98
- // Json Array to UI
99
- jsonLd: jsonArrayToUi(s.jsonLd)
100
- };
101
- })
102
- })
103
- );
104
- }
105
- }, [post, seoMetadatas, setFormData]);
106
- useEffect(() => {
107
- if (post && !hasBeenCreated && postTranslations) {
108
- queueMicrotask(
109
- () => setFormData((prev) => ({
110
- ...prev,
111
- postId: post.id,
112
- translations: prev.translations.map((prevTranslation) => {
113
- const t = postTranslations.find(
114
- (pt) => pt.locale === prevTranslation.locale
115
- );
116
- if (!t)
117
- return {
118
- ...prevTranslation,
119
- ogArticlePublishedTime: datetimeToUi(
120
- (/* @__PURE__ */ new Date()).toISOString()
121
- ),
122
- ogArticleModifiedTime: datetimeToUi((/* @__PURE__ */ new Date()).toISOString())
123
- };
124
- const title = t.title ?? prevTranslation.title;
125
- const description = t.description ?? prevTranslation.description;
126
- return {
127
- ...prevTranslation,
128
- title,
129
- description,
130
- ogArticlePublishedTime: datetimeToUi((/* @__PURE__ */ new Date()).toISOString()),
131
- ogArticleModifiedTime: datetimeToUi((/* @__PURE__ */ new Date()).toISOString())
132
- };
133
- })
134
- }))
135
- );
136
- }
137
- }, [post, hasBeenCreated, postTranslations, type, setFormData]);
138
- return /* @__PURE__ */ jsx(Form, { onSubmit: () => void execute(), children: /* @__PURE__ */ jsxs(FieldsContainer, { children: [
139
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-6 pb-64", children: [
140
- /* @__PURE__ */ jsx(
141
- BaseTags,
142
- {
143
- formData,
144
- setFormData,
145
- errors
146
- }
147
- ),
148
- /* @__PURE__ */ jsx(
149
- OpenGraphTags,
150
- {
151
- formData,
152
- setFormData,
153
- errors
154
- }
155
- ),
156
- /* @__PURE__ */ jsx(
157
- TwitterTags,
158
- {
159
- formData,
160
- setFormData,
161
- errors
162
- }
163
- ),
164
- /* @__PURE__ */ jsx(
165
- JsonLdTags,
166
- {
167
- formData,
168
- setFormData,
169
- errors
170
- }
171
- )
172
- ] }),
173
- /* @__PURE__ */ jsx(
174
- SeoFormSideFields,
175
- {
176
- hasBeenCreated,
177
- isLoading: isFetching,
178
- isTriggering: isPending,
179
- setIsOpen
180
- }
181
- )
182
- ] }) });
183
- };
184
- }
185
-
186
- export { createSeoForm };
@@ -1,69 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useTranslator } from 'intor/react';
4
- import { useState } from 'react';
5
- import '@radix-ui/react-avatar';
6
- import 'ua-parser-js';
7
- import 'clsx';
8
- import 'tailwind-merge';
9
- import 'next/navigation';
10
- import '../../shadcn/badge.js';
11
- import '../../shadcn/button.js';
12
- import '@radix-ui/react-collapsible';
13
- import { Dialog, DialogTrigger, DialogContent, DialogTitle } from '../../shadcn/dialog.js';
14
- import '@radix-ui/react-dropdown-menu';
15
- import 'lucide-react';
16
- import '../../shadcn/input-group.js';
17
- import '../../shadcn/item.js';
18
- import '@radix-ui/react-label';
19
- import '@radix-ui/react-select';
20
- import '@radix-ui/react-separator';
21
- import '@radix-ui/react-dialog';
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 { Button } from '../../ui/buttons/button.js';
28
- import 'next/link';
29
- import '../../../../../constants/paths/auth.js';
30
- import '../../../../../constants/paths/main.js';
31
- import '../../../../../constants/paths/resources.js';
32
- import '../../../../../constants/redirect-paths.js';
33
- import 'mime-types';
34
- import '../../../../../domain/resources/admin/constants.js';
35
- import 'next/image';
36
-
37
- function createSeoMetadataDialog({
38
- SeoForm
39
- }) {
40
- return function SeoMetadataDialog({
41
- id,
42
- type,
43
- slug,
44
- // ui states
45
- isLoading = false,
46
- isDisabled = false
47
- }) {
48
- const { t } = useTranslator();
49
- const [isOpen, setIsOpen] = useState(false);
50
- return /* @__PURE__ */ jsxs(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
51
- /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
52
- Button,
53
- {
54
- variant: "outline",
55
- isLoading,
56
- isDisabled,
57
- onClick: () => setIsOpen(true),
58
- children: t("resources.seo-metadata.text")
59
- }
60
- ) }),
61
- /* @__PURE__ */ jsxs(DialogContent, { className: "container h-[80%]", children: [
62
- /* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: "Dialog" }),
63
- /* @__PURE__ */ jsx("div", { className: "size-full overflow-y-scroll pr-6", children: !!(id || type && slug) && /* @__PURE__ */ jsx(SeoForm, { id, type, slug, setIsOpen }) })
64
- ] })
65
- ] });
66
- };
67
- }
68
-
69
- export { createSeoMetadataDialog };
@@ -1,2 +0,0 @@
1
- export { useSeoMetadataUpsertFormData } from "./use-upsert-form-data";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/applications/resources/seo-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,34 +0,0 @@
1
- import type { createBuildTranslations } from "../../../../shared";
2
- import type { Alternate } from "@yimingliao/cms";
3
- export declare function createSeoMetadataEmptyTranslation(buildTranslations: ReturnType<typeof createBuildTranslations>): ({
4
- locale: string;
5
- } & {
6
- title: null;
7
- description: null;
8
- author: null;
9
- canonical: null;
10
- alternate: Alternate[];
11
- robots: null;
12
- ogTitle: null;
13
- ogDescription: null;
14
- ogUrl: null;
15
- ogType: null;
16
- ogSiteName: null;
17
- ogImage: null;
18
- ogImageAlt: null;
19
- ogImageType: null;
20
- ogImageWidth: 0;
21
- ogImageHeight: 0;
22
- ogLocale: null;
23
- ogLocaleAlternate: [];
24
- ogArticlePublishedTime: null;
25
- ogArticleModifiedTime: null;
26
- ogArticleAuthor: null;
27
- ogArticleSection: null;
28
- ogArticleTag: [];
29
- twitterCard: null;
30
- twitterSite: null;
31
- twitterCreator: null;
32
- jsonLd: [];
33
- })[];
34
- //# sourceMappingURL=seo-metadata-empty-translation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seo-metadata-empty-translation.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAgB,iCAAiC,CAC/C,iBAAiB,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgE9D"}
@@ -1,79 +0,0 @@
1
- import type { createBuildTranslations } from "../../../../shared";
2
- export declare function useSeoMetadataUpsertFormData({ id, buildTranslations, }: {
3
- id?: string;
4
- buildTranslations: ReturnType<typeof createBuildTranslations>;
5
- }): {
6
- formData: {
7
- postId: string;
8
- translations: {
9
- locale: string;
10
- title: string | null;
11
- description: string | null;
12
- author: string | null;
13
- canonical: string | null;
14
- alternate: {
15
- hreflang: string;
16
- href: string;
17
- }[];
18
- robots: string | null;
19
- ogTitle: string | null;
20
- ogDescription: string | null;
21
- ogUrl: string | null;
22
- ogType: "article" | "book" | "music.song" | "music.album" | "music.playlist" | "music.radio_station" | "profile" | "website" | "video.tv_show" | "video.other" | "video.movie" | "video.episode" | null;
23
- ogSiteName: string | null;
24
- ogImage: string | null;
25
- ogImageAlt: string | null;
26
- ogImageType: string | null;
27
- ogImageWidth: number | null;
28
- ogImageHeight: number | null;
29
- ogLocale: string | null;
30
- ogLocaleAlternate: string[];
31
- ogArticlePublishedTime: string | null;
32
- ogArticleModifiedTime: string | null;
33
- ogArticleAuthor: string | null;
34
- ogArticleSection: string | null;
35
- ogArticleTag: string[];
36
- twitterCard: "summary" | "summary_large_image" | "player" | "app" | null;
37
- twitterSite: string | null;
38
- twitterCreator: string | null;
39
- jsonLd: any[];
40
- }[];
41
- };
42
- setFormData: import("react").Dispatch<import("react").SetStateAction<{
43
- postId: string;
44
- translations: {
45
- locale: string;
46
- title: string | null;
47
- description: string | null;
48
- author: string | null;
49
- canonical: string | null;
50
- alternate: {
51
- hreflang: string;
52
- href: string;
53
- }[];
54
- robots: string | null;
55
- ogTitle: string | null;
56
- ogDescription: string | null;
57
- ogUrl: string | null;
58
- ogType: "article" | "book" | "music.song" | "music.album" | "music.playlist" | "music.radio_station" | "profile" | "website" | "video.tv_show" | "video.other" | "video.movie" | "video.episode" | null;
59
- ogSiteName: string | null;
60
- ogImage: string | null;
61
- ogImageAlt: string | null;
62
- ogImageType: string | null;
63
- ogImageWidth: number | null;
64
- ogImageHeight: number | null;
65
- ogLocale: string | null;
66
- ogLocaleAlternate: string[];
67
- ogArticlePublishedTime: string | null;
68
- ogArticleModifiedTime: string | null;
69
- ogArticleAuthor: string | null;
70
- ogArticleSection: string | null;
71
- ogArticleTag: string[];
72
- twitterCard: "summary" | "summary_large_image" | "player" | "app" | null;
73
- twitterSite: string | null;
74
- twitterCreator: string | null;
75
- jsonLd: any[];
76
- }[];
77
- }>>;
78
- };
79
- //# sourceMappingURL=use-upsert-form-data.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-upsert-form-data.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/applications/resources/seo-metadata/use-upsert-form-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAKlE,wBAAgB,4BAA4B,CAAC,EAC3C,EAAE,EACF,iBAAiB,GAClB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;CAC/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA"}
@@ -1,3 +0,0 @@
1
- export { createSeoMetadataDialog } from "./seo-metadata-dialog";
2
- export { createSeoForm, createBaseTags, createOpenGraphTags, createTwitterTags, createJsonLdTags, } from "./seo-form";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/seo-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { SeoMetadataUpsertFormData } from "../../../../../../../server";
2
- import type { FormFieldController } from "../../../../../../../shared";
3
- import type { createI18nInput, createI18nObjectArrayInput, createI18nTextarea } from "../../../../ui/i18n";
4
- export declare function createBaseTags({ I18nInput, I18nTextarea, I18nObjectArrayInput, }: {
5
- I18nInput: ReturnType<typeof createI18nInput>;
6
- I18nTextarea: ReturnType<typeof createI18nTextarea>;
7
- I18nObjectArrayInput: ReturnType<typeof createI18nObjectArrayInput>;
8
- }): ({ formData, setFormData, errors, }: FormFieldController<SeoMetadataUpsertFormData> & {
9
- errors: string[];
10
- }) => import("react/jsx-runtime").JSX.Element;
11
- //# sourceMappingURL=base-tags.d.ts.map