rimecms 0.27.4 → 0.27.5
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/fields/rich-text/core/features/fields/extension.d.ts +1 -1
- package/dist/fields/rich-text/core/features/fields/extension.js +1 -1
- package/dist/fields/rich-text/core/features/fields/index.js +2 -2
- package/dist/fields/rich-text/core/features/resource/index.js +2 -2
- package/dist/fields/rich-text/core/features/upload/index.js +2 -2
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Node, mergeAttributes } from '@tiptap/core';
|
|
|
2
2
|
import SvelteNodeViewRenderer from '../../svelte/node-view-renderer.svelte';
|
|
3
3
|
import FieldsComponent from './fields.svelte';
|
|
4
4
|
export const FieldsExtension = Node.create({
|
|
5
|
-
name: '
|
|
5
|
+
name: 'rich-text-fields',
|
|
6
6
|
group: 'block',
|
|
7
7
|
atom: true,
|
|
8
8
|
draggable: true,
|
|
@@ -3,14 +3,14 @@ import { FieldsExtension } from './extension.js';
|
|
|
3
3
|
const fieldsFeatureNode = (args) => ({
|
|
4
4
|
label: args.label || args.name,
|
|
5
5
|
icon: SheetIcon,
|
|
6
|
-
isActive: ({ editor }) => editor.isActive('
|
|
6
|
+
isActive: ({ editor }) => editor.isActive('rich-text-fields-' + args.name),
|
|
7
7
|
suggestion: {
|
|
8
8
|
command: ({ editor }) => editor.chain().focus().insertSheet().run()
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
export const FieldsFeature = (args) => ({
|
|
12
12
|
extension: FieldsExtension.configure({ fields: args.fields, preview: args.preview }).extend({
|
|
13
|
-
name: '
|
|
13
|
+
name: 'rich-text-fields-' + args.name
|
|
14
14
|
}),
|
|
15
15
|
nodes: [fieldsFeatureNode(args)]
|
|
16
16
|
});
|
|
@@ -4,13 +4,13 @@ export const ResourceFeature = (args) => {
|
|
|
4
4
|
const slug = args.source.split('?')[0];
|
|
5
5
|
return {
|
|
6
6
|
extension: Resource.configure(args).extend({
|
|
7
|
-
name: '
|
|
7
|
+
name: 'rich-text-resource-' + slug
|
|
8
8
|
}),
|
|
9
9
|
nodes: [
|
|
10
10
|
{
|
|
11
11
|
label: args.label || slug,
|
|
12
12
|
icon: Images,
|
|
13
|
-
isActive: ({ editor }) => editor.isActive('
|
|
13
|
+
isActive: ({ editor }) => editor.isActive('rich-text-resource-' + slug),
|
|
14
14
|
suggestion: {
|
|
15
15
|
command: ({ editor }) => editor.chain().focus().insertResource().run()
|
|
16
16
|
}
|
|
@@ -3,12 +3,12 @@ import { Upload } from './upload-extension.js';
|
|
|
3
3
|
export const UploadFeature = (args) => {
|
|
4
4
|
const slug = args.source.split('?')[0];
|
|
5
5
|
return {
|
|
6
|
-
extension: Upload.configure(args).extend({ name: '
|
|
6
|
+
extension: Upload.configure(args).extend({ name: 'rich-text-upload-' + slug }),
|
|
7
7
|
nodes: [
|
|
8
8
|
{
|
|
9
9
|
label: 'Media',
|
|
10
10
|
icon: Images,
|
|
11
|
-
isActive: ({ editor }) => editor.isActive('
|
|
11
|
+
isActive: ({ editor }) => editor.isActive('rich-text-upload-' + slug),
|
|
12
12
|
suggestion: {
|
|
13
13
|
command: ({ editor }) => editor.chain().focus().insertUpload().run()
|
|
14
14
|
}
|
|
@@ -27,10 +27,10 @@ export const Upload = Node.create({
|
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
29
|
parseHTML() {
|
|
30
|
-
return [{ tag: '
|
|
30
|
+
return [{ tag: 'rich-text-media' }];
|
|
31
31
|
},
|
|
32
32
|
renderHTML({ HTMLAttributes }) {
|
|
33
|
-
return ['
|
|
33
|
+
return ['rich-text-media', mergeAttributes(HTMLAttributes)];
|
|
34
34
|
},
|
|
35
35
|
addNodeView() {
|
|
36
36
|
return SvelteNodeViewRenderer(CounterComponent);
|