px-react-ui-components 1.0.1 → 1.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.
Files changed (63) hide show
  1. package/dist/components/MyAlert/MyAlert.js +34 -22
  2. package/dist/components/MyContainer/MyContainer.js +73 -46
  3. package/dist/components/MyContainer/MyContainerBody.js +16 -8
  4. package/dist/components/MyContainer/MyContainerFooter.js +16 -8
  5. package/dist/components/MyContainer/MyContainerRight.js +17 -9
  6. package/dist/components/MyEditor/MyEditor.js +160 -106
  7. package/dist/components/MyFileUpload/MyFileUpload.js +214 -140
  8. package/dist/components/MyImageCropper/MyImageCropper.js +92 -53
  9. package/dist/components/MyInput/MyInput.js +745 -548
  10. package/dist/components/MyInput/index.js +22 -0
  11. package/dist/components/MyMaps/YandexMaps.js +102 -61
  12. package/dist/components/MyMenu/MenuItem.js +96 -50
  13. package/dist/components/MyModal/MyModal.js +63 -39
  14. package/dist/components/MyModal/MyModalBody.js +16 -8
  15. package/dist/components/MyModal/MyModalFooter.js +16 -8
  16. package/dist/components/MyNotFound/MyNotFound.js +30 -17
  17. package/dist/components/MyScrollableCard/MyScrollableCard.js +60 -26
  18. package/dist/components/MyTable/MyTable.js +298 -189
  19. package/dist/components/MyTable/MyTableBody.js +16 -8
  20. package/dist/components/MyTable/MyTableHead.js +16 -8
  21. package/dist/components/MyTabs/MyTabPane.js +37 -16
  22. package/dist/components/MyTabs/MyTabs.js +88 -50
  23. package/dist/components/MyWaiting/MyWaiting.js +34 -22
  24. package/dist/components/MyZoomImage/MyZoomImage.js +143 -94
  25. package/dist/index.js +131 -15
  26. package/package.json +18 -4
  27. package/.babelrc +0 -3
  28. package/src/components/MyAlert/MyAlert.css +0 -113
  29. package/src/components/MyAlert/MyAlert.jsx +0 -96
  30. package/src/components/MyContainer/MyContainer.jsx +0 -90
  31. package/src/components/MyContainer/MyContainer.module.css +0 -110
  32. package/src/components/MyContainer/MyContainerBody.jsx +0 -8
  33. package/src/components/MyContainer/MyContainerFooter.jsx +0 -8
  34. package/src/components/MyContainer/MyContainerRight.jsx +0 -11
  35. package/src/components/MyEditor/MyEditor.jsx +0 -252
  36. package/src/components/MyEditor/MyEditor.scss +0 -277
  37. package/src/components/MyFileUpload/MyFileUpload.jsx +0 -371
  38. package/src/components/MyFileUpload/MyFileUpload.module.css +0 -86
  39. package/src/components/MyImageCropper/MyImageCropper.jsx +0 -108
  40. package/src/components/MyInput/MyInput.jsx +0 -895
  41. package/src/components/MyInput/MyInput.module.css +0 -420
  42. package/src/components/MyMaps/YandexMaps.jsx +0 -186
  43. package/src/components/MyMenu/MenuItem.jsx +0 -62
  44. package/src/components/MyMenu/MyMenu.module.css +0 -102
  45. package/src/components/MyModal/MyModal.css +0 -83
  46. package/src/components/MyModal/MyModal.jsx +0 -78
  47. package/src/components/MyModal/MyModalBody.jsx +0 -8
  48. package/src/components/MyModal/MyModalFooter.jsx +0 -8
  49. package/src/components/MyNotFound/MyNotFound.css +0 -22
  50. package/src/components/MyNotFound/MyNotFound.jsx +0 -11
  51. package/src/components/MyScrollableCard/MyScrollableCard.jsx +0 -86
  52. package/src/components/MyTable/MyTable.jsx +0 -459
  53. package/src/components/MyTable/MyTable.module.css +0 -350
  54. package/src/components/MyTable/MyTableBody.jsx +0 -8
  55. package/src/components/MyTable/MyTableHead.jsx +0 -10
  56. package/src/components/MyTabs/MyTabPane.jsx +0 -9
  57. package/src/components/MyTabs/MyTabs.css +0 -105
  58. package/src/components/MyTabs/MyTabs.jsx +0 -63
  59. package/src/components/MyWaiting/MyWaiting.css +0 -28
  60. package/src/components/MyWaiting/MyWaiting.jsx +0 -27
  61. package/src/components/MyZoomImage/MyZoomImage.css +0 -0
  62. package/src/components/MyZoomImage/MyZoomImage.jsx +0 -139
  63. package/src/index.js +0 -15
