@aphexcms/cms-core 9.0.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/generate-types.d.ts.map +1 -1
- package/dist/cli/generate-types.js +197 -8
- package/dist/cli/generate-types.js.map +1 -1
- package/dist/components/AdminApp.svelte +46 -137
- package/dist/components/AdminApp.svelte.d.ts.map +1 -1
- package/dist/components/admin/DocumentEditor.svelte +237 -206
- package/dist/components/admin/DocumentEditor.svelte.d.ts.map +1 -1
- package/dist/components/admin/DocumentVersionPanel.svelte +3 -2
- package/dist/components/admin/DocumentVersionPanel.svelte.d.ts.map +1 -1
- package/dist/components/admin/MediaBrowser.svelte +22 -4
- package/dist/components/admin/MediaBrowser.svelte.d.ts.map +1 -1
- package/dist/components/admin/ObjectModal.svelte +62 -75
- package/dist/components/admin/ObjectModal.svelte.d.ts.map +1 -1
- package/dist/components/admin/SchemaField.svelte +2 -2
- package/dist/components/admin/fields/ArrayField.svelte +9 -1
- package/dist/components/admin/fields/ArrayField.svelte.d.ts.map +1 -1
- package/dist/components/admin/fields/ReferenceField.svelte +37 -8
- package/dist/components/admin/fields/ReferenceField.svelte.d.ts.map +1 -1
- package/dist/components/admin/fields/richtext/PortableTextImageView.svelte +116 -0
- package/dist/components/admin/fields/richtext/PortableTextImageView.svelte.d.ts +12 -0
- package/dist/components/admin/fields/richtext/PortableTextImageView.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/PortableTextInlineView.svelte +111 -0
- package/dist/components/admin/fields/richtext/PortableTextInlineView.svelte.d.ts +12 -0
- package/dist/components/admin/fields/richtext/PortableTextInlineView.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/PortableTextObjectView.svelte +67 -0
- package/dist/components/admin/fields/richtext/PortableTextObjectView.svelte.d.ts +12 -0
- package/dist/components/admin/fields/richtext/PortableTextObjectView.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/RichtextField.svelte +1314 -0
- package/dist/components/admin/fields/richtext/RichtextField.svelte.d.ts +15 -0
- package/dist/components/admin/fields/richtext/RichtextField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/custom-annotation-mark.d.ts +7 -0
- package/dist/components/admin/fields/richtext/custom-annotation-mark.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/custom-annotation-mark.js +33 -0
- package/dist/components/admin/fields/richtext/portable-text-inline-object.d.ts +11 -0
- package/dist/components/admin/fields/richtext/portable-text-inline-object.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/portable-text-inline-object.js +31 -0
- package/dist/components/admin/fields/richtext/portable-text-object-node.d.ts +11 -0
- package/dist/components/admin/fields/richtext/portable-text-object-node.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/portable-text-object-node.js +31 -0
- package/dist/components/admin/fields/richtext/portable-text-serializer.d.ts +38 -0
- package/dist/components/admin/fields/richtext/portable-text-serializer.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/portable-text-serializer.js +318 -0
- package/dist/components/admin/fields/richtext/svelte-inline-node-view.d.ts +8 -0
- package/dist/components/admin/fields/richtext/svelte-inline-node-view.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/svelte-inline-node-view.js +67 -0
- package/dist/components/admin/fields/richtext/svelte-node-view.d.ts +8 -0
- package/dist/components/admin/fields/richtext/svelte-node-view.d.ts.map +1 -0
- package/dist/components/admin/fields/richtext/svelte-node-view.js +63 -0
- package/dist/db/interfaces/document.d.ts +8 -2
- package/dist/db/interfaces/document.d.ts.map +1 -1
- package/dist/graphql/resolvers.d.ts.map +1 -1
- package/dist/graphql/resolvers.js +13 -11
- package/dist/graphql/schema.d.ts.map +1 -1
- package/dist/graphql/schema.js +7 -3
- package/dist/lib/components/admin/fields/richtext/custom-annotation-mark.d.ts +7 -0
- package/dist/lib/components/admin/fields/richtext/custom-annotation-mark.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/custom-annotation-mark.js +34 -0
- package/dist/lib/components/admin/fields/richtext/custom-annotation-mark.js.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-inline-object.d.ts +11 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-inline-object.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-inline-object.js +32 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-inline-object.js.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-object-node.d.ts +11 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-object-node.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-object-node.js +32 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-object-node.js.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-serializer.d.ts +38 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-serializer.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-serializer.js +319 -0
- package/dist/lib/components/admin/fields/richtext/portable-text-serializer.js.map +1 -0
- package/dist/lib/components/admin/fields/richtext/svelte-inline-node-view.d.ts +8 -0
- package/dist/lib/components/admin/fields/richtext/svelte-inline-node-view.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/svelte-inline-node-view.js +68 -0
- package/dist/lib/components/admin/fields/richtext/svelte-inline-node-view.js.map +1 -0
- package/dist/lib/components/admin/fields/richtext/svelte-node-view.d.ts +8 -0
- package/dist/lib/components/admin/fields/richtext/svelte-node-view.d.ts.map +1 -0
- package/dist/lib/components/admin/fields/richtext/svelte-node-view.js +64 -0
- package/dist/lib/components/admin/fields/richtext/svelte-node-view.js.map +1 -0
- package/dist/lib/db/interfaces/document.d.ts +8 -2
- package/dist/lib/db/interfaces/document.d.ts.map +1 -1
- package/dist/lib/graphql/resolvers.d.ts.map +1 -1
- package/dist/lib/graphql/resolvers.js +13 -11
- package/dist/lib/graphql/resolvers.js.map +1 -1
- package/dist/lib/graphql/schema.d.ts.map +1 -1
- package/dist/lib/graphql/schema.js +7 -3
- package/dist/lib/graphql/schema.js.map +1 -1
- package/dist/lib/local-api/collection-api.d.ts.map +1 -1
- package/dist/lib/local-api/collection-api.js +7 -0
- package/dist/lib/local-api/collection-api.js.map +1 -1
- package/dist/lib/schema-utils/validator.d.ts.map +1 -1
- package/dist/lib/schema-utils/validator.js +5 -1
- package/dist/lib/schema-utils/validator.js.map +1 -1
- package/dist/lib/server/api/routes/assets-by-id.d.ts.map +1 -1
- package/dist/lib/server/api/routes/assets-by-id.js +10 -2
- package/dist/lib/server/api/routes/assets-by-id.js.map +1 -1
- package/dist/lib/server/api/routes/assets-references.d.ts.map +1 -1
- package/dist/lib/server/api/routes/assets-references.js +6 -4
- package/dist/lib/server/api/routes/assets-references.js.map +1 -1
- package/dist/lib/types/schemas.d.ts +27 -0
- package/dist/lib/types/schemas.d.ts.map +1 -1
- package/dist/lib/types/schemas.js +3 -1
- package/dist/lib/types/schemas.js.map +1 -1
- package/dist/local-api/collection-api.d.ts.map +1 -1
- package/dist/local-api/collection-api.js +7 -0
- package/dist/schema-utils/validator.d.ts.map +1 -1
- package/dist/schema-utils/validator.js +5 -1
- package/dist/server/api/routes/assets-by-id.d.ts.map +1 -1
- package/dist/server/api/routes/assets-by-id.js +10 -2
- package/dist/server/api/routes/assets-references.d.ts.map +1 -1
- package/dist/server/api/routes/assets-references.js +6 -4
- package/dist/types/schemas.d.ts +27 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +3 -1
- package/package.json +6 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { mount, unmount } from 'svelte';
|
|
2
|
+
import PortableTextObjectView from './PortableTextObjectView.svelte';
|
|
3
|
+
import PortableTextImageView from './PortableTextImageView.svelte';
|
|
4
|
+
export function SvelteNodeViewRenderer(onEdit, onDelete) {
|
|
5
|
+
return (props) => {
|
|
6
|
+
const wrapper = document.createElement('div');
|
|
7
|
+
wrapper.setAttribute('data-portable-text-object', '');
|
|
8
|
+
wrapper.setAttribute('data-node-view-wrapper', '');
|
|
9
|
+
wrapper.contentEditable = 'false';
|
|
10
|
+
let nodeAttrs = props.node.attrs;
|
|
11
|
+
function getViewComponent() {
|
|
12
|
+
return nodeAttrs._type === 'image' ? PortableTextImageView : PortableTextObjectView;
|
|
13
|
+
}
|
|
14
|
+
function mountView() {
|
|
15
|
+
return mount(getViewComponent(), {
|
|
16
|
+
target: wrapper,
|
|
17
|
+
props: {
|
|
18
|
+
type: nodeAttrs._type,
|
|
19
|
+
nodeKey: nodeAttrs._key,
|
|
20
|
+
data: nodeAttrs.data,
|
|
21
|
+
selected: false,
|
|
22
|
+
onEdit: () => {
|
|
23
|
+
onEdit({
|
|
24
|
+
_type: nodeAttrs._type,
|
|
25
|
+
_key: nodeAttrs._key,
|
|
26
|
+
data: nodeAttrs.data
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
onDelete: () => {
|
|
30
|
+
onDelete(nodeAttrs._key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
let currentComponent = mountView();
|
|
36
|
+
return {
|
|
37
|
+
dom: wrapper,
|
|
38
|
+
update(node) {
|
|
39
|
+
if (node.type.name !== 'portableTextObject')
|
|
40
|
+
return false;
|
|
41
|
+
nodeAttrs = node.attrs;
|
|
42
|
+
unmount(currentComponent);
|
|
43
|
+
currentComponent = mountView();
|
|
44
|
+
return true;
|
|
45
|
+
},
|
|
46
|
+
selectNode() {
|
|
47
|
+
wrapper.classList.add('ProseMirror-selectednode');
|
|
48
|
+
},
|
|
49
|
+
deselectNode() {
|
|
50
|
+
wrapper.classList.remove('ProseMirror-selectednode');
|
|
51
|
+
},
|
|
52
|
+
destroy() {
|
|
53
|
+
unmount(currentComponent);
|
|
54
|
+
},
|
|
55
|
+
stopEvent() {
|
|
56
|
+
return true;
|
|
57
|
+
},
|
|
58
|
+
ignoreMutation() {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -65,7 +65,7 @@ export interface DocumentAdapter {
|
|
|
65
65
|
* @param assetId - The asset ID to search for
|
|
66
66
|
* @returns Array of referencing documents (id, type, status, title)
|
|
67
67
|
*/
|
|
68
|
-
findDocumentsReferencingAsset?(organizationId: string, assetId: string): Promise<Array<{
|
|
68
|
+
findDocumentsReferencingAsset?(organizationId: string, assetId: string, knownTypes?: string[]): Promise<Array<{
|
|
69
69
|
documentId: string;
|
|
70
70
|
type: string;
|
|
71
71
|
title: string;
|
|
@@ -75,9 +75,15 @@ export interface DocumentAdapter {
|
|
|
75
75
|
* Count document references for multiple asset IDs in batch
|
|
76
76
|
* @param organizationId - Organization ID for multi-tenancy
|
|
77
77
|
* @param assetIds - Array of asset IDs to count references for
|
|
78
|
+
* @param knownTypes - Only count references from these document types (excludes orphaned types)
|
|
78
79
|
* @returns Map of asset ID to reference count
|
|
79
80
|
*/
|
|
80
|
-
countDocumentReferencesForAssets?(organizationId: string, assetIds: string[]): Promise<Record<string, number>>;
|
|
81
|
+
countDocumentReferencesForAssets?(organizationId: string, assetIds: string[], knownTypes?: string[]): Promise<Record<string, number>>;
|
|
82
|
+
/**
|
|
83
|
+
* Clear references to a deleted asset from publishedData of non-published
|
|
84
|
+
* documents. Returns the number of documents cleaned.
|
|
85
|
+
*/
|
|
86
|
+
clearAssetFromPublishedData?(organizationId: string, assetId: string): Promise<number>;
|
|
81
87
|
createDocumentVersion?(data: {
|
|
82
88
|
documentId: string;
|
|
83
89
|
organizationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/lib/db/interfaces/document.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,E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nB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/B,IAAI,EAAE,GAAG,CAAC;QACV,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAEpC,oBAAoB,CAAC,CACpB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC,kBAAkB,CAAC,CAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACnB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAEnC,sBAAsB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/lib/graphql/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,kBAAkB,CAAC;AA4H1D,wBAAgB,eAAe,CAC9B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,UAAU,EAAE,EACzB,kBAAkB,GAAE,OAAO,GAAG,WAAyB,
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/lib/graphql/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,kBAAkB,CAAC;AA4H1D,wBAAgB,eAAe,CAC9B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,UAAU,EAAE,EACzB,kBAAkB,GAAE,OAAO,GAAG,WAAyB,uBA2tBvD"}
|
|
@@ -253,23 +253,25 @@ export function createResolvers(cms, schemaTypes, defaultPerspective = 'publishe
|
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
generateReferenceFieldResolvers();
|
|
256
|
-
// Generate union type resolvers for array fields
|
|
256
|
+
// Generate union type resolvers for array fields — must match the logic in
|
|
257
|
+
// schema.ts which only emits a union when 2+ types exist in schemaTypes.
|
|
257
258
|
function generateUnionResolvers() {
|
|
258
259
|
schemaTypes.forEach((schemaType) => {
|
|
259
260
|
function processFields(fields, parentName) {
|
|
260
261
|
fields.forEach((field) => {
|
|
261
262
|
if (field.type === 'array' && field.of && field.of.length > 1) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
const validTypes = field.of.filter((item) => schemaTypes.find((s) => s.name === item.type));
|
|
264
|
+
if (validTypes.length > 1) {
|
|
265
|
+
const unionName = `${capitalizeFirst(parentName)}${capitalizeFirst(field.name)}Item`;
|
|
266
|
+
resolvers[unionName] = {
|
|
267
|
+
__resolveType(obj) {
|
|
268
|
+
if (obj._type) {
|
|
269
|
+
return capitalizeFirst(obj._type);
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
269
272
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
};
|
|
273
|
+
};
|
|
274
|
+
}
|
|
273
275
|
}
|
|
274
276
|
// Handle nested objects
|
|
275
277
|
if (field.type === 'object' && field.fields) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/graphql/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkD,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/graphql/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkD,MAAM,kBAAkB,CAAC;AA0YnG,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CA2FvE"}
|
package/dist/graphql/schema.js
CHANGED
|
@@ -32,7 +32,11 @@ function getGraphQLType(field, schemaTypes, parentName = '') {
|
|
|
32
32
|
}
|
|
33
33
|
function handleArrayField(field, schemaTypes, parentName = '') {
|
|
34
34
|
if (!field.of || field.of.length === 0) {
|
|
35
|
-
return '[
|
|
35
|
+
return '[JSON]';
|
|
36
|
+
}
|
|
37
|
+
// Portable Text (block content) — always JSON
|
|
38
|
+
if (field.of.some((item) => item.type === 'block')) {
|
|
39
|
+
return '[JSON]';
|
|
36
40
|
}
|
|
37
41
|
// Reference array items: resolve via `to` targets
|
|
38
42
|
const refItems = field.of.filter((item) => item.type === 'reference');
|
|
@@ -42,12 +46,12 @@ function handleArrayField(field, schemaTypes, parentName = '') {
|
|
|
42
46
|
if (to && to.length === 1) {
|
|
43
47
|
return `[${capitalizeFirst(to[0].type)}]`;
|
|
44
48
|
}
|
|
45
|
-
return '[
|
|
49
|
+
return '[JSON]';
|
|
46
50
|
}
|
|
47
51
|
// Check if all referenced types exist in schemaTypes
|
|
48
52
|
const validTypes = field.of.filter((item) => schemaTypes.find((s) => s.name === item.type));
|
|
49
53
|
if (validTypes.length === 0) {
|
|
50
|
-
return '[
|
|
54
|
+
return '[JSON]';
|
|
51
55
|
}
|
|
52
56
|
// If array contains only one type
|
|
53
57
|
if (validTypes.length === 1) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface CustomAnnotationOptions {
|
|
3
|
+
annotationType: string;
|
|
4
|
+
onEdit: (attrs: Record<string, unknown>) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createAnnotationMark(name: string): Mark<CustomAnnotationOptions, any>;
|
|
7
|
+
//# sourceMappingURL=custom-annotation-mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-annotation-mark.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/custom-annotation-mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACjD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,sCAmChD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Mark, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
export function createAnnotationMark(name) {
|
|
3
|
+
return Mark.create({
|
|
4
|
+
name: `annotation_${name}`,
|
|
5
|
+
inclusive: false,
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
annotationType: name,
|
|
9
|
+
onEdit: () => { }
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
addAttributes() {
|
|
13
|
+
return {
|
|
14
|
+
_key: { default: null },
|
|
15
|
+
data: { default: {} }
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{ tag: `span[data-annotation="${name}"]` }];
|
|
20
|
+
},
|
|
21
|
+
renderHTML({ HTMLAttributes }) {
|
|
22
|
+
return [
|
|
23
|
+
'span',
|
|
24
|
+
mergeAttributes(HTMLAttributes, {
|
|
25
|
+
'data-annotation': name,
|
|
26
|
+
class: 'richtext-annotation',
|
|
27
|
+
style: 'border-bottom: 2px dashed currentColor; cursor: pointer;'
|
|
28
|
+
}),
|
|
29
|
+
0
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=custom-annotation-mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-annotation-mark.js","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/custom-annotation-mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAOrD,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAChD,OAAO,IAAI,CAAC,MAAM,CAA0B;QAC3C,IAAI,EAAE,cAAc,IAAI,EAAE;QAC1B,SAAS,EAAE,KAAK;QAEhB,UAAU;YACT,OAAO;gBACN,cAAc,EAAE,IAAI;gBACpB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;aAChB,CAAC;QACH,CAAC;QAED,aAAa;YACZ,OAAO;gBACN,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACvB,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aACrB,CAAC;QACH,CAAC;QAED,SAAS;YACR,OAAO,CAAC,EAAE,GAAG,EAAE,yBAAyB,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,UAAU,CAAC,EAAE,cAAc,EAAE;YAC5B,OAAO;gBACN,MAAM;gBACN,eAAe,CAAC,cAAc,EAAE;oBAC/B,iBAAiB,EAAE,IAAI;oBACvB,KAAK,EAAE,qBAAqB;oBAC5B,KAAK,EAAE,0DAA0D;iBACjE,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface PortableTextInlineObjectOptions {
|
|
3
|
+
onEdit: (attrs: {
|
|
4
|
+
_type: string;
|
|
5
|
+
_key: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
}) => void;
|
|
8
|
+
onDelete: (key: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const PortableTextInlineObject: Node<PortableTextInlineObjectOptions, any>;
|
|
11
|
+
//# sourceMappingURL=portable-text-inline-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-text-inline-object.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/portable-text-inline-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAGrD,MAAM,WAAW,+BAA+B;IAC/C,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IACxF,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,wBAAwB,4CAiCnC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
import { SvelteInlineNodeViewRenderer } from './svelte-inline-node-view.js';
|
|
3
|
+
export const PortableTextInlineObject = Node.create({
|
|
4
|
+
name: 'portableTextInlineObject',
|
|
5
|
+
group: 'inline',
|
|
6
|
+
inline: true,
|
|
7
|
+
atom: true,
|
|
8
|
+
selectable: true,
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
onEdit: () => { },
|
|
12
|
+
onDelete: () => { }
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
addAttributes() {
|
|
16
|
+
return {
|
|
17
|
+
_type: { default: null },
|
|
18
|
+
_key: { default: null },
|
|
19
|
+
data: { default: {} }
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
parseHTML() {
|
|
23
|
+
return [{ tag: 'span[data-portable-text-inline]' }];
|
|
24
|
+
},
|
|
25
|
+
renderHTML({ HTMLAttributes }) {
|
|
26
|
+
return ['span', mergeAttributes(HTMLAttributes, { 'data-portable-text-inline': '' }), 0];
|
|
27
|
+
},
|
|
28
|
+
addNodeView() {
|
|
29
|
+
return SvelteInlineNodeViewRenderer(this.options.onEdit, this.options.onDelete);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=portable-text-inline-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-text-inline-object.js","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/portable-text-inline-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAOzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAAkC;IACpF,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,IAAI;IAEhB,UAAU;QACT,OAAO;YACN,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;YAChB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;SAClB,CAAC;IACH,CAAC;IAED,aAAa;QACZ,OAAO;YACN,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACxB,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;SACrB,CAAC;IACH,CAAC;IAED,SAAS;QACR,OAAO,CAAC,EAAE,GAAG,EAAE,iCAAiC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC5B,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,cAAc,EAAE,EAAE,2BAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC;IAED,WAAW;QACV,OAAO,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjF,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface PortableTextObjectOptions {
|
|
3
|
+
onEdit: (attrs: {
|
|
4
|
+
_type: string;
|
|
5
|
+
_key: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
}) => void;
|
|
8
|
+
onDelete: (key: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const PortableTextObject: Node<PortableTextObjectOptions, any>;
|
|
11
|
+
//# sourceMappingURL=portable-text-object-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-text-object-node.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/portable-text-object-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAGrD,MAAM,WAAW,yBAAyB;IACzC,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IACxF,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,sCAiC7B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
import { SvelteNodeViewRenderer } from './svelte-node-view.js';
|
|
3
|
+
export const PortableTextObject = Node.create({
|
|
4
|
+
name: 'portableTextObject',
|
|
5
|
+
group: 'block',
|
|
6
|
+
atom: true,
|
|
7
|
+
draggable: true,
|
|
8
|
+
selectable: true,
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
onEdit: () => { },
|
|
12
|
+
onDelete: () => { }
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
addAttributes() {
|
|
16
|
+
return {
|
|
17
|
+
_type: { default: null },
|
|
18
|
+
_key: { default: null },
|
|
19
|
+
data: { default: {} }
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
parseHTML() {
|
|
23
|
+
return [{ tag: 'div[data-portable-text-object]' }];
|
|
24
|
+
},
|
|
25
|
+
renderHTML({ HTMLAttributes }) {
|
|
26
|
+
return ['div', mergeAttributes(HTMLAttributes, { 'data-portable-text-object': '' }), 0];
|
|
27
|
+
},
|
|
28
|
+
addNodeView() {
|
|
29
|
+
return SvelteNodeViewRenderer(this.options.onEdit, this.options.onDelete);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=portable-text-object-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-text-object-node.js","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/portable-text-object-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAO5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAA4B;IACxE,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAEhB,UAAU;QACT,OAAO;YACN,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;YAChB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;SAClB,CAAC;IACH,CAAC;IAED,aAAa;QACZ,OAAO;YACN,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACxB,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;SACrB,CAAC;IACH,CAAC;IAED,SAAS;QACR,OAAO,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC5B,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,cAAc,EAAE,EAAE,2BAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,WAAW;QACV,OAAO,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/core';
|
|
2
|
+
interface PortableTextSpan {
|
|
3
|
+
_type: 'span';
|
|
4
|
+
_key: string;
|
|
5
|
+
text: string;
|
|
6
|
+
marks?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface PortableTextInlineObject {
|
|
9
|
+
_type: string;
|
|
10
|
+
_key: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export type PortableTextChild = PortableTextSpan | PortableTextInlineObject;
|
|
14
|
+
interface PortableTextMarkDefinition {
|
|
15
|
+
_type: string;
|
|
16
|
+
_key: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
interface PortableTextBlock {
|
|
20
|
+
_type: 'block';
|
|
21
|
+
_key: string;
|
|
22
|
+
style?: string;
|
|
23
|
+
children: PortableTextChild[];
|
|
24
|
+
markDefs?: PortableTextMarkDefinition[];
|
|
25
|
+
listItem?: string;
|
|
26
|
+
level?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface PortableTextCustomBlock {
|
|
29
|
+
_type: string;
|
|
30
|
+
_key: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export type PortableTextNode = PortableTextBlock | PortableTextCustomBlock;
|
|
34
|
+
export type PortableTextValue = PortableTextNode[];
|
|
35
|
+
export declare function tiptapToPortableText(doc: JSONContent): PortableTextValue;
|
|
36
|
+
export declare function portableTextToTiptap(value: PortableTextValue): JSONContent;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=portable-text-serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-text-serializer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/admin/fields/richtext/portable-text-serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,UAAU,gBAAgB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,wBAAwB,CAAC;AAE5E,UAAU,0BAA0B;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,UAAU,iBAAiB;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,0BAA0B,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM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