@sme.up/ketchup 9.5.2 → 9.6.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/cjs/{f-button-357a3dff.js → f-button-623dfcc3.js} +2 -2
- package/dist/cjs/{f-cell-1de0ea69.js → f-cell-9c718d83.js} +9 -8
- package/dist/cjs/{f-checkbox-41864e53.js → f-checkbox-bfa92ebe.js} +1 -1
- package/dist/cjs/{f-chip-bd5882a0.js → f-chip-c8efad5b.js} +3 -3
- package/dist/cjs/{f-image-30531fd0.js → f-image-b61cc967.js} +2 -2
- package/dist/cjs/{f-paginator-utils-ad8a4635.js → f-paginator-utils-67dbc14c.js} +4 -4
- package/dist/cjs/{f-text-field-be758970.js → f-text-field-a09b1705.js} +2 -2
- package/dist/cjs/{index-8f2f4159.js → index-db0a6be6.js} +79 -38
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +7 -6
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +141 -112
- package/dist/cjs/kup-box.cjs.entry.js +13 -12
- package/dist/cjs/kup-calendar.cjs.entry.js +76 -11
- package/dist/cjs/kup-card-list.cjs.entry.js +5 -4
- package/dist/cjs/kup-cell.cjs.entry.js +12 -11
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +22 -16
- package/dist/cjs/kup-dashboard.cjs.entry.js +10 -9
- package/dist/cjs/{kup-dates-0e59b05d.js → kup-dates-4aa560f0.js} +80 -67
- package/dist/cjs/kup-drawer.cjs.entry.js +7 -6
- package/dist/cjs/kup-echart.cjs.entry.js +1504 -1025
- package/dist/cjs/kup-editor.cjs.entry.js +46260 -0
- package/dist/cjs/kup-family-tree.cjs.entry.js +9 -8
- package/dist/cjs/kup-gantt_10.cjs.entry.js +58 -42
- package/dist/cjs/kup-grid.cjs.entry.js +5 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +5 -4
- package/dist/cjs/kup-image-list.cjs.entry.js +13 -12
- package/dist/cjs/kup-lazy.cjs.entry.js +16 -15
- package/dist/cjs/kup-magic-box.cjs.entry.js +9 -8
- package/dist/cjs/{kup-manager-cefb1999.js → kup-manager-227c4be2.js} +121 -79
- package/dist/cjs/kup-nav-bar.cjs.entry.js +6 -5
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +7 -6
- package/dist/cjs/kup-photo-frame.cjs.entry.js +7 -6
- package/dist/cjs/{kup-planner-renderer-helper-c2394940.js → kup-planner-renderer-helper-f0c869d7.js} +1 -1
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +4 -4
- package/dist/cjs/kup-planner.cjs.entry.js +7 -6
- package/dist/cjs/kup-probe.cjs.entry.js +4 -4
- package/dist/cjs/kup-qlik.cjs.entry.js +6 -5
- package/dist/cjs/kup-snackbar.cjs.entry.js +8 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/editor-example-1.js +52 -0
- package/dist/collection/assets/editor.js +60 -0
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/kup-accordion/kup-accordion.js +10 -16
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +10 -16
- package/dist/collection/components/kup-badge/kup-badge.js +8 -12
- package/dist/collection/components/kup-box/kup-box.css +1 -1
- package/dist/collection/components/kup-box/kup-box.js +12 -14
- package/dist/collection/components/kup-button/kup-button.js +6 -10
- package/dist/collection/components/kup-button-list/kup-button-list.js +7 -11
- package/dist/collection/components/kup-calendar/kup-calendar.js +8 -12
- package/dist/collection/components/kup-card/kup-card.js +6 -10
- package/dist/collection/components/kup-card-list/kup-card-list.js +6 -10
- package/dist/collection/components/kup-cell/kup-cell.js +13 -21
- package/dist/collection/components/kup-chart/kup-chart.js +7 -11
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +7 -11
- package/dist/collection/components/kup-chip/kup-chip.js +8 -12
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +11 -17
- package/dist/collection/components/kup-combobox/kup-combobox.js +10 -16
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +7 -11
- package/dist/collection/components/kup-data-table/kup-data-table.js +72 -95
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +7 -11
- package/dist/collection/components/kup-dialog/kup-dialog.css +2 -2
- package/dist/collection/components/kup-dialog/kup-dialog.js +9 -13
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -12
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +10 -13
- package/dist/collection/components/kup-echart/kup-echart.js +7 -11
- package/dist/collection/components/kup-editor/kup-editor-declarations.js +15 -0
- package/dist/collection/components/kup-editor/kup-editor.js +774 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +14 -16
- package/dist/collection/components/kup-form/kup-form.js +14 -22
- package/dist/collection/components/kup-gauge/kup-gauge.js +6 -10
- package/dist/collection/components/kup-grid/kup-grid.js +6 -10
- package/dist/collection/components/kup-iframe/kup-iframe.js +6 -10
- package/dist/collection/components/kup-image/kup-image.js +6 -10
- package/dist/collection/components/kup-image-list/kup-image-list.js +8 -12
- package/dist/collection/components/kup-lazy/kup-lazy.js +17 -21
- package/dist/collection/components/kup-list/kup-list.js +10 -16
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +9 -13
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +7 -11
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +7 -11
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +8 -12
- package/dist/collection/components/kup-planner/kup-planner.js +13 -21
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.js +2 -2
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +2 -1
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.css +0 -2
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.js +13 -14
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +6 -4
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-header.js +7 -7
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.js +6 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.css +0 -2
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.js +2 -2
- package/dist/collection/components/kup-probe/kup-probe.js +1 -1
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +7 -11
- package/dist/collection/components/kup-qlik/kup-qlik.js +1 -1
- package/dist/collection/components/kup-radio/kup-radio.js +6 -10
- package/dist/collection/components/kup-rating/kup-rating.js +7 -11
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +7 -11
- package/dist/collection/components/kup-spinner/kup-spinner.js +40 -44
- package/dist/collection/components/kup-switch/kup-switch.js +7 -11
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +6 -10
- package/dist/collection/components/kup-text-field/kup-text-field.js +10 -13
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +10 -13
- package/dist/collection/components/kup-tree/kup-tree-faker.js +1 -1
- package/dist/collection/components/kup-tree/kup-tree.js +24 -33
- package/dist/collection/f-components/f-cell/f-cell.js +2 -1
- package/dist/collection/managers/kup-manager/kup-manager.js +5 -0
- package/dist/collection/managers/kup-openai/kup-openai.js +11 -8
- package/dist/components/custom-task-list-header.js +4 -3
- package/dist/components/custom-task-list-table.js +4 -3
- package/dist/components/kup-accordion.js +3 -2
- package/dist/components/kup-autocomplete2.js +135 -105
- package/dist/components/kup-box2.js +4 -3
- package/dist/components/kup-calendar.js +71 -6
- package/dist/components/kup-card-list.js +2 -1
- package/dist/components/kup-cell.js +3 -2
- package/dist/components/kup-dashboard.js +3 -2
- package/dist/components/kup-dates.js +81 -67
- package/dist/components/kup-drawer.js +4 -3
- package/dist/components/kup-echart2.js +1501 -1022
- package/dist/components/kup-editor.d.ts +11 -0
- package/dist/components/kup-editor.js +46434 -0
- package/dist/components/kup-family-tree.js +4 -3
- package/dist/components/kup-gantt-calendar2.js +3 -2
- package/dist/components/kup-gantt2.js +4 -2
- package/dist/components/kup-grid-renderer2.js +10 -7
- package/dist/components/kup-grid2.js +2 -1
- package/dist/components/kup-horizontal-scroll2.js +12 -12
- package/dist/components/kup-iframe.js +2 -1
- package/dist/components/kup-image-list.js +4 -3
- package/dist/components/kup-lazy.js +13 -12
- package/dist/components/kup-magic-box.js +5 -4
- package/dist/components/kup-manager.js +121 -79
- package/dist/components/kup-nav-bar.js +3 -2
- package/dist/components/kup-numeric-picker.js +3 -2
- package/dist/components/kup-photo-frame.js +4 -3
- package/dist/components/kup-planner-renderer-helper.js +2 -2
- package/dist/components/kup-planner-renderer2.js +3 -3
- package/dist/components/kup-planner.js +4 -3
- package/dist/components/kup-probe.js +1 -1
- package/dist/components/kup-qlik.js +3 -2
- package/dist/components/kup-snackbar.js +3 -2
- package/dist/components/kup-standard-tooltip2.js +3 -2
- package/dist/components/kup-switcher2.js +3 -2
- package/dist/components/kup-task-gantt2.js +6 -4
- package/dist/components/kup-task-list-header2.js +9 -8
- package/dist/components/kup-task-list-table2.js +3 -2
- package/dist/components/kup-task-list2.js +9 -3
- package/dist/components/kup-tooltip2.js +3 -2
- package/dist/components/kup-vertical-scroll2.js +5 -4
- package/dist/esm/{f-button-856a189a.js → f-button-121958b3.js} +2 -2
- package/dist/esm/{f-cell-6324d838.js → f-cell-959b83db.js} +9 -8
- package/dist/esm/{f-checkbox-43481de2.js → f-checkbox-fdf27ce9.js} +1 -1
- package/dist/esm/{f-chip-e15fba8a.js → f-chip-915ddf53.js} +3 -3
- package/dist/esm/{f-image-26b1bc14.js → f-image-98371dac.js} +2 -2
- package/dist/esm/{f-paginator-utils-e8f62783.js → f-paginator-utils-f5f4c666.js} +4 -4
- package/dist/esm/{f-text-field-bbe1f236.js → f-text-field-0df308e4.js} +2 -2
- package/dist/esm/{index-59f83f91.js → index-bbef9f2a.js} +79 -38
- package/dist/esm/index.js +3 -3
- package/dist/esm/ketchup.js +4 -4
- package/dist/esm/kup-accordion.entry.js +7 -6
- package/dist/esm/kup-autocomplete_27.entry.js +141 -112
- package/dist/esm/kup-box.entry.js +13 -12
- package/dist/esm/kup-calendar.entry.js +76 -11
- package/dist/esm/kup-card-list.entry.js +5 -4
- package/dist/esm/kup-cell.entry.js +12 -11
- package/dist/esm/kup-custom-task-list-header_4.entry.js +22 -16
- package/dist/esm/kup-dashboard.entry.js +10 -9
- package/dist/esm/{kup-dates-15f89ea2.js → kup-dates-172954df.js} +81 -67
- package/dist/esm/kup-drawer.entry.js +7 -6
- package/dist/esm/kup-echart.entry.js +1504 -1025
- package/dist/esm/kup-editor.entry.js +46256 -0
- package/dist/esm/kup-family-tree.entry.js +9 -8
- package/dist/esm/kup-gantt_10.entry.js +58 -42
- package/dist/esm/kup-grid.entry.js +5 -4
- package/dist/esm/kup-iframe.entry.js +5 -4
- package/dist/esm/kup-image-list.entry.js +13 -12
- package/dist/esm/kup-lazy.entry.js +16 -15
- package/dist/esm/kup-magic-box.entry.js +9 -8
- package/dist/esm/{kup-manager-8d1df189.js → kup-manager-33b051d6.js} +122 -80
- package/dist/esm/kup-nav-bar.entry.js +6 -5
- package/dist/esm/kup-numeric-picker.entry.js +7 -6
- package/dist/esm/kup-photo-frame.entry.js +7 -6
- package/dist/esm/{kup-planner-renderer-helper-2143d119.js → kup-planner-renderer-helper-5d97e075.js} +2 -2
- package/dist/esm/kup-planner-renderer.entry.js +4 -4
- package/dist/esm/kup-planner.entry.js +8 -7
- package/dist/esm/kup-probe.entry.js +4 -4
- package/dist/esm/kup-qlik.entry.js +6 -5
- package/dist/esm/kup-snackbar.entry.js +8 -7
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-0c124f99.entry.js → p-0a4595bd.entry.js} +1 -1
- package/dist/ketchup/{p-dc370227.entry.js → p-0dd0ae49.entry.js} +1 -1
- package/dist/ketchup/p-102866cd.js +1 -0
- package/dist/ketchup/p-1ad7fea0.js +2 -0
- package/dist/ketchup/{p-01a0b54c.js → p-2778f948.js} +1 -1
- package/dist/ketchup/p-2f4055ba.entry.js +1 -0
- package/dist/ketchup/p-3c9ac0fd.entry.js +1 -0
- package/dist/ketchup/p-3ce8ce77.entry.js +49 -0
- package/dist/ketchup/p-3ff9a661.entry.js +1 -0
- package/dist/ketchup/p-41d6466e.entry.js +1 -0
- package/dist/ketchup/p-4bf5e04f.entry.js +1 -0
- package/dist/ketchup/p-6001882e.entry.js +9 -0
- package/dist/ketchup/p-610a03d4.js +28 -0
- package/dist/ketchup/{p-d9a1e5a4.entry.js → p-662d2f9b.entry.js} +1 -1
- package/dist/ketchup/{p-d76cd8d6.js → p-68e9379a.js} +1 -1
- package/dist/ketchup/p-773bcc69.entry.js +1 -0
- package/dist/ketchup/{p-caeed3c3.js → p-7bda0684.js} +1 -1
- package/dist/ketchup/p-81996620.entry.js +1 -0
- package/dist/ketchup/p-9d8d5070.entry.js +1 -0
- package/dist/ketchup/{p-8042dcd5.entry.js → p-9e63f56b.entry.js} +1 -1
- package/dist/ketchup/p-9f31a129.entry.js +38 -0
- package/dist/ketchup/p-a9b06bb8.js +1 -0
- package/dist/ketchup/{p-d300948a.entry.js → p-b086727d.entry.js} +1 -1
- package/dist/ketchup/p-b5d3c24d.entry.js +1 -0
- package/dist/ketchup/p-babbffa4.entry.js +1 -0
- package/dist/ketchup/p-c1ade766.entry.js +1 -0
- package/dist/ketchup/{p-9ba8f169.js → p-ccc637ee.js} +1 -1
- package/dist/ketchup/p-d1268ac7.entry.js +1 -0
- package/dist/ketchup/p-d15d1083.entry.js +1 -0
- package/dist/ketchup/p-d5254caf.entry.js +1 -0
- package/dist/ketchup/{p-f51dbf68.js → p-dc18691c.js} +1 -1
- package/dist/ketchup/p-de07d17e.js +1 -0
- package/dist/ketchup/p-df450df9.entry.js +16 -0
- package/dist/ketchup/{p-269a9af8.js → p-e43d4ccc.js} +1 -1
- package/dist/ketchup/p-ea625b2a.entry.js +1 -0
- package/dist/ketchup/{p-81c1d557.entry.js → p-eb37ea7e.entry.js} +1 -1
- package/dist/ketchup/p-f0b882f4.entry.js +1 -0
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +1 -0
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +1 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +1 -0
- package/dist/types/components/kup-editor/kup-editor-declarations.d.ts +21 -0
- package/dist/types/components/kup-editor/kup-editor.d.ts +128 -0
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.d.ts +1 -1
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -0
- package/dist/types/components.d.ts +149 -2
- package/dist/types/managers/kup-data/kup-data.d.ts +1 -1
- package/dist/types/managers/kup-interact/kup-interact-declarations.d.ts +1 -0
- package/dist/types/managers/kup-interact/kup-interact.d.ts +1 -0
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +3 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +1 -0
- package/dist/types/managers/kup-toolbar/kup-toolbar-declarations.d.ts +1 -1
- package/package.json +4 -3
- package/dist/ketchup/p-07bed934.entry.js +0 -1
- package/dist/ketchup/p-0f6cb6e4.entry.js +0 -1
- package/dist/ketchup/p-177f8008.entry.js +0 -9
- package/dist/ketchup/p-2ab02da0.entry.js +0 -1
- package/dist/ketchup/p-3f028a71.entry.js +0 -1
- package/dist/ketchup/p-4a18db68.entry.js +0 -39
- package/dist/ketchup/p-4eb6d4e8.entry.js +0 -1
- package/dist/ketchup/p-63031c77.js +0 -1
- package/dist/ketchup/p-71acfd3c.entry.js +0 -1
- package/dist/ketchup/p-753f30d8.entry.js +0 -1
- package/dist/ketchup/p-8c3ad5ef.entry.js +0 -1
- package/dist/ketchup/p-937a322f.js +0 -29
- package/dist/ketchup/p-a2d3aec9.entry.js +0 -1
- package/dist/ketchup/p-b07ffd18.entry.js +0 -16
- package/dist/ketchup/p-b115e1ec.entry.js +0 -1
- package/dist/ketchup/p-b396d0f8.js +0 -1
- package/dist/ketchup/p-c12a9759.entry.js +0 -1
- package/dist/ketchup/p-c23731ca.js +0 -1
- package/dist/ketchup/p-cadeb53d.entry.js +0 -1
- package/dist/ketchup/p-cd9a4274.js +0 -2
- package/dist/ketchup/p-f1cae1e1.entry.js +0 -1
- package/dist/ketchup/p-f417e794.entry.js +0 -1
- package/dist/ketchup/p-f753c13f.entry.js +0 -1
- package/dist/ketchup/p-f7980061.entry.js +0 -1
|
@@ -0,0 +1,774 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f)
|
|
3
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
5
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var _KupEditor_autosaveInterval, _KupEditor_hasChanges, _KupEditor_initialContent, _KupEditor_kupManager, _KupEditor_unsavedChangesIndex, _KupEditor_unsavedChangesItem;
|
|
18
|
+
import { forceUpdate, h, Host, } from "@stencil/core";
|
|
19
|
+
import { kupManagerInstance, } from "../../managers/kup-manager/kup-manager";
|
|
20
|
+
import { componentWrapperId } from "../../variables/GenericVariables";
|
|
21
|
+
import Editor from "@toast-ui/editor";
|
|
22
|
+
import { KupEditorProps, } from "./kup-editor-declarations";
|
|
23
|
+
import Viewer from "@toast-ui/editor/dist/toastui-editor-viewer";
|
|
24
|
+
import { getProps, setProps } from "../../utils/utils";
|
|
25
|
+
export class KupEditor {
|
|
26
|
+
constructor() {
|
|
27
|
+
/*-------------------------------------------------*/
|
|
28
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
29
|
+
/*-------------------------------------------------*/
|
|
30
|
+
_KupEditor_autosaveInterval.set(this, void 0);
|
|
31
|
+
_KupEditor_hasChanges.set(this, false);
|
|
32
|
+
_KupEditor_initialContent.set(this, '');
|
|
33
|
+
_KupEditor_kupManager.set(this, kupManagerInstance());
|
|
34
|
+
_KupEditor_unsavedChangesIndex.set(this, 0);
|
|
35
|
+
_KupEditor_unsavedChangesItem.set(this, {
|
|
36
|
+
options: {
|
|
37
|
+
className: 'kup-editor-unsaved-changes',
|
|
38
|
+
el: this.createUnsavedChanges(),
|
|
39
|
+
tooltip: 'There are unsaved changes.',
|
|
40
|
+
},
|
|
41
|
+
type: 'button',
|
|
42
|
+
});
|
|
43
|
+
this.editor = null;
|
|
44
|
+
this.editorRef = undefined;
|
|
45
|
+
this.viewer = null;
|
|
46
|
+
this.autosaveTimer = undefined;
|
|
47
|
+
this.editorHeight = 'auto';
|
|
48
|
+
this.initialEditType = 'markdown';
|
|
49
|
+
this.initialValue = '';
|
|
50
|
+
this.isReadOnly = false;
|
|
51
|
+
this.previewStyle = 'vertical';
|
|
52
|
+
this.showSaveButton = true;
|
|
53
|
+
this.showToolbar = true;
|
|
54
|
+
}
|
|
55
|
+
/*-------------------------------------------------*/
|
|
56
|
+
/* W a t c h e r s */
|
|
57
|
+
/*-------------------------------------------------*/
|
|
58
|
+
onEditorRefUpdated() {
|
|
59
|
+
if (this.editorRef && !this.editor) {
|
|
60
|
+
if (!this.isReadOnly) {
|
|
61
|
+
this.createEditor();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.createViewer();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
onEditorUpdate() {
|
|
69
|
+
if (this.editor) {
|
|
70
|
+
// to give focus to editor
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
this.editor && this.editor.moveCursorToStart();
|
|
73
|
+
}, 100);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
onInitialEditTypeChanged() {
|
|
77
|
+
if ((this.initialEditType != 'markdown' &&
|
|
78
|
+
this.initialEditType != 'wysiwyg') ||
|
|
79
|
+
!this.editor)
|
|
80
|
+
return;
|
|
81
|
+
this.editor.changeMode(this.initialEditType);
|
|
82
|
+
this.updateToolbarVisiblity();
|
|
83
|
+
}
|
|
84
|
+
onIsReadOnlyChanged() {
|
|
85
|
+
if (this.isReadOnly) {
|
|
86
|
+
this.editor.remove();
|
|
87
|
+
this.editor = null;
|
|
88
|
+
this.createViewer();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this.viewer.remove();
|
|
92
|
+
this.viewer = null;
|
|
93
|
+
this.createEditor();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
onPreviewStyleChanged() {
|
|
97
|
+
if ((this.previewStyle != 'tab' && this.previewStyle != 'vertical') ||
|
|
98
|
+
!this.editor)
|
|
99
|
+
return;
|
|
100
|
+
this.editor.changePreviewStyle(this.previewStyle);
|
|
101
|
+
/*
|
|
102
|
+
this is a fix to a bug in editor, when editor is in tab style and preview tab is selected
|
|
103
|
+
all toolbar buttons are disabled so at that point if we change the preview style to vertical
|
|
104
|
+
the toolbar buttons still remains disabled, so we call the enable all button function manually
|
|
105
|
+
*/
|
|
106
|
+
if (this.previewStyle == 'vertical') {
|
|
107
|
+
this.editor.getUI().getToolbar().enableAllButton();
|
|
108
|
+
}
|
|
109
|
+
this.updateToolbarVisiblity();
|
|
110
|
+
}
|
|
111
|
+
onShowSaveButtonChanged() {
|
|
112
|
+
if (this.editor) {
|
|
113
|
+
const toolbar = this.editor.getUI().getToolbar();
|
|
114
|
+
if (this.showSaveButton) {
|
|
115
|
+
toolbar.insertItem(0, this.getToolBarWithSaveButton(false)[0]);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
toolbar.removeItem(0);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
onShowToolBarChanged() {
|
|
123
|
+
if (this.editor) {
|
|
124
|
+
this.updateToolbarVisiblity();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
onAutosaveTimerChanged() {
|
|
128
|
+
if (this.editor) {
|
|
129
|
+
__classPrivateFieldGet(this, _KupEditor_autosaveInterval, "f") && clearInterval(__classPrivateFieldGet(this, _KupEditor_autosaveInterval, "f"));
|
|
130
|
+
typeof this.autosaveTimer === 'number' &&
|
|
131
|
+
this.autosaveTimer > 0 &&
|
|
132
|
+
this.setAutosaveInterval();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/*-------------------------------------------------*/
|
|
136
|
+
/* P u b l i c M e t h o d s */
|
|
137
|
+
/*-------------------------------------------------*/
|
|
138
|
+
/**
|
|
139
|
+
* Used to retrieve component's props values.
|
|
140
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
141
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
142
|
+
*/
|
|
143
|
+
async getProps(descriptions) {
|
|
144
|
+
return getProps(this, KupEditorProps, descriptions);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns the component's internal value as html.
|
|
148
|
+
*/
|
|
149
|
+
async getValueAsHTML() {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
return (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getHtml()) !== null && _b !== void 0 ? _b : '';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Returns the component's internal value as markdown.
|
|
155
|
+
*/
|
|
156
|
+
async getValueAsMarkdown() {
|
|
157
|
+
var _a, _b;
|
|
158
|
+
return (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getMarkdown()) !== null && _b !== void 0 ? _b : '';
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* This method is used to trigger a new render of the component.
|
|
162
|
+
*/
|
|
163
|
+
async refresh() {
|
|
164
|
+
forceUpdate(this);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Sets the props to the component.
|
|
168
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
169
|
+
*/
|
|
170
|
+
async setProps(props) {
|
|
171
|
+
setProps(this, KupEditorProps, props);
|
|
172
|
+
}
|
|
173
|
+
/*-------------------------------------------------*/
|
|
174
|
+
/* P r i v a t e M e t h o d s */
|
|
175
|
+
/*-------------------------------------------------*/
|
|
176
|
+
createEditor() {
|
|
177
|
+
var _a;
|
|
178
|
+
const editorProps = {
|
|
179
|
+
el: this.editorRef,
|
|
180
|
+
events: {
|
|
181
|
+
change: () => {
|
|
182
|
+
if (__classPrivateFieldGet(this, _KupEditor_initialContent, "f") !== this.editor.getMarkdown()) {
|
|
183
|
+
if (!__classPrivateFieldGet(this, _KupEditor_hasChanges, "f")) {
|
|
184
|
+
__classPrivateFieldSet(this, _KupEditor_unsavedChangesIndex, this.editor.getUI().getToolbar().getItems()
|
|
185
|
+
.length - 1, "f");
|
|
186
|
+
this.editor
|
|
187
|
+
.getUI()
|
|
188
|
+
.getToolbar()
|
|
189
|
+
.insertItem(__classPrivateFieldGet(this, _KupEditor_unsavedChangesIndex, "f"), __classPrivateFieldGet(this, _KupEditor_unsavedChangesItem, "f"));
|
|
190
|
+
}
|
|
191
|
+
__classPrivateFieldSet(this, _KupEditor_hasChanges, true, "f");
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
if (__classPrivateFieldGet(this, _KupEditor_hasChanges, "f")) {
|
|
195
|
+
this.editor
|
|
196
|
+
.getUI()
|
|
197
|
+
.getToolbar()
|
|
198
|
+
.removeItem(__classPrivateFieldGet(this, _KupEditor_unsavedChangesIndex, "f"));
|
|
199
|
+
}
|
|
200
|
+
__classPrivateFieldSet(this, _KupEditor_hasChanges, false, "f");
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
focus: () => {
|
|
204
|
+
if (!this.isReadOnly && !this.showToolbar) {
|
|
205
|
+
this.showToolbar = true;
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
height: (_a = this.editorHeight) !== null && _a !== void 0 ? _a : 'auto',
|
|
210
|
+
hideModeSwitch: true,
|
|
211
|
+
initialEditType: this.initialEditType,
|
|
212
|
+
initialValue: this.initialValue,
|
|
213
|
+
placeholder: 'Type your text here...',
|
|
214
|
+
previewStyle: this.previewStyle,
|
|
215
|
+
usageStatistics: false,
|
|
216
|
+
};
|
|
217
|
+
if (this.showSaveButton) {
|
|
218
|
+
editorProps.toolbarItems = this.getToolBarWithSaveButton();
|
|
219
|
+
}
|
|
220
|
+
this.editor = new Editor(editorProps);
|
|
221
|
+
__classPrivateFieldSet(this, _KupEditor_initialContent, this.editor.getMarkdown(), "f");
|
|
222
|
+
if (!this.showToolbar) {
|
|
223
|
+
this.updateToolbarVisiblity();
|
|
224
|
+
}
|
|
225
|
+
typeof this.autosaveTimer === 'number' &&
|
|
226
|
+
this.autosaveTimer > 0 &&
|
|
227
|
+
this.setAutosaveInterval();
|
|
228
|
+
}
|
|
229
|
+
createViewer() {
|
|
230
|
+
const viewerProps = {
|
|
231
|
+
el: this.editorRef,
|
|
232
|
+
initialValue: this.initialValue,
|
|
233
|
+
};
|
|
234
|
+
this.viewer = new Viewer(viewerProps);
|
|
235
|
+
}
|
|
236
|
+
createSaveButton() {
|
|
237
|
+
const button = document.createElement('button');
|
|
238
|
+
button.className = 'kup-editor-save-button';
|
|
239
|
+
button.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#585858" version="1.1" id="Capa_1" width="12px" height="12px" viewBox="0 0 407.096 407.096" xml:space="preserve">
|
|
240
|
+
<g>
|
|
241
|
+
<g>
|
|
242
|
+
<path d="M402.115,84.008L323.088,4.981C319.899,1.792,315.574,0,311.063,0H17.005C7.613,0,0,7.614,0,17.005v373.086 c0,9.392,7.613,17.005,17.005,17.005h373.086c9.392,0,17.005-7.613,17.005-17.005V96.032 C407.096,91.523,405.305,87.197,402.115,84.008z M300.664,163.567H67.129V38.862h233.535V163.567z"/>
|
|
243
|
+
<path d="M214.051,148.16h43.08c3.131,0,5.668-2.538,5.668-5.669V59.584c0-3.13-2.537-5.668-5.668-5.668h-43.08 c-3.131,0-5.668,2.538-5.668,5.668v82.907C208.383,145.622,210.92,148.16,214.051,148.16z"/>
|
|
244
|
+
</g>
|
|
245
|
+
</g>
|
|
246
|
+
</svg>`;
|
|
247
|
+
button.addEventListener('click', this.onEditorSave.bind(this));
|
|
248
|
+
return button;
|
|
249
|
+
}
|
|
250
|
+
createDivider() {
|
|
251
|
+
const el = document.createElement('div');
|
|
252
|
+
el.className = 'kup-editor-divider';
|
|
253
|
+
const divider = {
|
|
254
|
+
options: {
|
|
255
|
+
className: 'kup-editor-divider',
|
|
256
|
+
el,
|
|
257
|
+
},
|
|
258
|
+
type: 'button',
|
|
259
|
+
};
|
|
260
|
+
return divider;
|
|
261
|
+
}
|
|
262
|
+
createUnsavedChanges() {
|
|
263
|
+
const el = document.createElement('span');
|
|
264
|
+
el.className = 'kup-editor-unsaved-changes';
|
|
265
|
+
el.innerText = 'Unsaved changes.';
|
|
266
|
+
return el;
|
|
267
|
+
}
|
|
268
|
+
updateToolbarVisiblity() {
|
|
269
|
+
const toolbarElement = this.editor.getUI().getToolbar().el;
|
|
270
|
+
const toolbarParentElement = toolbarElement.parentElement;
|
|
271
|
+
toolbarElement.style.display = '';
|
|
272
|
+
toolbarParentElement.style.display = '';
|
|
273
|
+
if (!this.showToolbar) {
|
|
274
|
+
toolbarElement.style.display = 'none';
|
|
275
|
+
if (this.initialEditType != 'markdown' ||
|
|
276
|
+
this.previewStyle != 'tab') {
|
|
277
|
+
toolbarParentElement.style.display = 'none';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
setAutosaveInterval() {
|
|
282
|
+
__classPrivateFieldSet(this, _KupEditor_autosaveInterval, setInterval(() => {
|
|
283
|
+
this.onEditorAutoSave();
|
|
284
|
+
}, this.autosaveTimer), "f");
|
|
285
|
+
}
|
|
286
|
+
onEditorSave() {
|
|
287
|
+
this.kupSave.emit(this.getSaveAndAutoSaveProps());
|
|
288
|
+
}
|
|
289
|
+
onEditorAutoSave() {
|
|
290
|
+
this.kupAutoSave.emit(this.getSaveAndAutoSaveProps());
|
|
291
|
+
}
|
|
292
|
+
getToolBarWithSaveButton(includeDefaultItems = true) {
|
|
293
|
+
const options = {
|
|
294
|
+
toolbarItems: [
|
|
295
|
+
{
|
|
296
|
+
options: {
|
|
297
|
+
el: this.createSaveButton(),
|
|
298
|
+
tooltip: 'Save',
|
|
299
|
+
},
|
|
300
|
+
type: 'button',
|
|
301
|
+
},
|
|
302
|
+
this.createDivider(),
|
|
303
|
+
...(includeDefaultItems ? this.getDefaultToolBarItems() : []),
|
|
304
|
+
],
|
|
305
|
+
};
|
|
306
|
+
return options.toolbarItems;
|
|
307
|
+
}
|
|
308
|
+
getDefaultToolBarItems() {
|
|
309
|
+
const toolBarItems = [
|
|
310
|
+
'heading',
|
|
311
|
+
'bold',
|
|
312
|
+
'italic',
|
|
313
|
+
'strike',
|
|
314
|
+
this.createDivider(),
|
|
315
|
+
'hr',
|
|
316
|
+
'quote',
|
|
317
|
+
this.createDivider(),
|
|
318
|
+
'ul',
|
|
319
|
+
'ol',
|
|
320
|
+
'task',
|
|
321
|
+
'indent',
|
|
322
|
+
'outdent',
|
|
323
|
+
this.createDivider(),
|
|
324
|
+
'table',
|
|
325
|
+
'image',
|
|
326
|
+
'link',
|
|
327
|
+
this.createDivider(),
|
|
328
|
+
'code',
|
|
329
|
+
'codeblock',
|
|
330
|
+
];
|
|
331
|
+
if (this.initialEditType == 'markdown') {
|
|
332
|
+
toolBarItems.push('scrollSync');
|
|
333
|
+
}
|
|
334
|
+
return toolBarItems;
|
|
335
|
+
}
|
|
336
|
+
getSaveAndAutoSaveProps() {
|
|
337
|
+
var _a, _b;
|
|
338
|
+
return {
|
|
339
|
+
comp: this,
|
|
340
|
+
id: this.rootElement.id,
|
|
341
|
+
htmlValue: (_a = this.editor.getHtml()) !== null && _a !== void 0 ? _a : '',
|
|
342
|
+
markdownValue: (_b = this.editor.getMarkdown()) !== null && _b !== void 0 ? _b : '',
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/*-------------------------------------------------*/
|
|
346
|
+
/* L i f e c y c l e H o o k s */
|
|
347
|
+
/*-------------------------------------------------*/
|
|
348
|
+
componentWillLoad() {
|
|
349
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").debug.logLoad(this, false);
|
|
350
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").theme.register(this);
|
|
351
|
+
}
|
|
352
|
+
componentDidLoad() {
|
|
353
|
+
this.kupReady.emit({
|
|
354
|
+
comp: this,
|
|
355
|
+
id: this.rootElement.id,
|
|
356
|
+
});
|
|
357
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").debug.logLoad(this, true);
|
|
358
|
+
}
|
|
359
|
+
componentWillRender() {
|
|
360
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").debug.logRender(this, false);
|
|
361
|
+
}
|
|
362
|
+
componentDidRender() {
|
|
363
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").debug.logRender(this, true);
|
|
364
|
+
}
|
|
365
|
+
render() {
|
|
366
|
+
return (h(Host, { key: 'f6f75a4c985b137f5a7a8069daabb9cd89ea1b42' }, h("div", { key: '58e262517c28a8f932a6887e26040fdcb9241831', id: componentWrapperId }, h("div", { key: this.rootElement.id, ref: (el) => (this.editorRef = el), class: "kup-editor" }))));
|
|
367
|
+
}
|
|
368
|
+
disconnectedCallback() {
|
|
369
|
+
__classPrivateFieldGet(this, _KupEditor_kupManager, "f").theme.unregister(this);
|
|
370
|
+
__classPrivateFieldGet(this, _KupEditor_autosaveInterval, "f") && clearInterval(__classPrivateFieldGet(this, _KupEditor_autosaveInterval, "f"));
|
|
371
|
+
}
|
|
372
|
+
static get is() { return "kup-editor"; }
|
|
373
|
+
static get properties() {
|
|
374
|
+
return {
|
|
375
|
+
"autosaveTimer": {
|
|
376
|
+
"type": "number",
|
|
377
|
+
"mutable": false,
|
|
378
|
+
"complexType": {
|
|
379
|
+
"original": "number",
|
|
380
|
+
"resolved": "number",
|
|
381
|
+
"references": {}
|
|
382
|
+
},
|
|
383
|
+
"required": false,
|
|
384
|
+
"optional": false,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [{
|
|
387
|
+
"name": "default",
|
|
388
|
+
"text": "null"
|
|
389
|
+
}],
|
|
390
|
+
"text": "When specified, the component will emit the kup-editor-autosave event at regular intervals."
|
|
391
|
+
},
|
|
392
|
+
"attribute": "autosave-timer",
|
|
393
|
+
"reflect": false
|
|
394
|
+
},
|
|
395
|
+
"editorHeight": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"mutable": false,
|
|
398
|
+
"complexType": {
|
|
399
|
+
"original": "string",
|
|
400
|
+
"resolved": "string",
|
|
401
|
+
"references": {}
|
|
402
|
+
},
|
|
403
|
+
"required": false,
|
|
404
|
+
"optional": false,
|
|
405
|
+
"docs": {
|
|
406
|
+
"tags": [{
|
|
407
|
+
"name": "default",
|
|
408
|
+
"text": "\"auto\""
|
|
409
|
+
}],
|
|
410
|
+
"text": "Sets the height of the component."
|
|
411
|
+
},
|
|
412
|
+
"attribute": "editor-height",
|
|
413
|
+
"reflect": false,
|
|
414
|
+
"defaultValue": "'auto'"
|
|
415
|
+
},
|
|
416
|
+
"initialEditType": {
|
|
417
|
+
"type": "string",
|
|
418
|
+
"mutable": false,
|
|
419
|
+
"complexType": {
|
|
420
|
+
"original": "KupEditorType",
|
|
421
|
+
"resolved": "\"markdown\" | \"wysiwyg\"",
|
|
422
|
+
"references": {
|
|
423
|
+
"KupEditorType": {
|
|
424
|
+
"location": "import",
|
|
425
|
+
"path": "./kup-editor-declarations",
|
|
426
|
+
"id": "src/components/kup-editor/kup-editor-declarations.ts::KupEditorType"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
"required": false,
|
|
431
|
+
"optional": false,
|
|
432
|
+
"docs": {
|
|
433
|
+
"tags": [{
|
|
434
|
+
"name": "default",
|
|
435
|
+
"text": "'markdown'"
|
|
436
|
+
}],
|
|
437
|
+
"text": "The editor type."
|
|
438
|
+
},
|
|
439
|
+
"attribute": "initial-edit-type",
|
|
440
|
+
"reflect": false,
|
|
441
|
+
"defaultValue": "'markdown'"
|
|
442
|
+
},
|
|
443
|
+
"initialValue": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"mutable": false,
|
|
446
|
+
"complexType": {
|
|
447
|
+
"original": "string",
|
|
448
|
+
"resolved": "string",
|
|
449
|
+
"references": {}
|
|
450
|
+
},
|
|
451
|
+
"required": false,
|
|
452
|
+
"optional": false,
|
|
453
|
+
"docs": {
|
|
454
|
+
"tags": [{
|
|
455
|
+
"name": "default",
|
|
456
|
+
"text": "''"
|
|
457
|
+
}],
|
|
458
|
+
"text": "The initial editor value."
|
|
459
|
+
},
|
|
460
|
+
"attribute": "initial-value",
|
|
461
|
+
"reflect": false,
|
|
462
|
+
"defaultValue": "''"
|
|
463
|
+
},
|
|
464
|
+
"isReadOnly": {
|
|
465
|
+
"type": "boolean",
|
|
466
|
+
"mutable": false,
|
|
467
|
+
"complexType": {
|
|
468
|
+
"original": "boolean",
|
|
469
|
+
"resolved": "boolean",
|
|
470
|
+
"references": {}
|
|
471
|
+
},
|
|
472
|
+
"required": false,
|
|
473
|
+
"optional": false,
|
|
474
|
+
"docs": {
|
|
475
|
+
"tags": [{
|
|
476
|
+
"name": "default",
|
|
477
|
+
"text": "false"
|
|
478
|
+
}],
|
|
479
|
+
"text": "Defines whether the editor is disabled or not."
|
|
480
|
+
},
|
|
481
|
+
"attribute": "is-read-only",
|
|
482
|
+
"reflect": false,
|
|
483
|
+
"defaultValue": "false"
|
|
484
|
+
},
|
|
485
|
+
"previewStyle": {
|
|
486
|
+
"type": "string",
|
|
487
|
+
"mutable": false,
|
|
488
|
+
"complexType": {
|
|
489
|
+
"original": "KupEditorPreview",
|
|
490
|
+
"resolved": "\"tab\" | \"vertical\"",
|
|
491
|
+
"references": {
|
|
492
|
+
"KupEditorPreview": {
|
|
493
|
+
"location": "import",
|
|
494
|
+
"path": "./kup-editor-declarations",
|
|
495
|
+
"id": "src/components/kup-editor/kup-editor-declarations.ts::KupEditorPreview"
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"required": false,
|
|
500
|
+
"optional": false,
|
|
501
|
+
"docs": {
|
|
502
|
+
"tags": [{
|
|
503
|
+
"name": "default",
|
|
504
|
+
"text": "'vertical'"
|
|
505
|
+
}],
|
|
506
|
+
"text": "The editor preview style."
|
|
507
|
+
},
|
|
508
|
+
"attribute": "preview-style",
|
|
509
|
+
"reflect": false,
|
|
510
|
+
"defaultValue": "'vertical'"
|
|
511
|
+
},
|
|
512
|
+
"showSaveButton": {
|
|
513
|
+
"type": "boolean",
|
|
514
|
+
"mutable": false,
|
|
515
|
+
"complexType": {
|
|
516
|
+
"original": "boolean",
|
|
517
|
+
"resolved": "boolean",
|
|
518
|
+
"references": {}
|
|
519
|
+
},
|
|
520
|
+
"required": false,
|
|
521
|
+
"optional": false,
|
|
522
|
+
"docs": {
|
|
523
|
+
"tags": [{
|
|
524
|
+
"name": "default",
|
|
525
|
+
"text": "true"
|
|
526
|
+
}],
|
|
527
|
+
"text": "Defines whether to show the save button in editor's toolbar or not."
|
|
528
|
+
},
|
|
529
|
+
"attribute": "show-save-button",
|
|
530
|
+
"reflect": false,
|
|
531
|
+
"defaultValue": "true"
|
|
532
|
+
},
|
|
533
|
+
"showToolbar": {
|
|
534
|
+
"type": "boolean",
|
|
535
|
+
"mutable": false,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "boolean",
|
|
538
|
+
"resolved": "boolean",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [{
|
|
545
|
+
"name": "default",
|
|
546
|
+
"text": "true"
|
|
547
|
+
}],
|
|
548
|
+
"text": "Defines whether to show the editor's toolbar or not."
|
|
549
|
+
},
|
|
550
|
+
"attribute": "show-toolbar",
|
|
551
|
+
"reflect": false,
|
|
552
|
+
"defaultValue": "true"
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
static get states() {
|
|
557
|
+
return {
|
|
558
|
+
"editor": {},
|
|
559
|
+
"editorRef": {},
|
|
560
|
+
"viewer": {}
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
static get events() {
|
|
564
|
+
return [{
|
|
565
|
+
"method": "kupAutoSave",
|
|
566
|
+
"name": "kup-editor-autosave",
|
|
567
|
+
"bubbles": true,
|
|
568
|
+
"cancelable": false,
|
|
569
|
+
"composed": true,
|
|
570
|
+
"docs": {
|
|
571
|
+
"tags": [],
|
|
572
|
+
"text": "Triggered at regular intervals if autosaveTimer prop is initialised."
|
|
573
|
+
},
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "KupEditorEventPayload",
|
|
576
|
+
"resolved": "KupEditorEventPayload",
|
|
577
|
+
"references": {
|
|
578
|
+
"KupEditorEventPayload": {
|
|
579
|
+
"location": "import",
|
|
580
|
+
"path": "./kup-editor-declarations",
|
|
581
|
+
"id": "src/components/kup-editor/kup-editor-declarations.ts::KupEditorEventPayload"
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}, {
|
|
586
|
+
"method": "kupReady",
|
|
587
|
+
"name": "kup-editor-ready",
|
|
588
|
+
"bubbles": true,
|
|
589
|
+
"cancelable": false,
|
|
590
|
+
"composed": true,
|
|
591
|
+
"docs": {
|
|
592
|
+
"tags": [],
|
|
593
|
+
"text": "Triggered when the component is ready."
|
|
594
|
+
},
|
|
595
|
+
"complexType": {
|
|
596
|
+
"original": "KupEventPayload",
|
|
597
|
+
"resolved": "KupEventPayload",
|
|
598
|
+
"references": {
|
|
599
|
+
"KupEventPayload": {
|
|
600
|
+
"location": "import",
|
|
601
|
+
"path": "../../types/GenericTypes",
|
|
602
|
+
"id": "src/types/GenericTypes.ts::KupEventPayload"
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}, {
|
|
607
|
+
"method": "kupSave",
|
|
608
|
+
"name": "kup-editor-save",
|
|
609
|
+
"bubbles": true,
|
|
610
|
+
"cancelable": false,
|
|
611
|
+
"composed": true,
|
|
612
|
+
"docs": {
|
|
613
|
+
"tags": [],
|
|
614
|
+
"text": "Triggered when save button is clicked."
|
|
615
|
+
},
|
|
616
|
+
"complexType": {
|
|
617
|
+
"original": "KupEditorEventPayload",
|
|
618
|
+
"resolved": "KupEditorEventPayload",
|
|
619
|
+
"references": {
|
|
620
|
+
"KupEditorEventPayload": {
|
|
621
|
+
"location": "import",
|
|
622
|
+
"path": "./kup-editor-declarations",
|
|
623
|
+
"id": "src/components/kup-editor/kup-editor-declarations.ts::KupEditorEventPayload"
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}];
|
|
628
|
+
}
|
|
629
|
+
static get methods() {
|
|
630
|
+
return {
|
|
631
|
+
"getProps": {
|
|
632
|
+
"complexType": {
|
|
633
|
+
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
634
|
+
"parameters": [{
|
|
635
|
+
"name": "descriptions",
|
|
636
|
+
"type": "boolean",
|
|
637
|
+
"docs": "- When provided and true, the result will be the list of props with their description."
|
|
638
|
+
}],
|
|
639
|
+
"references": {
|
|
640
|
+
"Promise": {
|
|
641
|
+
"location": "global",
|
|
642
|
+
"id": "global::Promise"
|
|
643
|
+
},
|
|
644
|
+
"GenericObject": {
|
|
645
|
+
"location": "import",
|
|
646
|
+
"path": "../../types/GenericTypes",
|
|
647
|
+
"id": "src/types/GenericTypes.ts::GenericObject"
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
"return": "Promise<GenericObject>"
|
|
651
|
+
},
|
|
652
|
+
"docs": {
|
|
653
|
+
"text": "Used to retrieve component's props values.",
|
|
654
|
+
"tags": [{
|
|
655
|
+
"name": "param",
|
|
656
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
657
|
+
}, {
|
|
658
|
+
"name": "returns",
|
|
659
|
+
"text": "List of props as object, each key will be a prop."
|
|
660
|
+
}]
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"getValueAsHTML": {
|
|
664
|
+
"complexType": {
|
|
665
|
+
"signature": "() => Promise<string>",
|
|
666
|
+
"parameters": [],
|
|
667
|
+
"references": {
|
|
668
|
+
"Promise": {
|
|
669
|
+
"location": "global",
|
|
670
|
+
"id": "global::Promise"
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
"return": "Promise<string>"
|
|
674
|
+
},
|
|
675
|
+
"docs": {
|
|
676
|
+
"text": "Returns the component's internal value as html.",
|
|
677
|
+
"tags": []
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
"getValueAsMarkdown": {
|
|
681
|
+
"complexType": {
|
|
682
|
+
"signature": "() => Promise<string>",
|
|
683
|
+
"parameters": [],
|
|
684
|
+
"references": {
|
|
685
|
+
"Promise": {
|
|
686
|
+
"location": "global",
|
|
687
|
+
"id": "global::Promise"
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
"return": "Promise<string>"
|
|
691
|
+
},
|
|
692
|
+
"docs": {
|
|
693
|
+
"text": "Returns the component's internal value as markdown.",
|
|
694
|
+
"tags": []
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
"refresh": {
|
|
698
|
+
"complexType": {
|
|
699
|
+
"signature": "() => Promise<void>",
|
|
700
|
+
"parameters": [],
|
|
701
|
+
"references": {
|
|
702
|
+
"Promise": {
|
|
703
|
+
"location": "global",
|
|
704
|
+
"id": "global::Promise"
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
"return": "Promise<void>"
|
|
708
|
+
},
|
|
709
|
+
"docs": {
|
|
710
|
+
"text": "This method is used to trigger a new render of the component.",
|
|
711
|
+
"tags": []
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"setProps": {
|
|
715
|
+
"complexType": {
|
|
716
|
+
"signature": "(props: GenericObject) => Promise<void>",
|
|
717
|
+
"parameters": [{
|
|
718
|
+
"name": "props",
|
|
719
|
+
"type": "GenericObject",
|
|
720
|
+
"docs": "- Object containing props that will be set to the component."
|
|
721
|
+
}],
|
|
722
|
+
"references": {
|
|
723
|
+
"Promise": {
|
|
724
|
+
"location": "global",
|
|
725
|
+
"id": "global::Promise"
|
|
726
|
+
},
|
|
727
|
+
"GenericObject": {
|
|
728
|
+
"location": "import",
|
|
729
|
+
"path": "../../types/GenericTypes",
|
|
730
|
+
"id": "src/types/GenericTypes.ts::GenericObject"
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
"return": "Promise<void>"
|
|
734
|
+
},
|
|
735
|
+
"docs": {
|
|
736
|
+
"text": "Sets the props to the component.",
|
|
737
|
+
"tags": [{
|
|
738
|
+
"name": "param",
|
|
739
|
+
"text": "props - Object containing props that will be set to the component."
|
|
740
|
+
}]
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
static get elementRef() { return "rootElement"; }
|
|
746
|
+
static get watchers() {
|
|
747
|
+
return [{
|
|
748
|
+
"propName": "editorRef",
|
|
749
|
+
"methodName": "onEditorRefUpdated"
|
|
750
|
+
}, {
|
|
751
|
+
"propName": "editor",
|
|
752
|
+
"methodName": "onEditorUpdate"
|
|
753
|
+
}, {
|
|
754
|
+
"propName": "initialEditType",
|
|
755
|
+
"methodName": "onInitialEditTypeChanged"
|
|
756
|
+
}, {
|
|
757
|
+
"propName": "isReadOnly",
|
|
758
|
+
"methodName": "onIsReadOnlyChanged"
|
|
759
|
+
}, {
|
|
760
|
+
"propName": "previewStyle",
|
|
761
|
+
"methodName": "onPreviewStyleChanged"
|
|
762
|
+
}, {
|
|
763
|
+
"propName": "showSaveButton",
|
|
764
|
+
"methodName": "onShowSaveButtonChanged"
|
|
765
|
+
}, {
|
|
766
|
+
"propName": "showToolbar",
|
|
767
|
+
"methodName": "onShowToolBarChanged"
|
|
768
|
+
}, {
|
|
769
|
+
"propName": "autosaveTimer",
|
|
770
|
+
"methodName": "onAutosaveTimerChanged"
|
|
771
|
+
}];
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
_KupEditor_autosaveInterval = new WeakMap(), _KupEditor_hasChanges = new WeakMap(), _KupEditor_initialContent = new WeakMap(), _KupEditor_kupManager = new WeakMap(), _KupEditor_unsavedChangesIndex = new WeakMap(), _KupEditor_unsavedChangesItem = new WeakMap();
|