@jackuait/blok 0.1.1 → 0.2.1-beta.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/README.md +16 -0
- package/dist/blok-HV5Vwzfn.mjs +24931 -0
- package/dist/blok.mjs +1 -2
- package/dist/blok.umd.js +164 -44
- package/dist/index-D_akk_da.mjs +82 -0
- package/dist/vendor.LICENSE.txt +74 -107
- package/package.json +61 -57
- package/types/api/block.d.ts +3 -3
- package/types/api/blocks.d.ts +2 -2
- package/types/api/caret.d.ts +3 -3
- package/types/api/events.d.ts +1 -1
- package/types/api/i18n.d.ts +1 -1
- package/types/api/listeners.d.ts +1 -1
- package/types/api/notifier.d.ts +1 -1
- package/types/api/sanitizer.d.ts +1 -1
- package/types/api/saver.d.ts +2 -2
- package/types/api/styles.d.ts +64 -9
- package/types/api/tools.d.ts +1 -1
- package/types/api/ui.d.ts +4 -4
- package/types/block-tunes/block-tune.d.ts +1 -1
- package/types/configs/{editor-config.d.ts → blok-config.d.ts} +8 -8
- package/types/configs/i18n-dictionary.d.ts +3 -3
- package/types/configs/index.d.ts +1 -1
- package/types/configs/notifier.d.ts +98 -0
- package/types/data-formats/output-data.d.ts +1 -1
- package/types/events/block/BlockAdded.ts +1 -1
- package/types/index.d.ts +8 -8
- package/types/tools/adapters/base-tool-adapter.d.ts +2 -2
- package/types/tools/adapters/block-tool-adapter.d.ts +1 -1
- package/types/tools/block-tool.d.ts +1 -1
- package/types/tools/tool-settings.d.ts +1 -1
- package/types/tools/tool.d.ts +1 -2
- package/types/utils/popover/popover-item.d.ts +34 -3
- package/dist/bundle-6e604287.mjs +0 -340
- package/dist/codex-7de6c88e.mjs +0 -15668
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as f, a as i } from "./blok-HV5Vwzfn.mjs";
|
|
2
|
+
const a = {
|
|
3
|
+
wrapper: i(
|
|
4
|
+
"fixed z-[2] bottom-5 left-5",
|
|
5
|
+
'font-[-apple-system,BlinkMacSystemFont,"Segoe_UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira_Sans","Droid_Sans","Helvetica_Neue",sans-serif]'
|
|
6
|
+
),
|
|
7
|
+
notification: i(
|
|
8
|
+
"relative w-[230px] mt-[15px] py-[13px] px-4",
|
|
9
|
+
"bg-white shadow-[0_11px_17px_0_rgba(23,32,61,0.13)] rounded-[5px]",
|
|
10
|
+
"text-sm leading-[1.4em] break-words",
|
|
11
|
+
'before:content-[""] before:absolute before:block before:top-0 before:left-0',
|
|
12
|
+
"before:w-[3px] before:h-[calc(100%-6px)] before:m-[3px] before:rounded-[5px] before:bg-transparent"
|
|
13
|
+
),
|
|
14
|
+
crossBtn: i(
|
|
15
|
+
"absolute top-[7px] right-[15px] w-2.5 h-2.5 p-[5px] opacity-55 cursor-pointer",
|
|
16
|
+
'before:content-[""] before:absolute before:left-[9px] before:top-[5px] before:h-3 before:w-0.5 before:bg-[#575d67] before:rotate-[-45deg]',
|
|
17
|
+
'after:content-[""] after:absolute after:left-[9px] after:top-[5px] after:h-3 after:w-0.5 after:bg-[#575d67] after:rotate-45',
|
|
18
|
+
"hover:opacity-100"
|
|
19
|
+
),
|
|
20
|
+
btnsWrapper: "flex flex-row flex-nowrap mt-[5px]",
|
|
21
|
+
btn: "border-none rounded-[3px] text-[13px] py-[5px] px-2.5 cursor-pointer last:ml-2.5",
|
|
22
|
+
okBtn: "bg-[#34c992] shadow-[0_1px_1px_0_rgba(18,49,35,0.05)] text-white hover:bg-[#2db583]",
|
|
23
|
+
cancelBtn: "bg-[#f2f5f7] shadow-[0_2px_1px_0_rgba(16,19,29,0)] text-[#656b7c] hover:bg-[#e9ecee]",
|
|
24
|
+
input: i(
|
|
25
|
+
"max-w-[130px] py-[5px] px-2.5 bg-[#f7f7f7] border-0 rounded-[3px]",
|
|
26
|
+
"text-[13px] text-[#656b7c] outline-none",
|
|
27
|
+
"placeholder:text-[#656b7c] focus:placeholder:text-[rgba(101,107,124,0.3)]"
|
|
28
|
+
),
|
|
29
|
+
successNotification: i(
|
|
30
|
+
"!bg-[#fafffe]",
|
|
31
|
+
"before:!bg-[#41ffb1]"
|
|
32
|
+
),
|
|
33
|
+
errorNotification: i(
|
|
34
|
+
"!bg-[#fffbfb]",
|
|
35
|
+
"before:!bg-[#fb5d5d]"
|
|
36
|
+
),
|
|
37
|
+
bounceIn: "animate-notify-bounce-in"
|
|
38
|
+
}, d = (e) => {
|
|
39
|
+
const t = document.createElement("DIV"), o = document.createElement("DIV"), r = e.message, n = e.style, s = () => n === "success" ? a.successNotification : n === "error" ? a.errorNotification : "";
|
|
40
|
+
return t.className = f(a.notification, s()), n ? t.setAttribute("data-blok-testid", `notification-${n}`) : t.setAttribute("data-blok-testid", "notification"), t.innerHTML = r, o.className = a.crossBtn, o.setAttribute("data-blok-testid", "notification-cross"), o.addEventListener("click", () => t.remove()), t.appendChild(o), t;
|
|
41
|
+
}, p = (e) => {
|
|
42
|
+
const t = d(e), o = document.createElement("div"), r = document.createElement("button"), n = document.createElement("button"), s = t.querySelector('[data-blok-testid="notification-cross"]'), c = e.cancelHandler, l = e.okHandler;
|
|
43
|
+
return o.className = a.btnsWrapper, o.setAttribute("data-blok-testid", "notification-buttons-wrapper"), r.innerHTML = e.okText || "Confirm", n.innerHTML = e.cancelText || "Cancel", r.className = i(a.btn, a.okBtn), n.className = i(a.btn, a.cancelBtn), r.setAttribute("data-blok-testid", "notification-confirm-button"), n.setAttribute("data-blok-testid", "notification-cancel-button"), c && typeof c == "function" && n.addEventListener("click", c), c && typeof c == "function" && s && s.addEventListener("click", c), l && typeof l == "function" && r.addEventListener("click", l), r.addEventListener("click", () => t.remove()), n.addEventListener("click", () => t.remove()), o.appendChild(r), o.appendChild(n), t.appendChild(o), t;
|
|
44
|
+
}, b = (e) => {
|
|
45
|
+
const t = d(e), o = document.createElement("div"), r = document.createElement("button"), n = document.createElement("input"), s = t.querySelector('[data-blok-testid="notification-cross"]'), c = e.cancelHandler, l = e.okHandler;
|
|
46
|
+
return o.className = a.btnsWrapper, r.innerHTML = e.okText || "Ok", r.className = i(a.btn, a.okBtn), n.className = a.input, n.setAttribute("data-blok-testid", "notification-input"), e.placeholder && n.setAttribute("placeholder", e.placeholder), e.default && (n.value = e.default), e.inputType && (n.type = e.inputType), c && typeof c == "function" && s && s.addEventListener("click", c), l && typeof l == "function" && r.addEventListener("click", () => {
|
|
47
|
+
l(n.value);
|
|
48
|
+
}), r.addEventListener("click", () => t.remove()), o.appendChild(n), o.appendChild(r), t.appendChild(o), t;
|
|
49
|
+
}, u = () => {
|
|
50
|
+
const e = document.createElement("DIV");
|
|
51
|
+
return e.className = a.wrapper, e.setAttribute("data-blok-testid", "notifier-container"), e;
|
|
52
|
+
}, m = 8e3, x = () => {
|
|
53
|
+
const e = document.querySelector('[data-blok-testid="notifier-container"]');
|
|
54
|
+
if (e)
|
|
55
|
+
return e;
|
|
56
|
+
const t = u();
|
|
57
|
+
return document.body.appendChild(t), t;
|
|
58
|
+
}, k = (e) => {
|
|
59
|
+
if (!e.message)
|
|
60
|
+
return;
|
|
61
|
+
const t = x(), o = e.time || m, r = (() => {
|
|
62
|
+
switch (e.type) {
|
|
63
|
+
case "confirm":
|
|
64
|
+
return p(e);
|
|
65
|
+
case "prompt":
|
|
66
|
+
return b(e);
|
|
67
|
+
default: {
|
|
68
|
+
const n = d(e);
|
|
69
|
+
return window.setTimeout(() => {
|
|
70
|
+
n.remove();
|
|
71
|
+
}, o), n;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
})();
|
|
75
|
+
t && r && (t.appendChild(r), r.className = `${r.className} ${a.bounceIn}`, r.setAttribute("data-blok-bounce-in", "true"));
|
|
76
|
+
}, h = {
|
|
77
|
+
show: k
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
h as default,
|
|
81
|
+
k as show
|
|
82
|
+
};
|
package/dist/vendor.LICENSE.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Name: @babel/register
|
|
2
|
-
Version: 7.
|
|
2
|
+
Version: 7.28.3
|
|
3
3
|
License: MIT
|
|
4
4
|
Private: false
|
|
5
5
|
Description: babel require hook
|
|
@@ -32,14 +32,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
32
32
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
33
33
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
34
34
|
|
|
35
|
-
|
|
36
35
|
---
|
|
37
36
|
|
|
38
37
|
Name: nanoid
|
|
39
|
-
Version:
|
|
38
|
+
Version: 5.1.6
|
|
40
39
|
License: MIT
|
|
41
40
|
Private: false
|
|
42
|
-
Description: A tiny (
|
|
41
|
+
Description: A tiny (118 bytes), secure URL-friendly unique string ID generator
|
|
43
42
|
Repository: undefined
|
|
44
43
|
Author: Andrey Sitnik <andrey@sitnik.ru>
|
|
45
44
|
License Copyright:
|
|
@@ -66,7 +65,6 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
66
65
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
67
66
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
68
67
|
|
|
69
|
-
|
|
70
68
|
---
|
|
71
69
|
|
|
72
70
|
Name: lodash
|
|
@@ -131,6 +129,40 @@ maintained libraries used by this software which have their own
|
|
|
131
129
|
licenses; we recommend you read them, as their terms may differ from the
|
|
132
130
|
terms above.
|
|
133
131
|
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
Name: tailwind-merge
|
|
135
|
+
Version: 3.4.0
|
|
136
|
+
License: MIT
|
|
137
|
+
Private: false
|
|
138
|
+
Description: Merge Tailwind CSS classes without style conflicts
|
|
139
|
+
Repository: https://github.com/dcastil/tailwind-merge.git
|
|
140
|
+
Homepage: https://github.com/dcastil/tailwind-merge
|
|
141
|
+
Author: Dany Castillo
|
|
142
|
+
License Copyright:
|
|
143
|
+
===
|
|
144
|
+
|
|
145
|
+
MIT License
|
|
146
|
+
|
|
147
|
+
Copyright (c) 2021 Dany Castillo
|
|
148
|
+
|
|
149
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
150
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
151
|
+
in the Software without restriction, including without limitation the rights
|
|
152
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
153
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
154
|
+
furnished to do so, subject to the following conditions:
|
|
155
|
+
|
|
156
|
+
The above copyright notice and this permission notice shall be included in all
|
|
157
|
+
copies or substantial portions of the Software.
|
|
158
|
+
|
|
159
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
160
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
161
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
162
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
163
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
164
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
165
|
+
SOFTWARE.
|
|
134
166
|
|
|
135
167
|
---
|
|
136
168
|
|
|
@@ -344,20 +376,21 @@ Apache License
|
|
|
344
376
|
See the License for the specific language governing permissions and
|
|
345
377
|
limitations under the License.
|
|
346
378
|
|
|
347
|
-
|
|
348
379
|
---
|
|
349
380
|
|
|
350
|
-
Name:
|
|
351
|
-
Version:
|
|
381
|
+
Name: react
|
|
382
|
+
Version: 18.3.1
|
|
352
383
|
License: MIT
|
|
353
384
|
Private: false
|
|
354
|
-
|
|
385
|
+
Description: React is a JavaScript library for building user interfaces.
|
|
386
|
+
Repository: https://github.com/facebook/react.git
|
|
387
|
+
Homepage: https://reactjs.org/
|
|
355
388
|
License Copyright:
|
|
356
389
|
===
|
|
357
390
|
|
|
358
391
|
MIT License
|
|
359
392
|
|
|
360
|
-
Copyright (c)
|
|
393
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
361
394
|
|
|
362
395
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
363
396
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -377,23 +410,21 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
377
410
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
378
411
|
SOFTWARE.
|
|
379
412
|
|
|
380
|
-
|
|
381
413
|
---
|
|
382
414
|
|
|
383
|
-
Name:
|
|
384
|
-
Version:
|
|
415
|
+
Name: react-dom
|
|
416
|
+
Version: 18.3.1
|
|
385
417
|
License: MIT
|
|
386
418
|
Private: false
|
|
387
|
-
Description:
|
|
388
|
-
Repository:
|
|
389
|
-
Homepage: https://
|
|
390
|
-
Author: CodeX (https://codex.so)
|
|
419
|
+
Description: React package for working with the DOM.
|
|
420
|
+
Repository: https://github.com/facebook/react.git
|
|
421
|
+
Homepage: https://reactjs.org/
|
|
391
422
|
License Copyright:
|
|
392
423
|
===
|
|
393
424
|
|
|
394
425
|
MIT License
|
|
395
426
|
|
|
396
|
-
Copyright (c)
|
|
427
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
397
428
|
|
|
398
429
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
399
430
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -415,30 +446,37 @@ SOFTWARE.
|
|
|
415
446
|
|
|
416
447
|
---
|
|
417
448
|
|
|
418
|
-
Name:
|
|
419
|
-
Version:
|
|
449
|
+
Name: scheduler
|
|
450
|
+
Version: 0.23.2
|
|
420
451
|
License: MIT
|
|
421
452
|
Private: false
|
|
422
|
-
Description:
|
|
423
|
-
Repository:
|
|
453
|
+
Description: Cooperative scheduler for the browser environment.
|
|
454
|
+
Repository: https://github.com/facebook/react.git
|
|
455
|
+
Homepage: https://reactjs.org/
|
|
456
|
+
License Copyright:
|
|
457
|
+
===
|
|
424
458
|
|
|
425
|
-
|
|
459
|
+
MIT License
|
|
426
460
|
|
|
427
|
-
|
|
428
|
-
Version: 1.0.1
|
|
429
|
-
License: MIT
|
|
430
|
-
Private: false
|
|
431
|
-
Description: Utils useful for work with dom for Editor.js tools development
|
|
432
|
-
Repository: undefined
|
|
461
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
433
462
|
|
|
434
|
-
|
|
463
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
464
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
465
|
+
in the Software without restriction, including without limitation the rights
|
|
466
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
467
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
468
|
+
furnished to do so, subject to the following conditions:
|
|
435
469
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
470
|
+
The above copyright notice and this permission notice shall be included in all
|
|
471
|
+
copies or substantial portions of the Software.
|
|
472
|
+
|
|
473
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
474
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
475
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
476
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
477
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
478
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
479
|
+
SOFTWARE.
|
|
442
480
|
|
|
443
481
|
---
|
|
444
482
|
|
|
@@ -471,75 +509,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
471
509
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
472
510
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
473
511
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
474
|
-
SOFTWARE.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
---
|
|
478
|
-
|
|
479
|
-
Name: @editorjs/paragraph
|
|
480
|
-
Version: 2.11.6
|
|
481
|
-
License: MIT
|
|
482
|
-
Private: false
|
|
483
|
-
Description: Paragraph Tool for Editor.js
|
|
484
|
-
Repository: undefined
|
|
485
|
-
Author: CodeX <team@codex.so>
|
|
486
|
-
License Copyright:
|
|
487
|
-
===
|
|
488
|
-
|
|
489
|
-
MIT License
|
|
490
|
-
|
|
491
|
-
Copyright (c) 2018 CodeX
|
|
492
|
-
|
|
493
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
494
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
495
|
-
in the Software without restriction, including without limitation the rights
|
|
496
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
497
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
498
|
-
furnished to do so, subject to the following conditions:
|
|
499
|
-
|
|
500
|
-
The above copyright notice and this permission notice shall be included in all
|
|
501
|
-
copies or substantial portions of the Software.
|
|
502
|
-
|
|
503
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
504
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
505
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
506
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
507
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
508
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
509
|
-
SOFTWARE.
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
---
|
|
513
|
-
|
|
514
|
-
Name: codex-notifier
|
|
515
|
-
Version: 1.1.2
|
|
516
|
-
License: MIT
|
|
517
|
-
Private: false
|
|
518
|
-
Description: Simple notifications for your website
|
|
519
|
-
Repository: git+https://github.com/codex-team/js-notifier.git
|
|
520
|
-
Homepage: https://github.com/codex-team/js-notifier#readme
|
|
521
|
-
Author: CodeX Team <team@ifmo.su>
|
|
522
|
-
License Copyright:
|
|
523
|
-
===
|
|
524
|
-
|
|
525
|
-
MIT License
|
|
526
|
-
|
|
527
|
-
Copyright (c) 2017 CodeX
|
|
528
|
-
|
|
529
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
530
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
531
|
-
in the Software without restriction, including without limitation the rights
|
|
532
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
533
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
534
|
-
furnished to do so, subject to the following conditions:
|
|
535
|
-
|
|
536
|
-
The above copyright notice and this permission notice shall be included in all
|
|
537
|
-
copies or substantial portions of the Software.
|
|
538
|
-
|
|
539
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
540
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
541
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
542
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
543
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
544
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
545
512
|
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jackuait/blok",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.2.1-beta.0",
|
|
4
4
|
"description": "Blok — headless, highly extensible rich text editor built for developers who need to implement a block-based editing experience (similar to Notion) without building it from scratch",
|
|
5
5
|
"main": "dist/blok.umd.js",
|
|
6
6
|
"module": "dist/blok.mjs",
|
|
@@ -25,84 +25,88 @@
|
|
|
25
25
|
"serve": "vite --no-open",
|
|
26
26
|
"build": "vite build --mode production",
|
|
27
27
|
"build:test": "vite build --mode test",
|
|
28
|
-
"lint": "sh -c '
|
|
29
|
-
"lint:fix": "
|
|
30
|
-
"lint:tests": "
|
|
28
|
+
"lint": "sh -c 'eslint .; ESLINT_EXIT=$?; tsc --noEmit; TSC_EXIT=$?; if [ $ESLINT_EXIT -ne 0 ] || [ $TSC_EXIT -ne 0 ]; then exit 1; fi'",
|
|
29
|
+
"lint:fix": "eslint . --fix",
|
|
30
|
+
"lint:tests": "eslint test/",
|
|
31
31
|
"lint:types": "tsc --noEmit",
|
|
32
32
|
"e2e": "playwright test",
|
|
33
|
+
"e2e:chrome": "playwright test --project=chromium",
|
|
34
|
+
"e2e:firefox": "playwright test --project=firefox",
|
|
35
|
+
"e2e:safari": "playwright test --project=webkit",
|
|
33
36
|
"e2e:ui": "playwright test --ui",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
+
"e2e:ui:chrome": "playwright test --ui --project=chromium",
|
|
38
|
+
"e2e:ui:firefox": "playwright test --ui --project=firefox",
|
|
39
|
+
"e2e:ui:safari": "playwright test --ui --project=webkit",
|
|
40
|
+
"test": "vitest run --project=unit",
|
|
41
|
+
"test:watch": "vitest --project=unit",
|
|
42
|
+
"test:coverage": "vitest run --coverage --project=unit",
|
|
37
43
|
"jscpd": "jscpd src/ test/",
|
|
38
44
|
"jscpd:report": "jscpd . --reporters html,json --output .jscpd-report",
|
|
39
|
-
"prepublishOnly": "yarn build"
|
|
45
|
+
"prepublishOnly": "yarn build",
|
|
46
|
+
"storybook": "storybook dev -p 6006 --no-open",
|
|
47
|
+
"storybook:build": "storybook build",
|
|
48
|
+
"storybook:test": "vitest --project=storybook --run",
|
|
49
|
+
"chromatic": "chromatic --exit-zero-on-changes"
|
|
40
50
|
},
|
|
41
|
-
"author": "
|
|
51
|
+
"author": "JackUait",
|
|
42
52
|
"contributors": [
|
|
43
|
-
"
|
|
53
|
+
"CodeX (the author of initial solution)"
|
|
44
54
|
],
|
|
45
55
|
"license": "Apache-2.0",
|
|
46
56
|
"repository": {
|
|
47
57
|
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/JackUait/
|
|
58
|
+
"url": "git+https://github.com/JackUait/blok.git"
|
|
49
59
|
},
|
|
50
60
|
"devDependencies": {
|
|
51
61
|
"@axe-core/playwright": "4.11.0",
|
|
52
|
-
"@babel/register": "7.
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/sortablejs": "
|
|
64
|
-
"@vitest/
|
|
65
|
-
"@vitest/
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"eslint
|
|
70
|
-
"eslint-plugin-deprecation": "1.5.0",
|
|
62
|
+
"@babel/register": "7.28.3",
|
|
63
|
+
"@chromatic-com/storybook": "4.1.3",
|
|
64
|
+
"@playwright/test": "1.57.0",
|
|
65
|
+
"@storybook/addon-a11y": "10.1.1",
|
|
66
|
+
"@storybook/addon-vitest": "10.1.1",
|
|
67
|
+
"@storybook/global": "5.0.0",
|
|
68
|
+
"@storybook/html-vite": "10.1.1",
|
|
69
|
+
"@types/eslint-plugin-tailwindcss": "3",
|
|
70
|
+
"@types/node": "22.19.0",
|
|
71
|
+
"@types/react": "18.3.1",
|
|
72
|
+
"@types/react-dom": "18.3.1",
|
|
73
|
+
"@types/sortablejs": "1.15.9",
|
|
74
|
+
"@vitest/browser-playwright": "4.0.14",
|
|
75
|
+
"@vitest/coverage-v8": "4.0.14",
|
|
76
|
+
"@vitest/ui": "4.0.14",
|
|
77
|
+
"autoprefixer": "10.4.22",
|
|
78
|
+
"chromatic": "13.3.4",
|
|
79
|
+
"eslint": "9.39.1",
|
|
71
80
|
"eslint-plugin-import": "2.32.0",
|
|
72
|
-
"eslint-plugin-jest": "29.1
|
|
81
|
+
"eslint-plugin-jest": "29.2.1",
|
|
82
|
+
"eslint-plugin-jsdoc": "61.4.1",
|
|
73
83
|
"eslint-plugin-playwright": "2.3.0",
|
|
74
84
|
"eslint-plugin-sonarjs": "3.0.5",
|
|
85
|
+
"eslint-plugin-storybook": "10.1.1",
|
|
86
|
+
"eslint-plugin-tailwindcss": "3.18.2",
|
|
75
87
|
"html-janitor": "2.0.4",
|
|
76
88
|
"jscpd": "4.0.5",
|
|
77
|
-
"jsdom": "
|
|
78
|
-
"nanoid": "
|
|
79
|
-
"
|
|
80
|
-
"postcss
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"tslint": "6.1.
|
|
85
|
-
"typescript": "5.
|
|
86
|
-
"
|
|
89
|
+
"jsdom": "27.2.0",
|
|
90
|
+
"nanoid": "5.1.6",
|
|
91
|
+
"playwright": "1.57.0",
|
|
92
|
+
"postcss": "8.5.6",
|
|
93
|
+
"rollup-plugin-license": "3.6.0",
|
|
94
|
+
"storybook": "10.1.1",
|
|
95
|
+
"tailwindcss": "3",
|
|
96
|
+
"tslint": "6.1.3",
|
|
97
|
+
"typescript": "5.9.3",
|
|
98
|
+
"typescript-eslint": "8.48.0",
|
|
99
|
+
"vite": "7.2.4",
|
|
87
100
|
"vite-plugin-css-injected-by-js": "3.1.0",
|
|
88
|
-
"vitest": "
|
|
101
|
+
"vitest": "4.0.14",
|
|
102
|
+
"yaml": "2.8.1"
|
|
89
103
|
},
|
|
90
104
|
"dependencies": {
|
|
91
|
-
"@
|
|
92
|
-
"@types/lodash": "4.17.20",
|
|
93
|
-
"codex-notifier": "1.1.2",
|
|
105
|
+
"@types/lodash": "4.17.21",
|
|
94
106
|
"lodash": "4.17.21",
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
"@typescript-eslint/parser": "6.0.0",
|
|
100
|
-
"@typescript-eslint/typescript-estree": "6.0.0",
|
|
101
|
-
"@typescript-eslint/scope-manager": "6.0.0",
|
|
102
|
-
"@typescript-eslint/types": "6.0.0",
|
|
103
|
-
"@typescript-eslint/utils": "6.0.0",
|
|
104
|
-
"@typescript-eslint/visitor-keys": "6.0.0",
|
|
105
|
-
"@typescript-eslint/type-utils": "6.0.0",
|
|
106
|
-
"eslint-plugin-jsdoc": "48.0.0"
|
|
107
|
+
"react": "18.3.1",
|
|
108
|
+
"react-dom": "18.3.1",
|
|
109
|
+
"sortablejs": "1.15.6",
|
|
110
|
+
"tailwind-merge": "3.4.0"
|
|
107
111
|
}
|
|
108
112
|
}
|
package/types/api/block.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface BlockAPI {
|
|
|
16
16
|
readonly name: string;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Tool config passed on
|
|
19
|
+
* Tool config passed on Blok's initialization
|
|
20
20
|
*/
|
|
21
21
|
readonly config: ToolConfig;
|
|
22
22
|
|
|
@@ -74,8 +74,8 @@ export interface BlockAPI {
|
|
|
74
74
|
validate(data: BlockToolData): Promise<boolean>;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
* Allows to say
|
|
78
|
-
* Can be useful for block changes invisible for
|
|
77
|
+
* Allows to say Blok that an element was changed. Used to manually trigger Blok's 'onChange' callback
|
|
78
|
+
* Can be useful for block changes invisible for blok core.
|
|
79
79
|
*/
|
|
80
80
|
dispatchChange(): void;
|
|
81
81
|
|
package/types/api/blocks.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import {BlockAPI} from './block';
|
|
|
4
4
|
import {BlockTuneData} from '../block-tunes/block-tune-data';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Describes methods to manipulate with
|
|
7
|
+
* Describes methods to manipulate with Blok`s blocks
|
|
8
8
|
*/
|
|
9
9
|
export interface Blocks {
|
|
10
10
|
/**
|
|
11
|
-
* Remove all blocks from
|
|
11
|
+
* Remove all blocks from Blok zone
|
|
12
12
|
*/
|
|
13
13
|
clear(): Promise<void>;
|
|
14
14
|
|
package/types/api/caret.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlockAPI } from "./block";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Describes
|
|
4
|
+
* Describes Blok`s caret API
|
|
5
5
|
*/
|
|
6
6
|
export interface Caret {
|
|
7
7
|
|
|
@@ -57,9 +57,9 @@ export interface Caret {
|
|
|
57
57
|
setToBlock(blockOrIdOrIndex: BlockAPI | BlockAPI['id'] | number, position?: 'end'|'start'|'default', offset?: number): boolean;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Sets caret to the
|
|
60
|
+
* Sets caret to the Blok
|
|
61
61
|
*
|
|
62
|
-
* @param {boolean} atEnd - if true, set Caret to the end of the
|
|
62
|
+
* @param {boolean} atEnd - if true, set Caret to the end of the Blok
|
|
63
63
|
*
|
|
64
64
|
* @return {boolean}
|
|
65
65
|
*/
|
package/types/api/events.d.ts
CHANGED
package/types/api/i18n.d.ts
CHANGED
package/types/api/listeners.d.ts
CHANGED
package/types/api/notifier.d.ts
CHANGED
package/types/api/sanitizer.d.ts
CHANGED
package/types/api/saver.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {OutputData} from '../data-formats/output-data';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Describes
|
|
4
|
+
* Describes Blok`s saver API
|
|
5
5
|
*/
|
|
6
6
|
export interface Saver {
|
|
7
7
|
/**
|
|
8
|
-
* Saves
|
|
8
|
+
* Saves Blok's data and returns promise with it
|
|
9
9
|
*
|
|
10
10
|
* @returns {Promise<OutputData>}
|
|
11
11
|
*/
|