@@ -1,252 +0,0 @@
1
- import React, { useState, useEffect, useRef } from "react";
2
- import ReactQuill from "react-quill";
3
- import "react-quill/dist/quill.snow.css";
4
- import ImageResize from "quill-image-resize";
5
- import Quill from "quill";
6
- import QuillTable from "quill-table";
7
- import katex from "katex";
8
- import "katex/dist/katex.min.css";
9
- import "./MyEditor.scss";
10
-
11
- // KaTeX'i global hale getir
12
- window.katex = katex;
13
-
14
- // Özel font listesini tanımla
15
- const fonts = [
16
- { label: "Arial", value: "arial" },
17
- { label: "Comic Sans MS", value: "comic-sans" },
18
- { label: "Courier New", value: "courier-new" },
19
- { label: "Georgia", value: "georgia" },
20
- { label: "Helvetica", value: "helvetica" },
21
- { label: "Times New Roman", value: "times-new-roman" },
22
- { label: "Verdana", value: "verdana" },
23
- { label: "Trebuchet MS", value: "trebuchet-ms" },
24
- { label: "Garamond", value: "garamond" },
25
- { label: "Palatino Linotype", value: "palatino-linotype" },
26
- { label: "Consolas", value: "consolas" },
27
- { label: "Lucida Console", value: "lucida-console" },
28
- { label: "Impact", value: "impact" },
29
- { label: "Brush Script MT", value: "brush-script-mt" },
30
- { label: "Tahoma", value: "tahoma" },
31
- { label: "Gill Sans", value: "gill-sans" },
32
- { label: "Franklin Gothic Medium", value: "franklin-gothic-medium" },
33
- { label: "Century Gothic", value: "century-gothic" },
34
- { label: "Bookman Old Style", value: "bookman-old-style" },
35
- { label: "Candara", value: "candara" },
36
- { label: "Didot", value: "didot" },
37
- { label: "Futura", value: "futura" },
38
- { label: "Rockwell", value: "rockwell" },
39
- { label: "Baskerville", value: "baskerville" },
40
- { label: "Bodoni MT", value: "bodoni-mt" },
41
- { label: "Copperplate", value: "copperplate" },
42
- { label: "Perpetua", value: "perpetua" },
43
- { label: "Monaco", value: "monaco" },
44
- { label: "Century Schoolbook", value: "century-schoolbook" },
45
- { label: "Segoe UI", value: "segoe-ui" }
46
- ];
47
-
48
- // Quill font formatını genişlet
49
- const Font = Quill.import("formats/font");
50
- Font.whitelist = fonts.map(f => f.value);
51
- Quill.register(Font, true);
52
-
53
- // Quill modüllerini kaydet
54
- Quill.register("modules/imageResize", ImageResize);
55
- Quill.register(QuillTable.TableCell);
56
- Quill.register(QuillTable.TableRow);
57
- Quill.register(QuillTable.Table);
58
- Quill.register(QuillTable.Contain);
59
- Quill.register("modules/table", QuillTable.TableModule);
60
-
61
- // Formula Embed için düzeltme
62
- const Embed = Quill.import("blots/embed");
63
-
64
- class FormulaEmbed extends Embed {
65
- static create(value) {
66
- let node = super.create();
67
- if (value) {
68
- node.setAttribute("data-value", value);
69
- try {
70
- window.katex.render(value, node, { throwOnError: false });
71
- } catch (err) {
72
- console.error("KaTeX render error:", err);
73
- }
74
- }
75
- return node;
76
- }
77
-
78
- static value(node) {
79
- return node.getAttribute("data-value");
80
- }
81
- }
82
-
83
- FormulaEmbed.blotName = "formula";
84
- FormulaEmbed.tagName = "SPAN";
85
- FormulaEmbed.className = "ql-formula";
86
- Quill.register("formats/formula", FormulaEmbed);
87
-
88
- function MyEditor({ value, onChange, style = { height: "300px" } }) {
89
- const [editorValue, setEditorValue] = useState("");
90
- const [isFullscreen, setIsFullscreen] = useState(false);
91
- const editorRef = useRef(null);
92
- const timeoutRef = useRef(null);
93
- const isFirstRender = useRef(true);
94
-
95
- const handleFullscreen = () => {
96
- setIsFullscreen(!isFullscreen);
97
- };
98
-
99
- // Custom buton tanımı
100
- useEffect(() => {
101
- const icons = Quill.import('ui/icons');
102
- icons['fullscreen'] = `<svg viewbox="0 0 18 18">
103
- <path d="M4,4H0v2h6V0H4V4z M14,4V0h-2v6h6V4H14z M6,14H0v2h4v4h2V14z M14,18h2v-4h4v-2h-6V18z"/>
104
- </svg>`;
105
- }, []);
106
-
107
- useEffect(() => {
108
- if (isFirstRender.current) {
109
- isFirstRender.current = false;
110
- setEditorValue(value || "");
111
- } else if (value !== editorValue) {
112
- const editor = editorRef.current?.getEditor();
113
- if (editor) {
114
- editor.setContents(editor.clipboard.convert(value || ""));
115
- }
116
- }
117
- }, [value]);
118
-
119
- const handleChange = (content, delta, source, editor) => {
120
- const html = editor.getHTML();
121
- setEditorValue(html);
122
-
123
- if (timeoutRef.current) {
124
- clearTimeout(timeoutRef.current);
125
- }
126
-
127
- timeoutRef.current = setTimeout(() => {
128
- if (onChange) onChange({ value: html });
129
- }, 500);
130
- };
131
-
132
- const formats = [
133
- "header",
134
- "font",
135
- "size",
136
- "bold",
137
- "italic",
138
- "underline",
139
- "strike",
140
- "blockquote",
141
- "list",
142
- "bullet",
143
- "indent",
144
- "link",
145
- "image",
146
- "color",
147
- "background",
148
- "align",
149
- "script",
150
- "table",
151
- "table-cell",
152
- "table-row",
153
- "table-header",
154
- "table-body",
155
- "formula"
156
- ];
157
-
158
- const maxRows = 10;
159
- const maxCols = 5;
160
- const tableOptions = [];
161
- for (let r = 1; r <= maxRows; r++) {
162
- for (let c = 1; c <= maxCols; c++) {
163
- tableOptions.push("newtable_" + r + "_" + c);
164
- }
165
- }
166
-
167
- const modules = {
168
- toolbar: {
169
- container: [
170
- [{ font: fonts.map(f => f.value) }],
171
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
172
- [{ size: ["small", "normal", "large", "huge"] }],
173
- [{ list: "ordered" }, { list: "bullet" }],
174
- ["bold", "italic", "underline", "strike"],
175
- [{ align: [] }],
176
- [{ color: [] }, { background: [] }],
177
- [{ script: "sub" }, { script: "super" }],
178
- ["image"],
179
- // [{ table: tableOptions }, { table: "append-row" }, { table: "append-col" }],
180
- // ["formula"]
181
- ]
182
- },
183
- table: {
184
- operationMenu: true,
185
- resizable: true,
186
- tableCellMinWidth: 50,
187
- tableHeaderRows: 1
188
- },
189
- clipboard: {
190
- matchVisual: false
191
- },
192
- imageResize: {
193
- modules: ["Resize", "DisplaySize"],
194
- displaySize: true,
195
- handleStyles: {
196
- backgroundColor: '#000',
197
- border: 'none',
198
- color: '#fff'
199
- }
200
- }
201
- };
202
-
203
- // Font adlarını gerçek isimleriyle göstermek için toolbar'ı güncelle
204
- const fontPicker = document.querySelector(".ql-font");
205
- if (fontPicker) {
206
- const items = fontPicker.querySelectorAll(".ql-picker-item");
207
- items.forEach((item, index) => {
208
- if (fonts[index]) {
209
- item.innerText = fonts[index].label; // Gerçek font adını göster
210
- }
211
- });
212
-
213
- const pickerLabel = fontPicker.querySelector(".ql-picker-label");
214
- if (pickerLabel) {
215
- pickerLabel.innerText = fonts[0].label; // Varsayılan font ismi
216
- }
217
- }
218
-
219
- return (
220
- <div className={'myEditorContainer ' + (isFullscreen ? 'fullscreen' : '')}>
221
- <div className="myEditorContainerContent">
222
- <button
223
- onClick={handleFullscreen}
224
- className="myEditorContainerFullscreenButton"
225
- title={isFullscreen ? "Minimize" : "Maximize"}
226
- >
227
- {isFullscreen ? (
228
- <svg viewBox="0 0 18 18" width="18" height="18">
229
- <path d="M4,4h2v6H0V8h4V4z M14,4v4h4v2h-6V4H14z M6,14H4v-4H0v-2h6V14z M14,14h-2v-6h6v2h-4V14z" />
230
- </svg>
231
- ) : (
232
- <svg viewBox="0 0 18 18" width="18" height="18">
233
- <path d="M4,4H0v2h6V0H4V4z M14,4V0h-2v6h6V4H14z M6,14H0v2h4v4h2V14z M14,18h2v-4h4v-2h-6V18z" />
234
- </svg>
235
- )}
236
- </button>
237
- <ReactQuill
238
- ref={editorRef}
239
- theme="snow"
240
- value={editorValue}
241
- onChange={handleChange}
242
- modules={modules}
243
- formats={formats}
244
- style={style}
245
- preserveWhitespace={true}
246
- />
247
- </div>
248
- </div>
249
- );
250
- }
251
-
252
- export default MyEditor;
@@ -1,277 +0,0 @@
1
- .myEditorContainer {
2
- &.fullscreen {
3
- position: fixed;
4
- z-index: 9999;
5
- background: white;
6
- left: 0;
7
- top: 0;
8
- width: 100%;
9
- height: 100%;
10
- background-color: #091624c0;
11
-
12
- .myEditorContainerContent {
13
- position: absolute;
14
- top: 50%;
15
- left: 50%;
16
- transform: translate(-50%, -50%);
17
- height: 90vh;
18
- width: 95%;
19
- background: #fff;
20
- border-radius: 10px;
21
- padding: 10px;
22
-
23
- .myEditorContainerFullscreenButton{
24
- right: 15px;
25
- top: 15px;
26
- background: #7096b1;
27
- }
28
-
29
- .quill {
30
- height: calc(100% - 45px) !important;
31
- }
32
- }
33
- }
34
-
35
- .myEditorContainerContent {
36
- position: relative;
37
- height: 100%;
38
- width: 100%;
39
-
40
- .myEditorContainerFullscreenButton{
41
- position: absolute;
42
- right: 5px;
43
- top: 5px;
44
- z-index: 10000;
45
- background: #b8c1cf;
46
- border: none;
47
- cursor: pointer;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- width: 33px;
52
- height: 33px;
53
- padding: 7px;
54
- border-radius: 5px;
55
-
56
- svg{
57
- width: 100%;
58
- height: 100%;
59
- }
60
- }
61
-
62
- .quill {
63
- display: inline-block;
64
- width: 100%;
65
-
66
- .ql-toolbar {
67
- border-radius: 10px;
68
- background: #eaebec;
69
- // -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);
70
- // -moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);
71
- box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.1);
72
- padding: 3px !important;
73
-
74
- .ql-formats {
75
- margin: 4px;
76
- background: #d9dce1;
77
- padding: 2px;
78
- border-radius: 5px;
79
- }
80
- }
81
-
82
- .ql-container {
83
- border-radius: 0 0 10px 10px;
84
- padding-right: 2px;
85
- }
86
-
87
- .ql-editor {
88
- &::-webkit-scrollbar {
89
- width: 8px;
90
- height: 8px;
91
- }
92
-
93
- &::-webkit-scrollbar-track {
94
- background: #f1f1f1;
95
- border-radius: 4px;
96
- }
97
-
98
- &::-webkit-scrollbar-thumb {
99
- background: #888;
100
- border-radius: 4px;
101
-
102
- &:hover {
103
- background: #555;
104
- }
105
- }
106
- }
107
- }
108
-
109
- .quill-editor-container .ql-formula {
110
- display: inline-block;
111
- vertical-align: middle;
112
- padding: 0 2px;
113
- }
114
-
115
- .quill-editor-container .katex {
116
- display: inline-block;
117
- font-size: 1.1em;
118
- }
119
-
120
- .ql-snow .ql-picker.ql-font .ql-picker-label::before,
121
- .ql-snow .ql-picker.ql-font .ql-picker-item::before {
122
- content: "";
123
- }
124
-
125
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
126
- overflow: auto;
127
- max-height: 300px;
128
- }
129
-
130
- .ql-font-arial {
131
- font-family: Arial, sans-serif !important;
132
- }
133
-
134
- .ql-font-comic-sans {
135
- font-family: "Comic Sans MS", cursive, sans-serif !important;
136
- }
137
-
138
- .ql-font-courier-new {
139
- font-family: "Courier New", Courier, monospace !important;
140
- }
141
-
142
- .ql-font-georgia {
143
- font-family: Georgia, serif !important;
144
- }
145
-
146
- .ql-font-helvetica {
147
- font-family: Helvetica, sans-serif !important;
148
- }
149
-
150
- .ql-font-times-new-roman {
151
- font-family: "Times New Roman", Times, serif !important;
152
- }
153
-
154
- .ql-font-verdana {
155
- font-family: Verdana, sans-serif !important;
156
- }
157
-
158
- .ql-font-trebuchet-ms {
159
- font-family: "Trebuchet MS", sans-serif !important;
160
- }
161
-
162
- .ql-font-garamond {
163
- font-family: Garamond, serif !important;
164
- }
165
-
166
- .ql-font-palatino-linotype {
167
- font-family: "Palatino Linotype", serif !important;
168
- }
169
-
170
- .ql-font-consolas {
171
- font-family: Consolas, monospace !important;
172
- }
173
-
174
- .ql-font-lucida-console {
175
- font-family: "Lucida Console", monospace !important;
176
- }
177
-
178
- .ql-font-impact {
179
- font-family: Impact, sans-serif !important;
180
- }
181
-
182
- .ql-font-brush-script-mt {
183
- font-family: "Brush Script MT", cursive !important;
184
- }
185
-
186
- .ql-font-tahoma {
187
- font-family: Tahoma, sans-serif !important;
188
- }
189
-
190
- .ql-font-gill-sans {
191
- font-family: "Gill Sans", sans-serif !important;
192
- }
193
-
194
- .ql-font-franklin-gothic-medium {
195
- font-family: "Franklin Gothic Medium", sans-serif !important;
196
- }
197
-
198
- .ql-font-century-gothic {
199
- font-family: "Century Gothic", sans-serif !important;
200
- }
201
-
202
- .ql-font-bookman-old-style {
203
- font-family: "Bookman Old Style", serif !important;
204
- }
205
-
206
- .ql-font-candara {
207
- font-family: Candara, sans-serif !important;
208
- }
209
-
210
- .ql-font-didot {
211
- font-family: Didot, serif !important;
212
- }
213
-
214
- .ql-font-futura {
215
- font-family: Futura, sans-serif !important;
216
- }
217
-
218
- .ql-font-rockwell {
219
- font-family: Rockwell, serif !important;
220
- }
221
-
222
- .ql-font-baskerville {
223
- font-family: Baskerville, serif !important;
224
- }
225
-
226
- .ql-font-bodoni-mt {
227
- font-family: "Bodoni MT", serif !important;
228
- }
229
-
230
- .ql-font-copperplate {
231
- font-family: Copperplate, serif !important;
232
- }
233
-
234
- .ql-font-perpetua {
235
- font-family: Perpetua, serif !important;
236
- }
237
-
238
- .ql-font-monaco {
239
- font-family: Monaco, monospace !important;
240
- }
241
-
242
- .ql-font-century-schoolbook {
243
- font-family: "Century Schoolbook", serif !important;
244
- }
245
-
246
- .ql-font-segoe-ui {
247
- font-family: "Segoe UI", sans-serif !important;
248
- }
249
-
250
- .ql-snow .ql-toolbar button.ql-fullscreen {
251
- &:hover .ql-stroke {
252
- stroke: #06c;
253
- }
254
-
255
- .ql-stroke {
256
- stroke: #444;
257
- }
258
- }
259
- }
260
- }
261
-
262
-
263
- .ql-editor table {
264
- width: 100%;
265
- border-collapse: collapse;
266
- }
267
-
268
- .ql-editor table td,
269
- .ql-editor table th {
270
- border: 1px solid #ddd;
271
- padding: 8px;
272
- }
273
-
274
- .ql-editor table th {
275
- background-color: #f2f2f2;
276
- text-align: left;
277
- }