@cgboiler/biz-basic 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.
Files changed (36) hide show
  1. package/README.md +0 -0
  2. package/es/index.d.ts +10 -0
  3. package/es/index.js +25 -0
  4. package/es/rich-text-editor/RichTextEditor.d.ts +26 -0
  5. package/es/rich-text-editor/RichTextEditor.js +62 -0
  6. package/es/rich-text-editor/_atomic.css +34 -0
  7. package/es/rich-text-editor/index.css +1 -0
  8. package/es/rich-text-editor/index.d.ts +3 -0
  9. package/es/rich-text-editor/index.js +5 -0
  10. package/es/rich-text-editor/index.less +201 -0
  11. package/es/rich-text-editor/style/index.d.ts +1 -0
  12. package/es/rich-text-editor/style/index.js +1 -0
  13. package/es/rich-text-editor/style/less.d.ts +1 -0
  14. package/es/rich-text-editor/style/less.js +1 -0
  15. package/es/rich-text-editor/types.d.ts +12 -0
  16. package/es/rich-text-editor/types.js +13 -0
  17. package/es/vue-sfc-shim.d.ts +6 -0
  18. package/es/vue-tsx-shim.d.ts +24 -0
  19. package/lib/index.d.ts +10 -0
  20. package/lib/index.js +55 -0
  21. package/lib/rich-text-editor/RichTextEditor.d.ts +26 -0
  22. package/lib/rich-text-editor/RichTextEditor.js +91 -0
  23. package/lib/rich-text-editor/_atomic.css +34 -0
  24. package/lib/rich-text-editor/index.css +1 -0
  25. package/lib/rich-text-editor/index.d.ts +3 -0
  26. package/lib/rich-text-editor/index.js +34 -0
  27. package/lib/rich-text-editor/index.less +201 -0
  28. package/lib/rich-text-editor/style/index.d.ts +1 -0
  29. package/lib/rich-text-editor/style/index.js +1 -0
  30. package/lib/rich-text-editor/style/less.d.ts +1 -0
  31. package/lib/rich-text-editor/style/less.js +1 -0
  32. package/lib/rich-text-editor/types.d.ts +12 -0
  33. package/lib/rich-text-editor/types.js +32 -0
  34. package/lib/vue-sfc-shim.d.ts +6 -0
  35. package/lib/vue-tsx-shim.d.ts +24 -0
  36. package/package.json +65 -0
