@yimingliao/cms 0.0.158 → 0.0.161
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/resources/index.js +0 -6
- package/dist/export/client/index.js +4 -2
- package/dist/export/index.js +2 -0
- package/dist/src/client/applications/form/get-img-ids-from-htmls.js +22 -0
- package/dist/src/client/applications/form/process-content-html.js +65 -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/export/index.d.ts +1 -1
- package/dist/types/export/index.d.ts.map +1 -1
- package/dist/types/src/client/applications/form/get-img-ids-from-htmls.d.ts +2 -0
- package/dist/types/src/client/applications/form/get-img-ids-from-htmls.d.ts.map +1 -0
- package/dist/types/src/client/applications/form/index.d.ts +2 -0
- package/dist/types/src/client/applications/form/index.d.ts.map +1 -1
- package/dist/types/src/client/applications/form/process-content-html.d.ts +6 -0
- package/dist/types/src/client/applications/form/process-content-html.d.ts.map +1 -0
- package/dist/types/src/client/applications/index.d.ts +1 -1
- package/dist/types/src/client/applications/index.d.ts.map +1 -1
- 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 +0 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.js +0 -54
- package/dist/src/client/applications/resources/seo-metadata/use-upsert-form-data.js +0 -15
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.js +0 -187
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js +0 -78
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js +0 -441
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js +0 -125
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.js +0 -85
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.js +0 -56
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +0 -186
- package/dist/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +0 -69
- package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts +0 -2
- package/dist/types/src/client/applications/resources/seo-metadata/index.d.ts.map +0 -1
- package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts +0 -34
- package/dist/types/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.d.ts.map +0 -1
- package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +0 -79
- package/dist/types/src/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts +0 -3
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/index.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.d.ts +0 -11
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts +0 -5
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/index.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts +0 -9
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts +0 -13
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts +0 -9
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts +0 -3
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/index.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts +0 -2
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/reference-card.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts +0 -8
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form-side-fields.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +0 -28
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +0 -1
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +0 -11
- package/dist/types/src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +0 -1
|
@@ -26,9 +26,3 @@ export { createTopicRelationsSection } from '../../../../src/client/interfaces/c
|
|
|
26
26
|
export { TagCard } from '../../../../src/client/interfaces/components/resources/tag/tag-card.js';
|
|
27
27
|
export { createTagList } from '../../../../src/client/interfaces/components/resources/tag/tag-list.js';
|
|
28
28
|
export { createTagRelationsSection } from '../../../../src/client/interfaces/components/resources/tag/tag-relations-section.js';
|
|
29
|
-
export { createSeoMetadataDialog } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js';
|
|
30
|
-
export { createSeoForm } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js';
|
|
31
|
-
export { createBaseTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.js';
|
|
32
|
-
export { createOpenGraphTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js';
|
|
33
|
-
export { createTwitterTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js';
|
|
34
|
-
export { createJsonLdTags } from '../../../../src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js';
|
|
@@ -9,10 +9,12 @@ export { createUseCommand } from '../../src/client/infrastructure/react-query/cr
|
|
|
9
9
|
export { createUseQuery } from '../../src/client/infrastructure/react-query/create-use-query.js';
|
|
10
10
|
export { handleToast } from '../../src/client/infrastructure/toast/handle-toast.js';
|
|
11
11
|
export { NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, SIDEBAR_WIDTH } from '../../src/client/interfaces/styles/constants.js';
|
|
12
|
-
|
|
12
|
+
import 'react';
|
|
13
|
+
import 'ua-parser-js';
|
|
13
14
|
export { usePickItems } from '../../src/client/applications/form/use-pick-items.js';
|
|
14
15
|
export { getControlMeta } from '../../src/client/applications/form/get-control-meta.js';
|
|
16
|
+
export { getImgIdsFromHtmls } from '../../src/client/applications/form/get-img-ids-from-htmls.js';
|
|
17
|
+
export { createProcessContentHtml } from '../../src/client/applications/form/process-content-html.js';
|
|
15
18
|
export { cn } from '../../src/client/applications/shadcn/utils.js';
|
|
16
|
-
import 'react';
|
|
17
19
|
import 'next/navigation';
|
|
18
20
|
export { isConfirm } from '../../src/client/applications/ui/is-confirm.js';
|
package/dist/export/index.js
CHANGED
|
@@ -27,7 +27,9 @@ export { datetimeToDb } from '../src/shared/form/normalizers/datetime-to-db.js';
|
|
|
27
27
|
export { datetimeToUi } from '../src/shared/form/normalizers/datetime-to-ui.js';
|
|
28
28
|
export { jsonArrayToDb } from '../src/shared/form/normalizers/json-array-to-db.js';
|
|
29
29
|
export { jsonArrayToUi } from '../src/shared/form/normalizers/json-array-to-ui.js';
|
|
30
|
+
export { debounce } from '../src/shared/utils/debounce.js';
|
|
30
31
|
export { ensureArray } from '../src/shared/utils/ensure-array.js';
|
|
31
32
|
export { formatDateTime } from '../src/shared/utils/format-date-time.js';
|
|
32
33
|
export { joinUrl } from '../src/shared/utils/join-url.js';
|
|
34
|
+
export { DO_NOT_FETCH_KEY } from '../src/shared/list-items.js';
|
|
33
35
|
export { SIZE } from '../src/shared/units.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const getImgIdsFromHtmls = (htmls) => {
|
|
2
|
+
const imageIds = /* @__PURE__ */ new Set();
|
|
3
|
+
if (typeof DOMParser === "undefined") return [];
|
|
4
|
+
const parser = new DOMParser();
|
|
5
|
+
for (const html of htmls) {
|
|
6
|
+
const doc = parser.parseFromString(html, "text/html");
|
|
7
|
+
const imgs = doc.querySelectorAll("img");
|
|
8
|
+
for (const img of imgs) {
|
|
9
|
+
const src = img.getAttribute("src");
|
|
10
|
+
if (!src) continue;
|
|
11
|
+
try {
|
|
12
|
+
const url = new URL(src, location.origin);
|
|
13
|
+
const id = url.searchParams.get("id");
|
|
14
|
+
if (id) imageIds.add(id);
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return [...imageIds];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { getImgIdsFromHtmls };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const HEADING_ID_FALLBACK = "heading";
|
|
2
|
+
const generateHeadingId = (text, usedIds) => {
|
|
3
|
+
if (!text) text = HEADING_ID_FALLBACK;
|
|
4
|
+
let baseId = text.trim().toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^\w-]/g, "");
|
|
5
|
+
if (!baseId) baseId = HEADING_ID_FALLBACK;
|
|
6
|
+
let id = baseId;
|
|
7
|
+
let counter = 1;
|
|
8
|
+
while (usedIds.has(id)) {
|
|
9
|
+
id = `${baseId}-${counter++}`;
|
|
10
|
+
}
|
|
11
|
+
usedIds.add(id);
|
|
12
|
+
return id;
|
|
13
|
+
};
|
|
14
|
+
function createProcessContentHtml(maxWidth) {
|
|
15
|
+
return function processContentHtml(html) {
|
|
16
|
+
if (!html) return { content: "", toc: [] };
|
|
17
|
+
const container = document.createElement("div");
|
|
18
|
+
container.innerHTML = html;
|
|
19
|
+
const headings = [
|
|
20
|
+
...container.querySelectorAll("h2,h3,h4,h5,h6")
|
|
21
|
+
];
|
|
22
|
+
const usedIds = /* @__PURE__ */ new Set();
|
|
23
|
+
const toc = [];
|
|
24
|
+
const tocStack = [];
|
|
25
|
+
headings.forEach((el) => {
|
|
26
|
+
const rawLevel = Number.parseInt(el.tagName[1] ?? "");
|
|
27
|
+
if (![2, 3, 4, 5, 6].includes(rawLevel)) return;
|
|
28
|
+
const level = rawLevel;
|
|
29
|
+
const text = el.textContent?.trim() ?? "";
|
|
30
|
+
const id = generateHeadingId(text, usedIds);
|
|
31
|
+
el.id = id;
|
|
32
|
+
const item = { text, id, level, children: [] };
|
|
33
|
+
while (tocStack.length > 0 && tocStack.at(-1).level >= level) {
|
|
34
|
+
tocStack.pop();
|
|
35
|
+
}
|
|
36
|
+
if (tocStack.length === 0) {
|
|
37
|
+
toc.push(item);
|
|
38
|
+
} else {
|
|
39
|
+
tocStack.at(-1).children.push(item);
|
|
40
|
+
}
|
|
41
|
+
tocStack.push(item);
|
|
42
|
+
});
|
|
43
|
+
const images = [...container.querySelectorAll("img")];
|
|
44
|
+
images.forEach((img) => {
|
|
45
|
+
img.loading = "lazy";
|
|
46
|
+
if (!img.hasAttribute("sizes")) {
|
|
47
|
+
img.sizes = `(max-width: ${maxWidth}px) 100vw, ${maxWidth}px`;
|
|
48
|
+
}
|
|
49
|
+
if (!img.style.maxWidth) img.style.maxWidth = "100%";
|
|
50
|
+
if (!img.style.height) img.style.height = "auto";
|
|
51
|
+
if (!img.hasAttribute("width") && !img.hasAttribute("height") && img.naturalWidth && img.naturalHeight) {
|
|
52
|
+
img.width = img.naturalWidth;
|
|
53
|
+
img.height = img.naturalHeight;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
content: container.innerHTML,
|
|
58
|
+
// HTML with ids added
|
|
59
|
+
toc
|
|
60
|
+
// structured TOC
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { createProcessContentHtml };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AdminCard, createAdminList, createAdminRelationsSection, ActiveSessionsBadge, AdminRefreshTokenCard, createFileCard, createFileList, createFileRelationsSection, FolderCard, createFolderList, FolderFullPath, createFileManagerList, createFolderRelationsSection, createPostCard, createPostList, createPostRelationsSection, PostTypeGate, CategoryCard, createCategoryList, createCategoryRelationsSection, TopicCard, createTopicList, createTopicRelationsSection, TagCard, createTagList, createTagRelationsSection,
|
|
1
|
+
export { AdminCard, createAdminList, createAdminRelationsSection, ActiveSessionsBadge, AdminRefreshTokenCard, createFileCard, createFileList, createFileRelationsSection, FolderCard, createFolderList, FolderFullPath, createFileManagerList, createFolderRelationsSection, createPostCard, createPostList, createPostRelationsSection, PostTypeGate, CategoryCard, createCategoryList, createCategoryRelationsSection, TopicCard, createTopicList, createTopicRelationsSection, TagCard, createTagList, createTagRelationsSection, } from "../../../../src/client/interfaces/components/resources";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/client/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EAErB,cAAc,EACd,cAAc,EACd,0BAA0B,EAE1B,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,EAE5B,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAE9B,SAAS,EACT,eAAe,EACf,2BAA2B,EAE3B,OAAO,EACP,aAAa,EACb,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/client/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EAErB,cAAc,EACd,cAAc,EACd,0BAA0B,EAE1B,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,EAE5B,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAE9B,SAAS,EACT,eAAe,EACf,2BAA2B,EAE3B,OAAO,EACP,aAAa,EACb,yBAAyB,GAC1B,MAAM,wDAAwD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption, NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT, cn,
|
|
1
|
+
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption, NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT, cn, getControlMeta, usePickItems, getImgIdsFromHtmls, createProcessContentHtml, isConfirm, } from "../../src/client";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../export/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,EAMpB,aAAa,EACb,aAAa,EACb,kBAAkB,EAKlB,EAAE,EACF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../export/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,EAMpB,aAAa,EACb,aAAa,EACb,kBAAkB,EAKlB,EAAE,EACF,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type MultiItems, type SingleItem, type BaseTranslation, type Translation, ADMIN_ROLES, type AdminRole, type Admin, type AdminTranslation, type AdminFull, type AdminCard, type AdminSafe, ADMIN_ROLE_ARRAY, ADMIN_ROLE_I18N_MAP, type AdminRefreshToken, type DeviceInfo, FILE_TYPES, type FileType, type File, type FileTranslation, type FileFull, type FileCard, isFileLocked, type Folder, type FolderFull, isFolderLocked, normalizeFolderKey, fileManagerDoubleClick, POST_TYPES, type PostType, type Post, type PostTranslation, type PostFull, type PostListCard, type ExternalLink, type Faq, type TocItem, type SeoMetadata, type Alternate, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME, } from "../src/domain";
|
|
2
2
|
export { CACHE_KEYS, KEYS, PATHS, PROTECTED_PATHS, LOGGED_IN_SKIP_PATHS, NEW_TAB_REL, NEW_TAB_TARGET, } from "../src/constants";
|
|
3
|
-
export { mimeToExtension, classifyFileType, getMediaInfo, formatFileSize, type BlobFile, result, type SuccessResultParams, type ErrorResultParams, type Result, type SuccessResult, type ErrorResult, type ErrorDetail, OG_TYPE_ARRAY, type OgType, TWITTER_CARD_ARRAY, type TwitterCard, createBuildWebsiteMetadata, createBuildArticleMetadata, serializeJsonLd, findTranslation, createBuildTranslations, datetimeToDb, datetimeToUi, jsonArrayToDb, jsonArrayToUi, type UIStates, type FormData, type FormFieldController, ensureArray, formatDateTime, joinUrl, SIZE, type SizeUnit, } from "../src/shared";
|
|
3
|
+
export { mimeToExtension, classifyFileType, getMediaInfo, formatFileSize, type BlobFile, result, type SuccessResultParams, type ErrorResultParams, type Result, type SuccessResult, type ErrorResult, type ErrorDetail, OG_TYPE_ARRAY, type OgType, TWITTER_CARD_ARRAY, type TwitterCard, createBuildWebsiteMetadata, createBuildArticleMetadata, serializeJsonLd, findTranslation, createBuildTranslations, datetimeToDb, datetimeToUi, jsonArrayToDb, jsonArrayToUi, type UIStates, type FormData, type FormFieldController, debounce, ensureArray, formatDateTime, joinUrl, DO_NOT_FETCH_KEY, type ListItemsState, SIZE, type SizeUnit, } from "../src/shared";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,WAAW,EACX,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,gBAAgB,EAChB,mBAAmB,EAEnB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAEf,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,YAAY,EAEZ,KAAK,MAAM,EACX,KAAK,UAAU,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EAEtB,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,OAAO,EAEZ,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,UAAU,EACV,IAAI,EACJ,KAAK,EACL,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,KAAK,QAAQ,EAGb,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,aAAa,EACb,KAAK,MAAM,EACX,kBAAkB,EAClB,KAAK,WAAW,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EAGf,eAAe,EACf,uBAAuB,EAGvB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAGxB,WAAW,EACX,cAAc,EACd,OAAO,EAGP,IAAI,EACJ,KAAK,QAAQ,GACd,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,WAAW,EACX,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,gBAAgB,EAChB,mBAAmB,EAEnB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAEf,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,YAAY,EAEZ,KAAK,MAAM,EACX,KAAK,UAAU,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EAEtB,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,OAAO,EAEZ,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,UAAU,EACV,IAAI,EACJ,KAAK,EACL,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,KAAK,QAAQ,EAGb,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,aAAa,EACb,KAAK,MAAM,EACX,kBAAkB,EAClB,KAAK,WAAW,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EAGf,eAAe,EACf,uBAAuB,EAGvB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAGxB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EAGP,gBAAgB,EAChB,KAAK,cAAc,EAGnB,IAAI,EACJ,KAAK,QAAQ,GACd,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-img-ids-from-htmls.d.ts","sourceRoot":"","sources":["../../../../../../src/client/applications/form/get-img-ids-from-htmls.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,KAAG,MAAM,EA2B1D,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { usePickItems } from "./use-pick-items";
|
|
2
2
|
export { getControlMeta } from "./get-control-meta";
|
|
3
|
+
export { getImgIdsFromHtmls } from "./get-img-ids-from-htmls";
|
|
4
|
+
export { createProcessContentHtml } from "./process-content-html";
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/applications/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/applications/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-content-html.d.ts","sourceRoot":"","sources":["../../../../../../src/client/applications/form/process-content-html.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAwB/C,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,IAEpB,MAAM,MAAM,GAAG,IAAI,KAAG;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,OAAO,EAAE,CAAC;CAChB,CA8DF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useDeviceInfo } from "./auth";
|
|
2
|
-
export { usePickItems, getControlMeta } from "./form";
|
|
2
|
+
export { usePickItems, getControlMeta, getImgIdsFromHtmls, createProcessContentHtml, } from "./form";
|
|
3
3
|
export { cn, useIsMobile } from "./shadcn";
|
|
4
4
|
export { useCountdown, useParentPathname, isConfirm } from "./ui";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption, } from "./infrastructure";
|
|
2
2
|
export { NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT, } from "./interfaces";
|
|
3
|
-
export { cn,
|
|
3
|
+
export { cn, getControlMeta, usePickItems, getImgIdsFromHtmls, createProcessContentHtml, isConfirm, } from "./applications";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,EAAE,EACF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,EAAE,EACF,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,GACV,MAAM,gBAAgB,CAAC"}
|
|
@@ -5,5 +5,4 @@ export { createPostCard, createPostList, createPostRelationsSection, PostTypeGat
|
|
|
5
5
|
export { CategoryCard, createCategoryList, createCategoryRelationsSection, } from "./category";
|
|
6
6
|
export { TopicCard, createTopicList, createTopicRelationsSection, } from "./topic";
|
|
7
7
|
export { TagCard, createTagList, createTagRelationsSection } from "./tag";
|
|
8
|
-
export { createBaseTags, createOpenGraphTags, createTwitterTags, createJsonLdTags, createSeoForm, createSeoMetadataDialog, } from "./seo-metadata";
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/interfaces/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,GAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/interfaces/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,GAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yimingliao/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.161",
|
|
4
4
|
"author": "Yiming Liao",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"argon2": "^0.44.0",
|
|
80
80
|
"ckeditor5": "^47.6.1",
|
|
81
81
|
"class-variance-authority": "^0.7.1",
|
|
82
|
+
"clsx": "^2.1.1",
|
|
82
83
|
"jsonwebtoken": "^9.0.3",
|
|
83
84
|
"keyv": "^5.6.0",
|
|
84
85
|
"logry": "^2.1.6",
|
|
@@ -89,8 +90,10 @@
|
|
|
89
90
|
"nodemailer": "^8.0.1",
|
|
90
91
|
"p-limit": "^7.3.0",
|
|
91
92
|
"sonner": "^2.0.7",
|
|
93
|
+
"tailwind-merge": "^3.5.0",
|
|
92
94
|
"ua-parser-js": "^2.0.9",
|
|
93
|
-
"ulid": "^3.0.2"
|
|
95
|
+
"ulid": "^3.0.2",
|
|
96
|
+
"zod": "^4.3.6"
|
|
94
97
|
},
|
|
95
98
|
"devDependencies": {
|
|
96
99
|
"@aws-sdk/client-s3": "^3.1004.0",
|
|
@@ -104,7 +107,6 @@
|
|
|
104
107
|
"@types/nodemailer": "^7.0.11",
|
|
105
108
|
"@types/react": "^19.2.14",
|
|
106
109
|
"@types/ssh2-sftp-client": "^9.0.6",
|
|
107
|
-
"clsx": "^2.1.1",
|
|
108
110
|
"eslint": "^9",
|
|
109
111
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
110
112
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -125,11 +127,9 @@
|
|
|
125
127
|
"rollup": "^4.59.0",
|
|
126
128
|
"rollup-plugin-copy": "^3.5.0",
|
|
127
129
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
128
|
-
"tailwind-merge": "^3.5.0",
|
|
129
130
|
"tsc-alias": "^1.8.16",
|
|
130
131
|
"typescript": "^5.9.3",
|
|
131
|
-
"typescript-eslint": "^8.56.1"
|
|
132
|
-
"zod": "^4.3.6"
|
|
132
|
+
"typescript-eslint": "^8.56.1"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@aws-sdk/client-s3": "^3.0.0",
|
package/dist/src/client/applications/resources/seo-metadata/seo-metadata-empty-translation.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
function createSeoMetadataEmptyTranslation(buildTranslations) {
|
|
2
|
-
return buildTranslations([
|
|
3
|
-
// -----------------------------------------------------------------------
|
|
4
|
-
// Basic
|
|
5
|
-
// -----------------------------------------------------------------------
|
|
6
|
-
{ key: "title", value: null },
|
|
7
|
-
{ key: "description", value: null },
|
|
8
|
-
// identity
|
|
9
|
-
{ key: "author", value: null },
|
|
10
|
-
// url
|
|
11
|
-
{ key: "canonical", value: null },
|
|
12
|
-
{ key: "alternate", value: [] },
|
|
13
|
-
// robots
|
|
14
|
-
{ key: "robots", value: null },
|
|
15
|
-
// -----------------------------------------------------------------------
|
|
16
|
-
// Open Graph
|
|
17
|
-
// -----------------------------------------------------------------------
|
|
18
|
-
{ key: "ogTitle", value: null },
|
|
19
|
-
{ key: "ogDescription", value: null },
|
|
20
|
-
// url
|
|
21
|
-
{ key: "ogUrl", value: null },
|
|
22
|
-
// identity
|
|
23
|
-
{ key: "ogType", value: null },
|
|
24
|
-
{ key: "ogSiteName", value: null },
|
|
25
|
-
// image
|
|
26
|
-
{ key: "ogImage", value: null },
|
|
27
|
-
{ key: "ogImageAlt", value: null },
|
|
28
|
-
{ key: "ogImageType", value: null },
|
|
29
|
-
{ key: "ogImageWidth", value: 0 },
|
|
30
|
-
{ key: "ogImageHeight", value: 0 },
|
|
31
|
-
// locale
|
|
32
|
-
{ key: "ogLocale", value: null },
|
|
33
|
-
{ key: "ogLocaleAlternate", value: [] },
|
|
34
|
-
// article
|
|
35
|
-
{ key: "ogArticlePublishedTime", value: null },
|
|
36
|
-
{ key: "ogArticleModifiedTime", value: null },
|
|
37
|
-
{ key: "ogArticleAuthor", value: null },
|
|
38
|
-
{ key: "ogArticleSection", value: null },
|
|
39
|
-
{ key: "ogArticleTag", value: [] },
|
|
40
|
-
// -----------------------------------------------------------------------
|
|
41
|
-
// Twitter
|
|
42
|
-
// -----------------------------------------------------------------------
|
|
43
|
-
{ key: "twitterCard", value: null },
|
|
44
|
-
// identity
|
|
45
|
-
{ key: "twitterSite", value: null },
|
|
46
|
-
{ key: "twitterCreator", value: null },
|
|
47
|
-
// -----------------------------------------------------------------------
|
|
48
|
-
// JSON-LD
|
|
49
|
-
// -----------------------------------------------------------------------
|
|
50
|
-
{ key: "jsonLd", value: [] }
|
|
51
|
-
]);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { createSeoMetadataEmptyTranslation };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { createSeoMetadataEmptyTranslation } from './seo-metadata-empty-translation.js';
|
|
3
|
-
|
|
4
|
-
function useSeoMetadataUpsertFormData({
|
|
5
|
-
id,
|
|
6
|
-
buildTranslations
|
|
7
|
-
}) {
|
|
8
|
-
const [formData, setFormData] = useState(() => ({
|
|
9
|
-
postId: id ?? "",
|
|
10
|
-
translations: createSeoMetadataEmptyTranslation(buildTranslations)
|
|
11
|
-
}));
|
|
12
|
-
return { formData, setFormData };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { useSeoMetadataUpsertFormData };
|
package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/base-tags.js
DELETED
|
@@ -1,187 +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 createBaseTags({
|
|
38
|
-
I18nInput,
|
|
39
|
-
I18nTextarea,
|
|
40
|
-
I18nObjectArrayInput
|
|
41
|
-
}) {
|
|
42
|
-
return function BaseTags({
|
|
43
|
-
formData,
|
|
44
|
-
setFormData,
|
|
45
|
-
errors
|
|
46
|
-
}) {
|
|
47
|
-
const { t } = useTranslator();
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
Accordion,
|
|
50
|
-
{
|
|
51
|
-
hasBorder: true,
|
|
52
|
-
initialOpen: true,
|
|
53
|
-
accordionHeaderProps: { children: "Basic" },
|
|
54
|
-
deps: [formData],
|
|
55
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
56
|
-
/* @__PURE__ */ jsx(Field, { htmlFor: "title", label: "title", hint: "<title>...</title>", children: /* @__PURE__ */ jsx(
|
|
57
|
-
I18nInput,
|
|
58
|
-
{
|
|
59
|
-
id: "title",
|
|
60
|
-
fieldName: "title",
|
|
61
|
-
translations: formData?.translations.map((t2) => ({
|
|
62
|
-
locale: t2.locale,
|
|
63
|
-
title: t2.title
|
|
64
|
-
})),
|
|
65
|
-
setFormData,
|
|
66
|
-
errors
|
|
67
|
-
}
|
|
68
|
-
) }),
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
70
|
-
Field,
|
|
71
|
-
{
|
|
72
|
-
htmlFor: "description",
|
|
73
|
-
label: "description",
|
|
74
|
-
hint: `<meta name="description" content="..." />`,
|
|
75
|
-
children: /* @__PURE__ */ jsx(
|
|
76
|
-
I18nTextarea,
|
|
77
|
-
{
|
|
78
|
-
id: "description",
|
|
79
|
-
fieldName: "description",
|
|
80
|
-
translations: formData?.translations.map((t2) => ({
|
|
81
|
-
locale: t2.locale,
|
|
82
|
-
description: t2.description
|
|
83
|
-
})),
|
|
84
|
-
setFormData,
|
|
85
|
-
errors
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
91
|
-
Field,
|
|
92
|
-
{
|
|
93
|
-
htmlFor: "author",
|
|
94
|
-
label: "author",
|
|
95
|
-
hint: `<meta name="author" content="..."> (${t(
|
|
96
|
-
"resources.seo-metadata.defaults-to.text"
|
|
97
|
-
)} Site Name)`,
|
|
98
|
-
children: /* @__PURE__ */ jsx(
|
|
99
|
-
I18nInput,
|
|
100
|
-
{
|
|
101
|
-
id: "author",
|
|
102
|
-
fieldName: "author",
|
|
103
|
-
translations: formData?.translations.map((t2) => ({
|
|
104
|
-
locale: t2.locale,
|
|
105
|
-
author: t2.author
|
|
106
|
-
})),
|
|
107
|
-
setFormData,
|
|
108
|
-
errors
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
Field,
|
|
115
|
-
{
|
|
116
|
-
htmlFor: "canonical",
|
|
117
|
-
label: "canonical",
|
|
118
|
-
hint: `<meta name="canonical" content="...">`,
|
|
119
|
-
children: /* @__PURE__ */ jsx(
|
|
120
|
-
I18nInput,
|
|
121
|
-
{
|
|
122
|
-
id: "canonical",
|
|
123
|
-
fieldName: "canonical",
|
|
124
|
-
translations: formData?.translations.map((t2) => ({
|
|
125
|
-
locale: t2.locale,
|
|
126
|
-
canonical: t2.canonical
|
|
127
|
-
})),
|
|
128
|
-
setFormData,
|
|
129
|
-
errors
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ jsx(
|
|
135
|
-
Field,
|
|
136
|
-
{
|
|
137
|
-
htmlFor: "robots",
|
|
138
|
-
label: "robots",
|
|
139
|
-
hint: `<meta name="robots" content="..."> (${t(
|
|
140
|
-
"resources.seo-metadata.defaults-to.text"
|
|
141
|
-
)} index, follow, max-image-preview: large)`,
|
|
142
|
-
children: /* @__PURE__ */ jsx(
|
|
143
|
-
I18nInput,
|
|
144
|
-
{
|
|
145
|
-
id: "robots",
|
|
146
|
-
fieldName: "robots",
|
|
147
|
-
translations: formData?.translations.map((t2) => ({
|
|
148
|
-
locale: t2.locale,
|
|
149
|
-
robots: t2.robots
|
|
150
|
-
})),
|
|
151
|
-
setFormData,
|
|
152
|
-
errors
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ jsx(
|
|
158
|
-
Field,
|
|
159
|
-
{
|
|
160
|
-
label: "alternate",
|
|
161
|
-
hint: `<link rel="alternate" hreflang="en-US" href="..." />`,
|
|
162
|
-
children: /* @__PURE__ */ jsx(
|
|
163
|
-
I18nObjectArrayInput,
|
|
164
|
-
{
|
|
165
|
-
fieldName: "alternate",
|
|
166
|
-
translations: formData?.translations.map((t2) => ({
|
|
167
|
-
locale: t2.locale,
|
|
168
|
-
alternate: t2.alternate
|
|
169
|
-
})),
|
|
170
|
-
setFormData,
|
|
171
|
-
errors,
|
|
172
|
-
fields: [
|
|
173
|
-
{ key: "hreflang", placeholder: "hreflang" },
|
|
174
|
-
{ key: "href", placeholder: "href" }
|
|
175
|
-
],
|
|
176
|
-
isResizable: false
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
] })
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { createBaseTags };
|
package/dist/src/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
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 '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 createJsonLdTags({
|
|
38
|
-
I18nJsonInput
|
|
39
|
-
}) {
|
|
40
|
-
return function JsonLdTags({
|
|
41
|
-
formData,
|
|
42
|
-
setFormData,
|
|
43
|
-
errors
|
|
44
|
-
}) {
|
|
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 };
|