@mapomodule/uikit 1.0.0-alpha.11 → 1.0.0-alpha.12
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/CHANGELOG.md +17 -0
- package/components/Detail/Detail.vue +15 -12
- package/components/fields/wygEditor/defaults.js +5 -3
- package/components/fields/wygEditor/utils/mapomedia.plugin.js +7 -6
- package/components/fields/wygEditor/wygEditor.vue +3 -0
- package/defaults.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.12](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-02-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **detail:** load v-model at mount time ([ad37268](https://github.com/lotrekagency/mapo/commit/ad3726832db1c7ae9e32c95fdeaf6d55b95224f0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* added mapomedia to context menu and menubar replacing default image tool ([bb899d8](https://github.com/lotrekagency/mapo/commit/bb899d80c2f5835f1fb98fa9a0b3e3092b82951f))
|
|
17
|
+
* changed default primary color ([37c3599](https://github.com/lotrekagency/mapo/commit/37c35995cdf033a5bcbf0a0acf71e9efadf69995))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [1.0.0-alpha.11](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-02-12)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -417,6 +417,9 @@ export default {
|
|
|
417
417
|
this.model = res;
|
|
418
418
|
this.initLang();
|
|
419
419
|
});
|
|
420
|
+
} else if (this.value) {
|
|
421
|
+
this.model = this.value;
|
|
422
|
+
this.initLang();
|
|
420
423
|
}
|
|
421
424
|
}
|
|
422
425
|
};
|
|
@@ -426,7 +429,7 @@ export default {
|
|
|
426
429
|
|
|
427
430
|
## DetailConfiguration
|
|
428
431
|
|
|
429
|
-
The DetailConfiguration determines the behavior of the main form and is an `Array` of [`FieldConfiguration`](#fieldconfiguration).
|
|
432
|
+
The DetailConfiguration determines the behavior of the main form and is an `Array` of [`FieldConfiguration`](#fieldconfiguration).
|
|
430
433
|
Each field configuration represents a field of the form.
|
|
431
434
|
The configuration can also consist of an object with two keys `{ main sidenav }`.
|
|
432
435
|
Each key is an `Array` of [`FieldConfiguration`](#fieldconfiguration) and will modify a different part of the component:
|
|
@@ -436,7 +439,7 @@ Each key is an `Array` of [`FieldConfiguration`](#fieldconfiguration) and will m
|
|
|
436
439
|
|
|
437
440
|
### FieldConfiguration
|
|
438
441
|
|
|
439
|
-
The `FieldConfiguration` is a `String` containing the dottedPath of a value inside the payload we want to modify.
|
|
442
|
+
The `FieldConfiguration` is a `String` containing the dottedPath of a value inside the payload we want to modify.
|
|
440
443
|
So, for example, if we have the payload: `{ image: { name: "...", url: "..." } }` we can modify the image name using the dottedPath `"image.name"`.
|
|
441
444
|
|
|
442
445
|
The default component used to render a field of a form is a [`v-text-field`](https://vuetifyjs.com/en/components/text-fields/).
|
|
@@ -444,12 +447,12 @@ If you want more control over the generated component you can use an `Object` wi
|
|
|
444
447
|
|
|
445
448
|
|Name|Description|Type|Required|Default|
|
|
446
449
|
|---|---|---|---|---|
|
|
447
|
-
|value|The dottedPath of the value we want to modify.|`String`|`true`|-|
|
|
448
|
-
|synci18n|Determines if the field is translatable or not. If set to true the value will remain the same in all translations (untranslatable).|`Boolean`|`false`|`false`|
|
|
449
|
-
|type|Type of the field. This determines which component will be rendered. The list of possible choices can be found [here](#field-types) |`String`|`false`|`text`|
|
|
450
|
-
|accessor|[`Accessor`](#accessor) object to specify the setter and the getter of the field.|`Object`|`false`|`{set: x=>x, get: x=>x}`|
|
|
451
|
-
|attrs|The attributes that will be passed to the component.|`Object`|`false`|-|
|
|
452
|
-
|is|The component to be rendered in the form. This has a higher priority than the "type" attribute. Here you can pass in any regitered Vue component instance or name. [Learn more](https://vuejs.org/v2/guide/components.html#Dynamic-Components).|`String | VueComponent`|`false`|-|
|
|
450
|
+
|value|The dottedPath of the value we want to modify.|`String`|`true`|-|
|
|
451
|
+
|synci18n|Determines if the field is translatable or not. If set to true the value will remain the same in all translations (untranslatable).|`Boolean`|`false`|`false`|
|
|
452
|
+
|type|Type of the field. This determines which component will be rendered. The list of possible choices can be found [here](#field-types) |`String`|`false`|`text`|
|
|
453
|
+
|accessor|[`Accessor`](#accessor) object to specify the setter and the getter of the field.|`Object`|`false`|`{set: x=>x, get: x=>x}`|
|
|
454
|
+
|attrs|The attributes that will be passed to the component.|`Object`|`false`|-|
|
|
455
|
+
|is|The component to be rendered in the form. This has a higher priority than the "type" attribute. Here you can pass in any regitered Vue component instance or name. [Learn more](https://vuejs.org/v2/guide/components.html#Dynamic-Components).|`String | VueComponent`|`false`|-|
|
|
453
456
|
|
|
454
457
|
#### Accessor
|
|
455
458
|
|
|
@@ -459,7 +462,7 @@ Each function must return the processed value.
|
|
|
459
462
|
|
|
460
463
|
#### Field types
|
|
461
464
|
|
|
462
|
-
Here the list of the FieldConfiguration type association.
|
|
465
|
+
Here the list of the FieldConfiguration type association.
|
|
463
466
|
|
|
464
467
|
- `text` ==> [v-text-field](https://vuetifyjs.com/en/components/text-fields/),
|
|
465
468
|
- `select` ==> [v-select](https://vuetifyjs.com/en/components/selects/),
|
|
@@ -490,8 +493,8 @@ Here the list of the FieldConfiguration type association.
|
|
|
490
493
|
|
|
491
494
|
### FieldGroup
|
|
492
495
|
|
|
493
|
-
You can use this mixed with `FieldConfiguration` to group multiple fields in one card with a title and an icon.
|
|
494
|
-
The `FieldGroup` has the key group that is a string repreenting the name of the group and the key fields that is an `Array` of [`FieldConfiguration`](#fieldconfiguration).
|
|
496
|
+
You can use this mixed with `FieldConfiguration` to group multiple fields in one card with a title and an icon.
|
|
497
|
+
The `FieldGroup` has the key group that is a string repreenting the name of the group and the key fields that is an `Array` of [`FieldConfiguration`](#fieldconfiguration).
|
|
495
498
|
The group key can also be an `Object`. In that case it contains the name and the icon for the group `{name: "...", icon: "..."}`. For a list of all available icons, visit the official [Material Design Icons](https://materialdesignicons.com/) page.
|
|
496
499
|
|
|
497
500
|
<br><br>
|
|
@@ -572,4 +575,4 @@ export default {
|
|
|
572
575
|
|
|
573
576
|
|
|
574
577
|
|
|
575
|
-
</docs>
|
|
578
|
+
</docs>
|
|
@@ -4,7 +4,8 @@ export default {
|
|
|
4
4
|
plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons',
|
|
5
5
|
// imagetools_cors_hosts: ['picsum.photos'],
|
|
6
6
|
menubar: 'file edit view insert format tools table help',
|
|
7
|
-
|
|
7
|
+
menu: { insert: { title: 'Insert', items: 'link mapomedia media template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime' } },
|
|
8
|
+
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview | mapomedia media template link anchor codesample | ltr rtl',
|
|
8
9
|
toolbar_sticky: true,
|
|
9
10
|
image_advtab: true,
|
|
10
11
|
// link_list: [
|
|
@@ -45,10 +46,11 @@ export default {
|
|
|
45
46
|
template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
|
|
46
47
|
height: 400,
|
|
47
48
|
image_caption: true,
|
|
48
|
-
|
|
49
|
+
quickbars_insert_toolbar: 'mapomedia quicktable',
|
|
50
|
+
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote mapomedia quicktable',
|
|
49
51
|
noneditable_noneditable_class: 'mceNonEditable',
|
|
50
52
|
toolbar_mode: 'sliding',
|
|
51
|
-
contextmenu: 'link
|
|
53
|
+
contextmenu: 'link mapomedia imagetools table',
|
|
52
54
|
skin: useDarkMode ? 'oxide-dark' : 'oxide',
|
|
53
55
|
content_css: useDarkMode ? 'dark' : 'default',
|
|
54
56
|
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
export default function (callback) {
|
|
2
2
|
const pluginmanager = window.tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const pluginname = "mapomedia"
|
|
4
|
+
pluginmanager.add(pluginname, function (editor, url) {
|
|
5
|
+
const conf = {
|
|
5
6
|
icon: 'image',
|
|
6
|
-
|
|
7
|
+
tooltip: 'Insert image/video/audio/docs',
|
|
7
8
|
onAction: () => callback().then(html => {
|
|
8
9
|
editor.focus();
|
|
9
10
|
editor.undoManager.transact(() => editor.selection.setContent(html))
|
|
10
11
|
editor.selection.setCursorLocation();
|
|
11
12
|
editor.nodeChanged();
|
|
12
13
|
}).catch(() => null)
|
|
13
|
-
}
|
|
14
|
+
}
|
|
14
15
|
editor.addCommand('mceMapoMedia', () => callback().then(html => {
|
|
15
16
|
editor.focus();
|
|
16
17
|
editor.undoManager.transact(() => editor.selection.setContent(html))
|
|
17
18
|
editor.selection.setCursorLocation();
|
|
18
19
|
editor.nodeChanged();
|
|
19
20
|
}).catch(() => null))
|
|
20
|
-
editor.ui.registry.addButton(
|
|
21
|
-
editor.ui.registry.addMenuItem(...conf);
|
|
21
|
+
editor.ui.registry.addButton(pluginname, conf);
|
|
22
|
+
editor.ui.registry.addMenuItem(pluginname, { text: "Mapo Media...", ...conf });
|
|
22
23
|
return {
|
|
23
24
|
getMetadata: function () {
|
|
24
25
|
return {
|
package/defaults.js
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
dark: true,
|
|
7
7
|
themes: {
|
|
8
8
|
dark: {
|
|
9
|
-
primary: '#
|
|
9
|
+
primary: '#51beaa',
|
|
10
10
|
accent: colors.grey.darken3,
|
|
11
11
|
secondary: colors.amber.darken3,
|
|
12
12
|
info: colors.teal.lighten1,
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
success: colors.green.accent3
|
|
16
16
|
},
|
|
17
17
|
light: {
|
|
18
|
-
primary: '#
|
|
18
|
+
primary: '#51beaa',
|
|
19
19
|
accent: colors.indigo.accent1,
|
|
20
20
|
secondary: colors.amber.accent2,
|
|
21
21
|
info: colors.teal.lighten1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt component discovery system.",
|
|
6
6
|
"author": "bnznamco <gabriele.baldi.01@gmail.com>",
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "51a40dbe669f634f9338f5eb0861550d1a554776"
|
|
17
17
|
}
|