@kedataindo/docflow-element 0.0.1 → 0.0.3
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/DocsEditorElement.d.ts +8 -1
- package/dist/DocsEditorElement.d.ts.map +1 -1
- package/dist/index.cjs +17 -2
- package/dist/index.css +929 -82
- package/dist/index.js +34 -22
- package/package.json +10 -9
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import type { DocsEditorPlugin } from '@
|
|
1
|
+
import type { DocsEditorPlugin, ImageUploadHandler } from '@kedataindo/docflow-core';
|
|
2
2
|
export declare class DocsEditorElement extends HTMLElement {
|
|
3
3
|
static observedAttributes: string[];
|
|
4
4
|
private _vueElement?;
|
|
5
5
|
private _shadowRoot?;
|
|
6
6
|
private _plugins;
|
|
7
|
+
private _onImageUpload?;
|
|
7
8
|
get plugins(): DocsEditorPlugin[];
|
|
8
9
|
set plugins(value: DocsEditorPlugin[]);
|
|
10
|
+
/**
|
|
11
|
+
* Host-injected image upload port. Functions can't be HTML attributes, so
|
|
12
|
+
* consumers set it as a JS property: `el.onImageUpload = async (file) => ({ src })`.
|
|
13
|
+
*/
|
|
14
|
+
get onImageUpload(): ImageUploadHandler | undefined;
|
|
15
|
+
set onImageUpload(value: ImageUploadHandler | undefined);
|
|
9
16
|
connectedCallback(): void;
|
|
10
17
|
disconnectedCallback(): void;
|
|
11
18
|
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsEditorElement.d.ts","sourceRoot":"","sources":["../src/DocsEditorElement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"DocsEditorElement.d.ts","sourceRoot":"","sources":["../src/DocsEditorElement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAQ1F,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,MAAM,CAAC,kBAAkB,WAA4D;IAErF,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,WAAW,CAAC,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,cAAc,CAAC,CAAoB;IAE3C,IAAI,OAAO,IAAI,gBAAgB,EAAE,CAEhC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAKpC;IAED;;;OAGG;IACH,IAAI,aAAa,IAAI,kBAAkB,GAAG,SAAS,CAElD;IAED,IAAI,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EAKtD;IAED,iBAAiB;IAgBjB,oBAAoB;IAMpB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKxF,OAAO,CAAC,WAAW;CAoCpB"}
|
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
28
|
// src/DocsEditorElement.ts
|
|
29
|
-
var import_docflow_vue = require("@
|
|
29
|
+
var import_docflow_vue = require("@kedataindo/docflow-vue");
|
|
30
30
|
var import_vue = require("vue");
|
|
31
31
|
|
|
32
32
|
// src/shadow.css?inline
|
|
@@ -39,6 +39,7 @@ var DocsEditorElement = class extends HTMLElement {
|
|
|
39
39
|
_vueElement;
|
|
40
40
|
_shadowRoot;
|
|
41
41
|
_plugins = [];
|
|
42
|
+
_onImageUpload;
|
|
42
43
|
get plugins() {
|
|
43
44
|
return this._plugins;
|
|
44
45
|
}
|
|
@@ -48,6 +49,19 @@ var DocsEditorElement = class extends HTMLElement {
|
|
|
48
49
|
Object.assign(this._vueElement, this._buildProps());
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Host-injected image upload port. Functions can't be HTML attributes, so
|
|
54
|
+
* consumers set it as a JS property: `el.onImageUpload = async (file) => ({ src })`.
|
|
55
|
+
*/
|
|
56
|
+
get onImageUpload() {
|
|
57
|
+
return this._onImageUpload;
|
|
58
|
+
}
|
|
59
|
+
set onImageUpload(value) {
|
|
60
|
+
this._onImageUpload = value;
|
|
61
|
+
if (this._vueElement) {
|
|
62
|
+
Object.assign(this._vueElement, this._buildProps());
|
|
63
|
+
}
|
|
64
|
+
}
|
|
51
65
|
connectedCallback() {
|
|
52
66
|
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
53
67
|
this._shadowRoot = this.attachShadow({ mode: "open" });
|
|
@@ -96,7 +110,8 @@ var DocsEditorElement = class extends HTMLElement {
|
|
|
96
110
|
modelValue,
|
|
97
111
|
editable,
|
|
98
112
|
collaboration,
|
|
99
|
-
plugins: this._plugins
|
|
113
|
+
plugins: this._plugins,
|
|
114
|
+
onImageUpload: this._onImageUpload
|
|
100
115
|
};
|
|
101
116
|
}
|
|
102
117
|
};
|