package/README.md ADDED
File without changes
package/es/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./rich-text-editor";
2
+ declare namespace _default {
3
+ export { install };
4
+ export { version };
5
+ }
6
+ export default _default;
7
+ export function install(app: any): void;
8
+ export const version: "1.0.0";
9
+ import RichTextEditor from './rich-text-editor';
10
+ export { RichTextEditor };
package/es/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import RichTextEditor from "./rich-text-editor";
2
+ const version = "1.0.0";
3
+ function install(app) {
4
+ const components = [
5
+ RichTextEditor
6
+ ];
7
+ components.forEach((item) => {
8
+ if (item.install) {
9
+ app.use(item);
10
+ } else if (item.name) {
11
+ app.component(item.name, item);
12
+ }
13
+ });
14
+ }
15
+ export * from "./rich-text-editor";
16
+ var stdin_default = {
17
+ install,
18
+ version
19
+ };
20
+ export {
21
+ RichTextEditor,
22
+ stdin_default as default,
23
+ install,
24
+ version
25
+ };
@@ -0,0 +1,26 @@
1
+ import './index.less';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ placeholder: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ modelValue: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ placeholder: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ }>> & Readonly<{
21
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
22
+ }>, {
23
+ modelValue: string;
24
+ placeholder: string;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ export default _default;
@@ -0,0 +1,62 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import "./_atomic.css";
3
+ import { defineComponent, onMounted, onBeforeUnmount, ref, watch } from "vue";
4
+ import StarterKit from "@tiptap/starter-kit";
5
+ import { Editor, EditorContent } from "@tiptap/vue-3";
6
+ import { TableKit } from "@tiptap/extension-table";
7
+ import { ListKit } from "@tiptap/extension-list";
8
+ import { Placeholder } from "@tiptap/extensions";
9
+ import { richTextEditorProps } from "./types";
10
+ import "./index.css";
11
+ var stdin_default = defineComponent({
12
+ name: "RichTextEditor",
13
+ props: richTextEditorProps,
14
+ emits: ["update:modelValue"],
15
+ setup(props, {
16
+ emit
17
+ }) {
18
+ const editor = ref();
19
+ const initEditor = () => {
20
+ editor.value = new Editor({
21
+ extensions: [StarterKit, ListKit, TableKit.configure({
22
+ table: {
23
+ resizable: true
24
+ }
25
+ }), Placeholder.configure({
26
+ placeholder: props.placeholder
27
+ })],
28
+ content: props.modelValue,
29
+ onUpdate: ({
30
+ editor: editor2
31
+ }) => {
32
+ const html = editor2.getHTML();
33
+ emit("update:modelValue", html);
34
+ },
35
+ onSelectionUpdate: ({
36
+ editor: editor2
37
+ }) => {
38
+ }
39
+ });
40
+ };
41
+ watch(() => props.modelValue, (newValue) => {
42
+ var _a, _b;
43
+ if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
44
+ (_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
45
+ }
46
+ });
47
+ onMounted(() => {
48
+ initEditor();
49
+ });
50
+ onBeforeUnmount(() => {
51
+ var _a;
52
+ (_a = editor.value) == null ? void 0 : _a.destroy();
53
+ });
54
+ return () => _createVNode(EditorContent, {
55
+ "class": "ProseMirror",
56
+ "editor": editor.value
57
+ }, null);
58
+ }
59
+ });
60
+ export {
61
+ stdin_default as default
62
+ };
@@ -0,0 +1,34 @@
1
+
2
+ .cgx-atm .flex {
3
+ align-items: initial;
4
+ flex-direction: initial;
5
+ justify-content: initial;
6
+ flex-wrap: initial;
7
+ }
8
+ .cgx-atm .flex-row {
9
+ flex-direction: row;
10
+ }
11
+ .cgx-atm .flex-col {
12
+ flex-direction: column;
13
+ }
14
+ .cgx-atm .justify-center {
15
+ justify-content: center;
16
+ }
17
+ .cgx-atm .justify-between {
18
+ justify-content: space-between;
19
+ }
20
+ .cgx-atm .justify-around {
21
+ justify-content: space-around;
22
+ }
23
+ .cgx-atm .justify-end {
24
+ justify-content: flex-end;
25
+ }
26
+ .cgx-atm .items-center {
27
+ align-items: center;
28
+ }
29
+ .cgx-atm .flex-wrap {
30
+ flex-wrap: wrap;
31
+ }
32
+
33
+ /* layer: default */
34
+ .cgx-atm .table{display:table;}
@@ -0,0 +1 @@
1
+ .ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror code{background-color:var(--purple-light);border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}
@@ -0,0 +1,3 @@
1
+ import _RichTextEditor from './RichTextEditor';
2
+ export default _RichTextEditor;
3
+ export type { RichTextEditorProps } from './types';
@@ -0,0 +1,5 @@
1
+ import _RichTextEditor from "./RichTextEditor";
2
+ var stdin_default = _RichTextEditor;
3
+ export {
4
+ stdin_default as default
5
+ };
@@ -0,0 +1,201 @@
1
+ .ProseMirror {
2
+ flex: 1;
3
+ overflow: auto;
4
+ outline: none;
5
+
6
+ line-height: 1.6;
7
+ font-size: var(--font-base);
8
+ --white: #fff;
9
+ --black: #2e2b29;
10
+ --gray-1: rgba(61, 37, 20, 0.05);
11
+ --gray-2: rgba(61, 37, 20, 0.08);
12
+ --gray-3: rgba(61, 37, 20, 0.12);
13
+ --gray-4: rgba(53, 38, 28, 0.3);
14
+ --gray-5: rgba(28, 25, 23, 0.6);
15
+ --green: #22c55e;
16
+ --purple: #6a00f5;
17
+ --purple-contrast: #5800cc;
18
+ --purple-light: rgba(88, 5, 255, 0.05);
19
+ --yellow-contrast: #facc15;
20
+ --yellow: rgba(250, 204, 21, 0.4);
21
+ --yellow-light: #fffae5;
22
+ --red: #ff5c33;
23
+ --red-light: #ffebe5;
24
+ --shadow: 0px 12px 33px 0px rgba(0, 0, 0, 0.06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, 0.04);
25
+ :first-child {
26
+ margin-top: 0;
27
+ }
28
+
29
+ /* List styles */
30
+ ol {
31
+ list-style: auto;
32
+ }
33
+
34
+ ul {
35
+ list-style: disc;
36
+ }
37
+
38
+ ol,
39
+ ul {
40
+ padding-left: 1.5em;
41
+ margin: 0 0 12px 0;
42
+ li p {
43
+ margin-top: 0.25em;
44
+ margin-bottom: 0.25em;
45
+ }
46
+ }
47
+
48
+ li::marker {
49
+ text-align: start !important;
50
+ }
51
+
52
+ /* Heading styles */
53
+ h1,
54
+ h2,
55
+ h3,
56
+ h4,
57
+ h5,
58
+ h6 {
59
+ line-height: 1.1;
60
+ margin-top: 2.5rem;
61
+ text-wrap: pretty;
62
+ }
63
+
64
+ h1,
65
+ h2 {
66
+ margin-top: 1rem;
67
+ margin-bottom: 1rem;
68
+ }
69
+
70
+ h1 {
71
+ font-size: 1.4rem;
72
+ }
73
+
74
+ h2 {
75
+ font-size: 1.2rem;
76
+ }
77
+
78
+ h3 {
79
+ font-size: 1.1rem;
80
+ }
81
+
82
+ h4,
83
+ h5,
84
+ h6 {
85
+ font-size: 1rem;
86
+ }
87
+
88
+ /* Code and preformatted text styles */
89
+ code {
90
+ background-color: var(--purple-light);
91
+ border-radius: 0.4rem;
92
+ color: var(--black);
93
+ font-size: 0.85rem;
94
+ padding: 0.25em 0.3em;
95
+ }
96
+
97
+ pre {
98
+ background: var(--black);
99
+ border-radius: 0.5rem;
100
+ color: var(--white);
101
+ font-family: 'JetBrainsMono', monospace;
102
+ margin: 1.5rem 0;
103
+ padding: 0.75rem 1rem;
104
+
105
+ code {
106
+ background: none;
107
+ color: inherit;
108
+ font-size: 0.8rem;
109
+ padding: 0;
110
+ }
111
+ }
112
+
113
+ blockquote {
114
+ border-left: 3px solid var(--gray-3);
115
+ margin: 1.5rem 0;
116
+ padding-left: 1rem;
117
+ }
118
+
119
+ hr {
120
+ border: none;
121
+ border-top: 1px solid var(--gray-2);
122
+ margin: 2rem 0;
123
+ }
124
+
125
+ /* Placeholder (at the top) */
126
+ p.is-editor-empty:first-child::before {
127
+ color: var(--gray-4);
128
+ content: attr(data-placeholder);
129
+ float: left;
130
+ height: 0;
131
+ pointer-events: none;
132
+ }
133
+
134
+ .is-empty::before {
135
+ color: var(--gray-4);
136
+ content: attr(data-placeholder);
137
+ float: left;
138
+ height: 0;
139
+ pointer-events: none;
140
+ }
141
+ /* Table-specific styling */
142
+ table {
143
+ border-collapse: collapse;
144
+ margin: 0;
145
+ overflow: hidden;
146
+ table-layout: fixed;
147
+ width: 100%;
148
+
149
+ td,
150
+ th {
151
+ border: 1px solid var(--gray-3);
152
+ box-sizing: border-box;
153
+ min-width: 1em;
154
+ padding: 6px 8px;
155
+ position: relative;
156
+ vertical-align: top;
157
+
158
+ > * {
159
+ margin-bottom: 0;
160
+ }
161
+ }
162
+
163
+ th {
164
+ background-color: var(--gray-1);
165
+ font-weight: bold;
166
+ text-align: left;
167
+ }
168
+
169
+ .selectedCell:after {
170
+ background: var(--gray-2);
171
+ content: '';
172
+ left: 0;
173
+ right: 0;
174
+ top: 0;
175
+ bottom: 0;
176
+ pointer-events: none;
177
+ position: absolute;
178
+ z-index: 2;
179
+ }
180
+
181
+ .column-resize-handle {
182
+ background-color: var(--purple);
183
+ bottom: -2px;
184
+ pointer-events: none;
185
+ position: absolute;
186
+ right: -2px;
187
+ top: 0;
188
+ width: 4px;
189
+ }
190
+ }
191
+
192
+ .tableWrapper {
193
+ margin: 1.5rem 0;
194
+ overflow-x: auto;
195
+ }
196
+
197
+ &.resize-cursor {
198
+ cursor: ew-resize;
199
+ cursor: col-resize;
200
+ }
201
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import "../index.css";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import "../index.less";
@@ -0,0 +1,12 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ export declare const richTextEditorProps: {
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ placeholder: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ };
12
+ export type RichTextEditorProps = ExtractPropTypes<typeof richTextEditorProps>;
@@ -0,0 +1,13 @@
1
+ const richTextEditorProps = {
2
+ modelValue: {
3
+ type: String,
4
+ default: ""
5
+ },
6
+ placeholder: {
7
+ type: String,
8
+ default: "\u8BF7\u5199\u70B9\u4EC0\u4E48..."
9
+ }
10
+ };
11
+ export {
12
+ richTextEditorProps
13
+ };
@@ -0,0 +1,6 @@
1
+ declare module '*.vue' {
2
+ // eslint-disable-next-line
3
+ import { DefineComponent } from 'vue'
4
+ const Component: DefineComponent
5
+ export default Component
6
+ }
@@ -0,0 +1,24 @@
1
+ import 'vue';
2
+
3
+ type EventHandler = (...args: any[]) => void;
4
+
5
+ declare module 'vue' {
6
+ interface ComponentCustomProps {
7
+ id?: string;
8
+ role?: string;
9
+ tabindex?: number;
10
+ onClick?: EventHandler;
11
+ onTouchend?: EventHandler;
12
+ onTouchmove?: EventHandler;
13
+ onTouchstart?: EventHandler;
14
+ onTouchcancel?: EventHandler;
15
+ onTouchmovePassive?: EventHandler;
16
+ onTouchstartPassive?: EventHandler;
17
+ }
18
+
19
+ interface HTMLAttributes {
20
+ onTouchmovePassive?: EventHandler;
21
+ onTouchstartPassive?: EventHandler;
22
+ onClickCapture?: EventHandler;
23
+ }
24
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./rich-text-editor";
2
+ declare namespace _default {
3
+ export { install };
4
+ export { version };
5
+ }
6
+ export default _default;
7
+ export function install(app: any): void;
8
+ export const version: "1.0.0";
9
+ import RichTextEditor from './rich-text-editor';
10
+ export { RichTextEditor };
package/lib/index.js ADDED
@@ -0,0 +1,55 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var stdin_exports = {};
30
+ __export(stdin_exports, {
31
+ RichTextEditor: () => import_rich_text_editor.default,
32
+ default: () => stdin_default,
33
+ install: () => install,
34
+ version: () => version
35
+ });
36
+ module.exports = __toCommonJS(stdin_exports);
37
+ var import_rich_text_editor = __toESM(require("./rich-text-editor"));
38
+ __reExport(stdin_exports, require("./rich-text-editor"), module.exports);
39
+ const version = "1.0.0";
40
+ function install(app) {
41
+ const components = [
42
+ import_rich_text_editor.default
43
+ ];
44
+ components.forEach((item) => {
45
+ if (item.install) {
46
+ app.use(item);
47
+ } else if (item.name) {
48
+ app.component(item.name, item);
49
+ }
50
+ });
51
+ }
52
+ var stdin_default = {
53
+ install,
54
+ version
55
+ };
@@ -0,0 +1,26 @@
1
+ import './index.less';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ placeholder: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ modelValue: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ placeholder: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ }>> & Readonly<{
21
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
22
+ }>, {
23
+ modelValue: string;
24
+ placeholder: string;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ export default _default;
@@ -0,0 +1,91 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ default: () => stdin_default
31
+ });
32
+ module.exports = __toCommonJS(stdin_exports);
33
+ var import_vue = require("vue");
34
+ var import_atomic = require("./_atomic.css");
35
+ var import_vue2 = require("vue");
36
+ var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
37
+ var import_vue_3 = require("@tiptap/vue-3");
38
+ var import_extension_table = require("@tiptap/extension-table");
39
+ var import_extension_list = require("@tiptap/extension-list");
40
+ var import_extensions = require("@tiptap/extensions");
41
+ var import_types = require("./types");
42
+ var import_index = require("./index.css");
43
+ var stdin_default = (0, import_vue2.defineComponent)({
44
+ name: "RichTextEditor",
45
+ props: import_types.richTextEditorProps,
46
+ emits: ["update:modelValue"],
47
+ setup(props, {
48
+ emit
49
+ }) {
50
+ const editor = (0, import_vue2.ref)();
51
+ const initEditor = () => {
52
+ editor.value = new import_vue_3.Editor({
53
+ extensions: [import_starter_kit.default, import_extension_list.ListKit, import_extension_table.TableKit.configure({
54
+ table: {
55
+ resizable: true
56
+ }
57
+ }), import_extensions.Placeholder.configure({
58
+ placeholder: props.placeholder
59
+ })],
60
+ content: props.modelValue,
61
+ onUpdate: ({
62
+ editor: editor2
63
+ }) => {
64
+ const html = editor2.getHTML();
65
+ emit("update:modelValue", html);
66
+ },
67
+ onSelectionUpdate: ({
68
+ editor: editor2
69
+ }) => {
70
+ }
71
+ });
72
+ };
73
+ (0, import_vue2.watch)(() => props.modelValue, (newValue) => {
74
+ var _a, _b;
75
+ if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
76
+ (_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
77
+ }
78
+ });
79
+ (0, import_vue2.onMounted)(() => {
80
+ initEditor();
81
+ });
82
+ (0, import_vue2.onBeforeUnmount)(() => {
83
+ var _a;
84
+ (_a = editor.value) == null ? void 0 : _a.destroy();
85
+ });
86
+ return () => (0, import_vue.createVNode)(import_vue_3.EditorContent, {
87
+ "class": "ProseMirror",
88
+ "editor": editor.value
89
+ }, null);
90
+ }
91
+ });
@@ -0,0 +1,34 @@
1
+
2
+ .cgx-atm .flex {
3
+ align-items: initial;
4
+ flex-direction: initial;
5
+ justify-content: initial;
6
+ flex-wrap: initial;
7
+ }
8
+ .cgx-atm .flex-row {
9
+ flex-direction: row;
10
+ }
11
+ .cgx-atm .flex-col {
12
+ flex-direction: column;
13
+ }
14
+ .cgx-atm .justify-center {
15
+ justify-content: center;
16
+ }
17
+ .cgx-atm .justify-between {
18
+ justify-content: space-between;
19
+ }
20
+ .cgx-atm .justify-around {
21
+ justify-content: space-around;
22
+ }
23
+ .cgx-atm .justify-end {
24
+ justify-content: flex-end;
25
+ }
26
+ .cgx-atm .items-center {
27
+ align-items: center;
28
+ }
29
+ .cgx-atm .flex-wrap {
30
+ flex-wrap: wrap;
31
+ }
32
+
33
+ /* layer: default */
34
+ .cgx-atm .table{display:table;}
@@ -0,0 +1 @@
1
+ .ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror code{background-color:var(--purple-light);border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}
@@ -0,0 +1,3 @@
1
+ import _RichTextEditor from './RichTextEditor';
2
+ export default _RichTextEditor;
3
+ export type { RichTextEditorProps } from './types';
@@ -0,0 +1,34 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ default: () => stdin_default
31
+ });
32
+ module.exports = __toCommonJS(stdin_exports);
33
+ var import_RichTextEditor = __toESM(require("./RichTextEditor"));
34
+ var stdin_default = import_RichTextEditor.default;
@@ -0,0 +1,201 @@
1
+ .ProseMirror {
2
+ flex: 1;
3
+ overflow: auto;
4
+ outline: none;
5
+
6
+ line-height: 1.6;
7
+ font-size: var(--font-base);
8
+ --white: #fff;
9
+ --black: #2e2b29;
10
+ --gray-1: rgba(61, 37, 20, 0.05);
11
+ --gray-2: rgba(61, 37, 20, 0.08);
12
+ --gray-3: rgba(61, 37, 20, 0.12);
13
+ --gray-4: rgba(53, 38, 28, 0.3);
14
+ --gray-5: rgba(28, 25, 23, 0.6);
15
+ --green: #22c55e;
16
+ --purple: #6a00f5;
17
+ --purple-contrast: #5800cc;
18
+ --purple-light: rgba(88, 5, 255, 0.05);
19
+ --yellow-contrast: #facc15;
20
+ --yellow: rgba(250, 204, 21, 0.4);
21
+ --yellow-light: #fffae5;
22
+ --red: #ff5c33;
23
+ --red-light: #ffebe5;
24
+ --shadow: 0px 12px 33px 0px rgba(0, 0, 0, 0.06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, 0.04);
25
+ :first-child {
26
+ margin-top: 0;
27
+ }
28
+
29
+ /* List styles */
30
+ ol {
31
+ list-style: auto;
32
+ }
33
+
34
+ ul {
35
+ list-style: disc;
36
+ }
37
+
38
+ ol,
39
+ ul {
40
+ padding-left: 1.5em;
41
+ margin: 0 0 12px 0;
42
+ li p {
43
+ margin-top: 0.25em;
44
+ margin-bottom: 0.25em;
45
+ }
46
+ }
47
+
48
+ li::marker {
49
+ text-align: start !important;
50
+ }
51
+
52
+ /* Heading styles */
53
+ h1,
54
+ h2,
55
+ h3,
56
+ h4,
57
+ h5,
58
+ h6 {
59
+ line-height: 1.1;
60
+ margin-top: 2.5rem;
61
+ text-wrap: pretty;
62
+ }
63
+
64
+ h1,
65
+ h2 {
66
+ margin-top: 1rem;
67
+ margin-bottom: 1rem;
68
+ }
69
+
70
+ h1 {
71
+ font-size: 1.4rem;
72
+ }
73
+
74
+ h2 {
75
+ font-size: 1.2rem;
76
+ }
77
+
78
+ h3 {
79
+ font-size: 1.1rem;
80
+ }
81
+
82
+ h4,
83
+ h5,
84
+ h6 {
85
+ font-size: 1rem;
86
+ }
87
+
88
+ /* Code and preformatted text styles */
89
+ code {
90
+ background-color: var(--purple-light);
91
+ border-radius: 0.4rem;
92
+ color: var(--black);
93
+ font-size: 0.85rem;
94
+ padding: 0.25em 0.3em;
95
+ }
96
+
97
+ pre {
98
+ background: var(--black);
99
+ border-radius: 0.5rem;
100
+ color: var(--white);
101
+ font-family: 'JetBrainsMono', monospace;
102
+ margin: 1.5rem 0;
103
+ padding: 0.75rem 1rem;
104
+
105
+ code {
106
+ background: none;
107
+ color: inherit;
108
+ font-size: 0.8rem;
109
+ padding: 0;
110
+ }
111
+ }
112
+
113
+ blockquote {
114
+ border-left: 3px solid var(--gray-3);
115
+ margin: 1.5rem 0;
116
+ padding-left: 1rem;
117
+ }
118
+
119
+ hr {
120
+ border: none;
121
+ border-top: 1px solid var(--gray-2);
122
+ margin: 2rem 0;
123
+ }
124
+
125
+ /* Placeholder (at the top) */
126
+ p.is-editor-empty:first-child::before {
127
+ color: var(--gray-4);
128
+ content: attr(data-placeholder);
129
+ float: left;
130
+ height: 0;
131
+ pointer-events: none;
132
+ }
133
+
134
+ .is-empty::before {
135
+ color: var(--gray-4);
136
+ content: attr(data-placeholder);
137
+ float: left;
138
+ height: 0;
139
+ pointer-events: none;
140
+ }
141
+ /* Table-specific styling */
142
+ table {
143
+ border-collapse: collapse;
144
+ margin: 0;
145
+ overflow: hidden;
146
+ table-layout: fixed;
147
+ width: 100%;
148
+
149
+ td,
150
+ th {
151
+ border: 1px solid var(--gray-3);
152
+ box-sizing: border-box;
153
+ min-width: 1em;
154
+ padding: 6px 8px;
155
+ position: relative;
156
+ vertical-align: top;
157
+
158
+ > * {
159
+ margin-bottom: 0;
160
+ }
161
+ }
162
+
163
+ th {
164
+ background-color: var(--gray-1);
165
+ font-weight: bold;
166
+ text-align: left;
167
+ }
168
+
169
+ .selectedCell:after {
170
+ background: var(--gray-2);
171
+ content: '';
172
+ left: 0;
173
+ right: 0;
174
+ top: 0;
175
+ bottom: 0;
176
+ pointer-events: none;
177
+ position: absolute;
178
+ z-index: 2;
179
+ }
180
+
181
+ .column-resize-handle {
182
+ background-color: var(--purple);
183
+ bottom: -2px;
184
+ pointer-events: none;
185
+ position: absolute;
186
+ right: -2px;
187
+ top: 0;
188
+ width: 4px;
189
+ }
190
+ }
191
+
192
+ .tableWrapper {
193
+ margin: 1.5rem 0;
194
+ overflow-x: auto;
195
+ }
196
+
197
+ &.resize-cursor {
198
+ cursor: ew-resize;
199
+ cursor: col-resize;
200
+ }
201
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ require("../index.css");
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ require("../index.less");
@@ -0,0 +1,12 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ export declare const richTextEditorProps: {
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ placeholder: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ };
12
+ export type RichTextEditorProps = ExtractPropTypes<typeof richTextEditorProps>;
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ richTextEditorProps: () => richTextEditorProps
21
+ });
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ const richTextEditorProps = {
24
+ modelValue: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ placeholder: {
29
+ type: String,
30
+ default: "\u8BF7\u5199\u70B9\u4EC0\u4E48..."
31
+ }
32
+ };
@@ -0,0 +1,6 @@
1
+ declare module '*.vue' {
2
+ // eslint-disable-next-line
3
+ import { DefineComponent } from 'vue'
4
+ const Component: DefineComponent
5
+ export default Component
6
+ }
@@ -0,0 +1,24 @@
1
+ import 'vue';
2
+
3
+ type EventHandler = (...args: any[]) => void;
4
+
5
+ declare module 'vue' {
6
+ interface ComponentCustomProps {
7
+ id?: string;
8
+ role?: string;
9
+ tabindex?: number;
10
+ onClick?: EventHandler;
11
+ onTouchend?: EventHandler;
12
+ onTouchmove?: EventHandler;
13
+ onTouchstart?: EventHandler;
14
+ onTouchcancel?: EventHandler;
15
+ onTouchmovePassive?: EventHandler;
16
+ onTouchstartPassive?: EventHandler;
17
+ }
18
+
19
+ interface HTMLAttributes {
20
+ onTouchmovePassive?: EventHandler;
21
+ onTouchstartPassive?: EventHandler;
22
+ onClickCapture?: EventHandler;
23
+ }
24
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@cgboiler/biz-basic",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "module": "es/index.js",
7
+ "style": "lib/index.css",
8
+ "typings": "lib/index.d.ts",
9
+ "files": [
10
+ "lib",
11
+ "es"
12
+ ],
13
+ "scripts": {
14
+ "dev": "cg-cli dev",
15
+ "test": "cg-cli test",
16
+ "lint": "cg-cli lint",
17
+ "build": "cg-cli build",
18
+ "build-npm": "cg-cli build",
19
+ "release": "cg-cli release",
20
+ "test:coverage": "open test/coverage/index.html",
21
+ "build-site": "cg-cli build-site",
22
+ "changelog": "cg-cli changelog",
23
+ "duero-config": "echo 'Do not need duero config'"
24
+ },
25
+ "author": "dongcg",
26
+ "license": "MIT",
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "registry": "https://registry.npmjs.org/"
30
+ },
31
+ "repository": "https://gitlab.cgboiler.com/front/cg-biz",
32
+ "homepage": "https://gitlab.cgboiler.com/front/cg-biz",
33
+ "bugs": "https://gitlab.cgboiler.com/front/cg-biz/-/issues",
34
+ "lint-staged": {
35
+ "*.md": "prettier --write",
36
+ "*.{ts,tsx,js,vue,less,scss}": "prettier --write",
37
+ "*.{ts,tsx,js,vue}": "eslint --fix",
38
+ "*.{vue,css,less,scss}": "stylelint --fix"
39
+ },
40
+ "peerDependencies": {
41
+ "vue": "^3.2.26"
42
+ },
43
+ "devDependencies": {
44
+ "@cgboiler/cli": "workspace:*",
45
+ "@types/node": "^22.9.3",
46
+ "@vue/test-utils": "^2.4.6",
47
+ "element-plus": "^2.9.0",
48
+ "prettier": "^2.4.1",
49
+ "typescript": "^5.6.3",
50
+ "vue": "^3.5.13"
51
+ },
52
+ "dependencies": {
53
+ "@tiptap/extension-collaboration": "3.0.0-beta.16",
54
+ "@tiptap/extension-list": "^3.0.7",
55
+ "@tiptap/extension-table": "3.0.0-beta.5",
56
+ "@tiptap/extensions": "3.0.0-beta.5",
57
+ "@tiptap/pm": "3.0.0-beta.5",
58
+ "@tiptap/starter-kit": "3.0.0-beta.5",
59
+ "@tiptap/vue-3": "3.0.0-beta.5"
60
+ },
61
+ "browserslist": [
62
+ "Chrome >= 51",
63
+ "iOS >= 10"
64
+ ]
65
+ }