aloha-vue 1.2.63 → 1.2.65

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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.2.63",
17
+ "version": "1.2.65",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -0,0 +1,20 @@
1
+ import {
2
+ ref,
3
+ } from "vue";
4
+
5
+ export const tinymcePluginOptions = ref({
6
+ propsDefault: {
7
+ validElements: "a[href|target=_blank],strong/b,div,br,p,span,ul,ol,li,table,thead,tbody,th,tr,td",
8
+ },
9
+ });
10
+
11
+ export default {
12
+ install: (app, {
13
+ propsDefault = {},
14
+ } = {}) => {
15
+ tinymcePluginOptions.value.propsDefault = {
16
+ ...tinymcePluginOptions.value.propsDefault,
17
+ ...propsDefault,
18
+ };
19
+ },
20
+ };
@@ -346,9 +346,9 @@
346
346
  position: relative;
347
347
  display: flex;
348
348
  flex-direction: column;
349
- height: calc(100% - var(--a_menu_2_navbar_top_height));
349
+ height: calc(100% - var(--a_menu_2_navbar_top_height) - var(--a_menu_2_navbar_top_margin_bottom));
350
350
  .a_vertical_scroll {
351
- height: calc(100% - var(--a_menu_2_breadcrumb_min_height) + 20px - var(--a_menu_2_navbar_top_margin_bottom));
351
+ height: calc(100% - var(--a_menu_2_breadcrumb_min_height) + 20px);
352
352
  margin-top: -20px;
353
353
  &:not(.a_vertical_scroll_scrollable) {
354
354
  padding-bottom: 0;
@@ -523,10 +523,10 @@
523
523
  }
524
524
  .a_menu_2__breadcrumb__ul {
525
525
  list-style: none;
526
- margin: 0;
527
526
  display: block;
528
527
  width: 100%;
529
- padding: 0.5rem;
528
+ margin: 0.5rem;
529
+ padding: 0;
530
530
  }
531
531
  .a_menu_2__breadcrumb__ul_truncated {
532
532
  white-space: nowrap;
@@ -15,6 +15,10 @@ import ATinymceAPI from "./compositionAPI/ATinymceAPI";
15
15
  import UiAPI from "../compositionApi/UiAPI";
16
16
  import UiStyleHideAPI from "../compositionApi/UiStyleHideAPI";
17
17
 
18
+ import {
19
+ tinymcePluginOptions,
20
+ } from "../../plugins/ATinymcePlugin";
21
+
18
22
  export default {
19
23
  name: "ATinymce",
20
24
  mixins: [
@@ -26,6 +30,11 @@ export default {
26
30
  required: false,
27
31
  default: true,
28
32
  },
33
+ contentCustomStyle: {
34
+ type: String,
35
+ required: false,
36
+ default: undefined,
37
+ },
29
38
  contentLangs: {
30
39
  type: Array,
31
40
  required: false,
@@ -96,6 +105,11 @@ export default {
96
105
  required: false,
97
106
  default: "tinymce",
98
107
  },
108
+ validElements: {
109
+ type: String,
110
+ required: false,
111
+ default: () => tinymcePluginOptions.value.propsDefault.validElements,
112
+ },
99
113
  },
100
114
  setup(props, context) {
101
115
  const {
@@ -45,20 +45,26 @@ export default function ATinymceAPI(props, context, {
45
45
  htmlIdLocal = computed(() => ""),
46
46
  }) {
47
47
  const branding = toRef(props, "branding");
48
+ const contentCustomStyle = toRef(props, "contentCustomStyle");
48
49
  const contentLangs = toRef(props, "contentLangs");
49
50
  const disabled = toRef(props, "disabled");
50
51
  const languageDefault = toRef(props, "languageDefault");
51
52
  const menu = toRef(props, "menu");
52
53
  const menubar = toRef(props, "menubar");
54
+ const modelValue = toRef(props, "modelValue");
53
55
  const plugins = toRef(props, "plugins");
54
56
  const promotion = toRef(props, "promotion");
55
57
  const toolbar = toRef(props, "toolbar");
56
58
  const toolbarMode = toRef(props, "toolbarMode");
57
- const modelValue = toRef(props, "modelValue");
59
+ const validElements = toRef(props, "validElements");
58
60
 
59
61
  let vueEditor = null;
60
62
  let modelValueLocal = undefined;
61
63
 
64
+ const contentStyle = computed(() => {
65
+ return `${ contentUiSkinCss.toString() }\n${ contentCss.toString() }\n${ contentCustomStyle.value ? contentCustomStyle.value : "" }`;
66
+ });
67
+
62
68
  const changeModelLocal = ({ model }) => {
63
69
  modelValueLocal = model;
64
70
  changeModel({ model });
@@ -74,7 +80,7 @@ export default function ATinymceAPI(props, context, {
74
80
  skin: false,
75
81
  content_css: false,
76
82
  entity_encoding: "raw",
77
- content_style: `${ contentUiSkinCss.toString() }\n${ contentCss.toString() }`,
83
+ content_style: contentStyle.value,
78
84
  branding: branding.value,
79
85
  promotion: promotion.value,
80
86
  language: languageDefault.value,
@@ -82,6 +88,7 @@ export default function ATinymceAPI(props, context, {
82
88
  menu: menu.value,
83
89
  menubar: menubar.value,
84
90
  readonly: !!disabled.value,
91
+ valid_elements: validElements.value,
85
92
  setup: editor => {
86
93
  vueEditor = editor;
87
94
  editor.on("change input undo redo", () => {