dc-editor-vue 1.0.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.
@@ -0,0 +1,59 @@
1
+ import { defineComponent as s, shallowRef as n, watch as u, onMounted as c, onUnmounted as d, openBlock as i, createElementBlock as f, normalizeStyle as _, normalizeClass as p } from "vue";
2
+ import { createFoEditor as v } from "../../fo-editor";
3
+ import { defaultConfig as b } from "../../fo-editor";
4
+ const m = /* @__PURE__ */ s({
5
+ __name: "Editor",
6
+ props: {
7
+ ready: {},
8
+ onError: {},
9
+ baseUrl: {},
10
+ version: {},
11
+ config: {},
12
+ mode: {},
13
+ pageMode: {},
14
+ onChange: {},
15
+ onClick: {},
16
+ onDblClick: {},
17
+ onBlur: {},
18
+ onFocus: {},
19
+ defaultValue: {},
20
+ defaultHtml: {},
21
+ readOnly: {
22
+ type: Boolean
23
+ },
24
+ style: {
25
+ type: [Boolean, null, String, Object, Array]
26
+ },
27
+ classname: {}
28
+ },
29
+ setup(l, {
30
+ expose: a
31
+ }) {
32
+ const o = l, t = n(), e = n(), r = () => {
33
+ e.value && e.value.destroy(), t.value && (e.value = v({
34
+ ...o,
35
+ dom: t.value
36
+ }));
37
+ };
38
+ return u(() => o.defaultValue, () => {
39
+ e.value && e.value.setValue(o.defaultValue);
40
+ }), c(r), d(() => {
41
+ e.value && e.value.destroy();
42
+ }), a(() => e.value), (E, g) => (i(), f("div", {
43
+ style: _(o.style),
44
+ class: p([o.classname, "example"]),
45
+ ref_key: "divRef",
46
+ ref: t
47
+ }, null, 6));
48
+ }
49
+ });
50
+ const y = (l, a) => {
51
+ const o = l.__vccOpts || l;
52
+ for (const [t, e] of a)
53
+ o[t] = e;
54
+ return o;
55
+ }, C = /* @__PURE__ */ y(m, [["__scopeId", "data-v-4598238e"]]);
56
+ export {
57
+ C as VueEditor,
58
+ b as defaultConfig
59
+ };
@@ -0,0 +1 @@
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("fo-editor")):typeof define=="function"&&define.amd?define(["exports","vue","fo-editor"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.FoEditorVue={},t.Vue,t.foEditor))})(this,function(t,e,i){"use strict";const d=e.defineComponent({__name:"Editor",props:{ready:{},onError:{},baseUrl:{},version:{},config:{},mode:{},pageMode:{},onChange:{},onClick:{},onDblClick:{},onBlur:{},onFocus:{},defaultValue:{},defaultHtml:{},readOnly:{type:Boolean},style:{type:[Boolean,null,String,Object,Array]},classname:{}},setup(r,{expose:a}){const n=r,l=e.shallowRef(),o=e.shallowRef(),u=()=>{o.value&&o.value.destroy(),l.value&&(o.value=i.createFoEditor({...n,dom:l.value}))};return e.watch(()=>n.defaultValue,()=>{o.value&&o.value.setValue(n.defaultValue)}),e.onMounted(u),e.onUnmounted(()=>{o.value&&o.value.destroy()}),a(()=>o.value),(p,_)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(n.style),class:e.normalizeClass([n.classname,"example"]),ref_key:"divRef",ref:l},null,6))}}),f="",s=((r,a)=>{const n=r.__vccOpts||r;for(const[l,o]of a)n[l]=o;return n})(d,[["__scopeId","data-v-4598238e"]]);Object.defineProperty(t,"defaultConfig",{enumerable:!0,get:()=>i.defaultConfig}),t.VueEditor=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ div[data-v-4598238e]{height:inherit}
@@ -0,0 +1,20 @@
1
+ import { EditorProps } from './types';
2
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EditorProps>, {}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EditorProps>, {}>>>, {}, {}>;
3
+ export default _default;
4
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
5
+ type __VLS_TypePropsToRuntimeProps<T> = {
6
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
7
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
8
+ } : {
9
+ type: import('vue').PropType<T[K]>;
10
+ required: true;
11
+ };
12
+ };
13
+ type __VLS_WithDefaults<P, D> = {
14
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
15
+ default: D[K];
16
+ }> : P[K];
17
+ };
18
+ type __VLS_Prettify<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
@@ -0,0 +1,4 @@
1
+ import VueEditor from './Editor.vue';
2
+ export type * from './types';
3
+ export { VueEditor };
4
+ export { defaultConfig } from 'fo-editor';
@@ -0,0 +1,7 @@
1
+ import { StyleValue } from 'vue';
2
+ import type { FoEditorProps, FoEditor, FoEditorConfig } from 'fo-editor';
3
+ export type EditorProps = Omit<FoEditorProps, 'dom'> & {
4
+ style?: StyleValue;
5
+ classname?: string;
6
+ };
7
+ export type { FoEditor, FoEditorConfig };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "dc-editor-vue",
3
+ "version": "1.0.0",
4
+ "description": "editor",
5
+ "author": " ",
6
+ "homepage": "",
7
+ "license": "ISC",
8
+ "main": "dist/fo-editor-vue.umd.js",
9
+ "module": "dist/fo-editor-vue.es.js",
10
+ "types": "dist/types/src/index.d.ts",
11
+ "workspaces": [
12
+ "packages/*"
13
+ ],
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "publish1": "yarn run build && npm run publish",
19
+ "dev": "yarn run clean-build && yarn run watch",
20
+ "watch": "vite build --watch & vue-tsc --declaration --emitDeclarationOnly --watch",
21
+ "clean-build": "rimraf dist",
22
+ "build": "yarn run clean-build &&vite build && vue-tsc --declaration --emitDeclarationOnly"
23
+ },
24
+ "dependencies": {
25
+ "dc-editor": "^1.0.0",
26
+ "vue": "^3.2.47"
27
+ },
28
+ "publishConfig": {
29
+ "registry": "https://registry.npmjs.org/"
30
+ },
31
+ "devDependencies": {
32
+ "@babel/core": "^7.21.4",
33
+ "@vitejs/plugin-vue": "^4.2.1",
34
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
35
+ "@vue/babel-plugin-jsx": "^1.1.1",
36
+ "babel": "^6.23.0",
37
+ "eslint": "^8.39.0",
38
+ "eslint-plugin-vue": "^9.11.0",
39
+ "prettier": "^2.8.8",
40
+ "rimraf": "^5.0.0",
41
+ "typescript": "^5.0.4",
42
+ "vite": "^4.3.3",
43
+ "vite-tsconfig-paths": "^4.3.1",
44
+ "vue-tsc": "^1.6.0"
45
+ },
46
+ "gitHead": "8c16114730c9f211b533ba8e10907978ab58f4af"
47
+ }