@innovastudio/contentbox 1.6.180 → 1.6.181
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/index.d.ts +65 -0
- package/package.json +2 -2
- package/public/contentbox/contentbox.css +116 -18
- package/public/contentbox/contentbox.esm.js +3836 -1044
- package/public/contentbox/contentbox.min.js +11 -11
- package/public/contentbox/lang/en.js +17 -0
- package/readme.txt +1 -1
package/index.d.ts
CHANGED
|
@@ -128,6 +128,15 @@ interface ContentBoxOptions {
|
|
|
128
128
|
onRender?: () => void;
|
|
129
129
|
onChange?: () => void;
|
|
130
130
|
onStart?: () => void;
|
|
131
|
+
|
|
132
|
+
onAddSection?: () => void;
|
|
133
|
+
onPageClick?: () => void;
|
|
134
|
+
sectionListSelector?: string;
|
|
135
|
+
snippetListSelector?: string;
|
|
136
|
+
typographyListSelector?: string;
|
|
137
|
+
leftOffset?: string;
|
|
138
|
+
topOffset?: string;
|
|
139
|
+
tooltipScope?: string;
|
|
131
140
|
|
|
132
141
|
onImageBrowseClick?: () => void;
|
|
133
142
|
onImageSettingClick?: () => void;
|
|
@@ -388,6 +397,12 @@ interface ContentBoxOptions {
|
|
|
388
397
|
maxAutoSaveInterval?: number;
|
|
389
398
|
minAutoSaveInterval?: number;
|
|
390
399
|
autoSave?: () => void | Promise<void>;
|
|
400
|
+
|
|
401
|
+
onLoadHtml?: () => void | Promise<void>;
|
|
402
|
+
iframeDragDrop?: boolean;
|
|
403
|
+
|
|
404
|
+
activeStyleOffset?: number;
|
|
405
|
+
contentStylesVersion?: number;
|
|
391
406
|
}
|
|
392
407
|
|
|
393
408
|
interface OpenModalOptions {
|
|
@@ -400,6 +415,15 @@ interface OpenModalOptions {
|
|
|
400
415
|
onClose?: (modal: HTMLElement, iframe: HTMLIFrameElement) => void; // callback when closed
|
|
401
416
|
}
|
|
402
417
|
|
|
418
|
+
interface LoadAssetOptions {
|
|
419
|
+
retries?: number;
|
|
420
|
+
retryDelay?: number;
|
|
421
|
+
}
|
|
422
|
+
interface InlineScriptOptions {
|
|
423
|
+
retries?: number;
|
|
424
|
+
retryDelay?: number;
|
|
425
|
+
}
|
|
426
|
+
|
|
403
427
|
declare class ContentBox {
|
|
404
428
|
constructor(options: ContentBoxOptions);
|
|
405
429
|
|
|
@@ -438,5 +462,46 @@ declare class ContentBox {
|
|
|
438
462
|
btn?: HTMLElement
|
|
439
463
|
): void;
|
|
440
464
|
openIconPicker(callback: (iconHtml: string) => void): void;
|
|
465
|
+
loadSectionList(): void;
|
|
466
|
+
loadTypographyList(): void;
|
|
467
|
+
addSection(html: string): void;
|
|
468
|
+
|
|
469
|
+
loadAsset(
|
|
470
|
+
id: string,
|
|
471
|
+
tag: 'script' | 'link',
|
|
472
|
+
attrs: Record<string, any>,
|
|
473
|
+
options?: LoadAssetOptions
|
|
474
|
+
): Promise<HTMLElement>;
|
|
475
|
+
|
|
476
|
+
loadInlineScript(
|
|
477
|
+
id: string,
|
|
478
|
+
code: string,
|
|
479
|
+
options?: InlineScriptOptions
|
|
480
|
+
): Promise<HTMLScriptElement>;
|
|
481
|
+
|
|
482
|
+
runInlineScript(
|
|
483
|
+
id: string,
|
|
484
|
+
code: string,
|
|
485
|
+
options?: InlineScriptOptions
|
|
486
|
+
): Promise<HTMLScriptElement>;
|
|
487
|
+
|
|
488
|
+
onLoadHtml?: () => void | Promise<void>;
|
|
489
|
+
|
|
490
|
+
setTopContentProvider(provider: (() => string) | null): void;
|
|
491
|
+
setBottomContentProvider(provider: (() => string) | null): void;
|
|
492
|
+
|
|
493
|
+
setTypographyStyleScope(scope: string): void;
|
|
494
|
+
|
|
495
|
+
applyDragDropBlocks(snippetList: HTMLElement): void;
|
|
496
|
+
|
|
497
|
+
getActiveSectionHtml(numOfSections?: number): string;
|
|
498
|
+
|
|
499
|
+
applyTypographyStyle(className: string, cssFile?: string): void;
|
|
500
|
+
applyInlineTypographyStyle(className: string, cssText: string): void;
|
|
501
|
+
getInlineTypographyStyle(classname: string): string | null;
|
|
502
|
+
|
|
503
|
+
confirm(message: string, yesText?: string): Promise<boolean>;
|
|
504
|
+
|
|
505
|
+
refresh(): void;
|
|
441
506
|
}
|
|
442
507
|
export default ContentBox;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovastudio/contentbox",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.181",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ws": "^8.13.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@innovastudio/contentbuilder": "^1.5.
|
|
62
|
+
"@innovastudio/contentbuilder": "^1.5.209",
|
|
63
63
|
"js-beautify": "^1.14.0",
|
|
64
64
|
"marked": "^17.0.0",
|
|
65
65
|
"sortablejs": "^1.15.2"
|
|
@@ -4,7 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
@import url("https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.0/css/ionicons.min.css");
|
|
6
6
|
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
|
|
7
|
+
:root {
|
|
8
|
+
--focus-outline-color: #3e93f7;
|
|
9
|
+
--rangeslider-thumb-color: #0e75de;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
/* IFRAME */
|
|
13
|
+
@media (max-width: 1366px) {
|
|
14
|
+
button[data-device=desktop-lg] {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
button[data-device=desktop] svg {
|
|
19
|
+
width: 1.2rem !important;
|
|
20
|
+
height: 1.2rem !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
8
23
|
.is-content-view.desktop-lg {
|
|
9
24
|
width: 1920px;
|
|
10
25
|
height: 1080px;
|
|
@@ -978,7 +993,7 @@ body.controlpanel .is-content-view.mobile {
|
|
|
978
993
|
border-radius: 4px;
|
|
979
994
|
}
|
|
980
995
|
.builder-ui .panel-plugin div[contenteditable=true]:focus-visible {
|
|
981
|
-
outline:
|
|
996
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
982
997
|
}
|
|
983
998
|
.builder-ui .panel-plugin button {
|
|
984
999
|
background-color: rgb(239, 239, 239);
|
|
@@ -994,6 +1009,14 @@ body.controlpanel .is-content-view.mobile {
|
|
|
994
1009
|
font-size: 14px;
|
|
995
1010
|
padding: 10px 13px;
|
|
996
1011
|
}
|
|
1012
|
+
.builder-ui .panel-plugin label {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
font-size: 14px;
|
|
1015
|
+
line-height: 1.6;
|
|
1016
|
+
}
|
|
1017
|
+
.builder-ui .panel-plugin .cb-settings-form {
|
|
1018
|
+
margin-top: 20px;
|
|
1019
|
+
}
|
|
997
1020
|
.builder-ui .flex-unit {
|
|
998
1021
|
display: flex;
|
|
999
1022
|
gap: 15px;
|
|
@@ -1128,7 +1151,7 @@ body.controlpanel .is-content-view.mobile {
|
|
|
1128
1151
|
.builder-ui textarea:focus,
|
|
1129
1152
|
.builder-ui select:focus,
|
|
1130
1153
|
.builder-ui div[contenteditable=true]:focus {
|
|
1131
|
-
outline:
|
|
1154
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
1132
1155
|
outline-offset: 0;
|
|
1133
1156
|
box-shadow: none;
|
|
1134
1157
|
}
|
|
@@ -1239,7 +1262,7 @@ body.controlpanel .is-content-view.mobile {
|
|
|
1239
1262
|
margin-top: 3px;
|
|
1240
1263
|
}
|
|
1241
1264
|
.builder-ui .custom-select .select-styled:focus-visible {
|
|
1242
|
-
outline:
|
|
1265
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
1243
1266
|
outline-offset: -1px;
|
|
1244
1267
|
}
|
|
1245
1268
|
.builder-ui .custom-select .select-styled > span:first-child {
|
|
@@ -1351,6 +1374,81 @@ body.controlpanel .is-wrapper {
|
|
|
1351
1374
|
margin-left: 0 !important;
|
|
1352
1375
|
}
|
|
1353
1376
|
|
|
1377
|
+
/* Typography Selection */
|
|
1378
|
+
.typography-list {
|
|
1379
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
1380
|
+
font-weight: 300;
|
|
1381
|
+
display: flex;
|
|
1382
|
+
flex-direction: column;
|
|
1383
|
+
gap: 30px;
|
|
1384
|
+
padding-top: 43px !important;
|
|
1385
|
+
padding-bottom: 25px !important;
|
|
1386
|
+
}
|
|
1387
|
+
.typography-list > div {
|
|
1388
|
+
width: 100%;
|
|
1389
|
+
display: flex;
|
|
1390
|
+
flex-direction: column;
|
|
1391
|
+
color: #000;
|
|
1392
|
+
border: rgba(205, 205, 205, 0.62) 1px solid;
|
|
1393
|
+
box-shadow: 0px 7px 10px -6px rgba(0, 0, 0, 0.08);
|
|
1394
|
+
position: relative;
|
|
1395
|
+
cursor: pointer;
|
|
1396
|
+
aspect-ratio: 4/4.6;
|
|
1397
|
+
}
|
|
1398
|
+
.typography-list > div div:first-child {
|
|
1399
|
+
text-align: center;
|
|
1400
|
+
position: absolute;
|
|
1401
|
+
background: transparent;
|
|
1402
|
+
top: -28px;
|
|
1403
|
+
left: 0;
|
|
1404
|
+
width: 100%;
|
|
1405
|
+
font-size: 12px;
|
|
1406
|
+
line-height: 1.4;
|
|
1407
|
+
z-index: 1;
|
|
1408
|
+
}
|
|
1409
|
+
.typography-list > div img {
|
|
1410
|
+
width: 100%;
|
|
1411
|
+
height: auto;
|
|
1412
|
+
min-height: 200px;
|
|
1413
|
+
-webkit-transition: all 0.16s ease;
|
|
1414
|
+
transition: all 0.16s ease;
|
|
1415
|
+
width: 100%;
|
|
1416
|
+
height: 100%;
|
|
1417
|
+
object-fit: cover;
|
|
1418
|
+
}
|
|
1419
|
+
.typography-list .is-overlay {
|
|
1420
|
+
position: absolute;
|
|
1421
|
+
left: 0px;
|
|
1422
|
+
top: 0px;
|
|
1423
|
+
width: 100%;
|
|
1424
|
+
height: 100%;
|
|
1425
|
+
}
|
|
1426
|
+
.typography-list > div .is-overlay:after {
|
|
1427
|
+
background: rgba(0, 0, 0, 0.03);
|
|
1428
|
+
position: absolute;
|
|
1429
|
+
content: "";
|
|
1430
|
+
display: block;
|
|
1431
|
+
top: 0;
|
|
1432
|
+
left: 0;
|
|
1433
|
+
right: 0;
|
|
1434
|
+
bottom: 0;
|
|
1435
|
+
transition: all 0.3s ease-in-out;
|
|
1436
|
+
opacity: 0;
|
|
1437
|
+
}
|
|
1438
|
+
.typography-list > div:hover .is-overlay:after {
|
|
1439
|
+
opacity: 0.9;
|
|
1440
|
+
}
|
|
1441
|
+
.typography-list > div.active img {
|
|
1442
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
1443
|
+
transition: none !important;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.is-design-list,
|
|
1447
|
+
.typography-list {
|
|
1448
|
+
scrollbar-width: thin;
|
|
1449
|
+
scrollbar-color: rgba(0, 0, 0, 0.2) transparent !important;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1354
1452
|
.builder-ui .is-controlpanel {
|
|
1355
1453
|
background-color: #fff;
|
|
1356
1454
|
position: fixed;
|
|
@@ -1653,20 +1751,20 @@ body.controlpanel .is-wrapper {
|
|
|
1653
1751
|
width: auto;
|
|
1654
1752
|
padding: 0 14px;
|
|
1655
1753
|
}
|
|
1656
|
-
.builder-ui .is-controlpanel .group.imageeffect, .builder-ui .is-controlpanel .group.aspectratio, .builder-ui .is-controlpanel .group.duration, .builder-ui .is-controlpanel .group.
|
|
1754
|
+
.builder-ui .is-controlpanel .group.imageeffect, .builder-ui .is-controlpanel .group.aspectratio, .builder-ui .is-controlpanel .group.duration, .builder-ui .is-controlpanel .group.topspacing {
|
|
1657
1755
|
width: 225px;
|
|
1658
1756
|
}
|
|
1659
|
-
.builder-ui .is-controlpanel .group.imageeffect button, .builder-ui .is-controlpanel .group.aspectratio button, .builder-ui .is-controlpanel .group.duration button, .builder-ui .is-controlpanel .group.
|
|
1757
|
+
.builder-ui .is-controlpanel .group.imageeffect button, .builder-ui .is-controlpanel .group.aspectratio button, .builder-ui .is-controlpanel .group.duration button, .builder-ui .is-controlpanel .group.topspacing button {
|
|
1660
1758
|
width: 50px;
|
|
1661
1759
|
transition: all 0.15s ease;
|
|
1662
1760
|
}
|
|
1663
|
-
.builder-ui .is-controlpanel .group.imageeffect button.active, .builder-ui .is-controlpanel .group.aspectratio button.active, .builder-ui .is-controlpanel .group.duration button.active, .builder-ui .is-controlpanel .group.
|
|
1761
|
+
.builder-ui .is-controlpanel .group.imageeffect button.active, .builder-ui .is-controlpanel .group.aspectratio button.active, .builder-ui .is-controlpanel .group.duration button.active, .builder-ui .is-controlpanel .group.topspacing button.active {
|
|
1664
1762
|
background-color: rgb(233, 233, 233);
|
|
1665
1763
|
}
|
|
1666
|
-
.builder-ui .is-controlpanel .group.imageeffect button.active:hover, .builder-ui .is-controlpanel .group.aspectratio button.active:hover, .builder-ui .is-controlpanel .group.duration button.active:hover, .builder-ui .is-controlpanel .group.
|
|
1764
|
+
.builder-ui .is-controlpanel .group.imageeffect button.active:hover, .builder-ui .is-controlpanel .group.aspectratio button.active:hover, .builder-ui .is-controlpanel .group.duration button.active:hover, .builder-ui .is-controlpanel .group.topspacing button.active:hover {
|
|
1667
1765
|
background-color: rgb(235, 235, 235);
|
|
1668
1766
|
}
|
|
1669
|
-
.builder-ui .is-controlpanel .group.imageeffect button:hover, .builder-ui .is-controlpanel .group.aspectratio button:hover, .builder-ui .is-controlpanel .group.duration button:hover, .builder-ui .is-controlpanel .group.
|
|
1767
|
+
.builder-ui .is-controlpanel .group.imageeffect button:hover, .builder-ui .is-controlpanel .group.aspectratio button:hover, .builder-ui .is-controlpanel .group.duration button:hover, .builder-ui .is-controlpanel .group.topspacing button:hover {
|
|
1670
1768
|
background-color: rgb(243, 244, 246);
|
|
1671
1769
|
}
|
|
1672
1770
|
.builder-ui .is-controlpanel .group.imageeffect button {
|
|
@@ -1675,7 +1773,7 @@ body.controlpanel .is-wrapper {
|
|
|
1675
1773
|
.builder-ui .is-controlpanel .group.duration button {
|
|
1676
1774
|
width: 39px;
|
|
1677
1775
|
}
|
|
1678
|
-
.builder-ui .is-controlpanel .group.
|
|
1776
|
+
.builder-ui .is-controlpanel .group.topspacing button {
|
|
1679
1777
|
width: 39px;
|
|
1680
1778
|
}
|
|
1681
1779
|
.builder-ui .is-controlpanel button.toggle {
|
|
@@ -1963,7 +2061,7 @@ body.controlpanel .is-wrapper {
|
|
|
1963
2061
|
opacity: 1;
|
|
1964
2062
|
}
|
|
1965
2063
|
.is-rangeslider:focus {
|
|
1966
|
-
outline:
|
|
2064
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
1967
2065
|
outline-offset: 2px;
|
|
1968
2066
|
}
|
|
1969
2067
|
.is-rangeslider::-webkit-slider-thumb {
|
|
@@ -1972,7 +2070,7 @@ body.controlpanel .is-wrapper {
|
|
|
1972
2070
|
width: 25px !important;
|
|
1973
2071
|
height: 24px !important;
|
|
1974
2072
|
border-radius: 3px !important;
|
|
1975
|
-
background:
|
|
2073
|
+
background: var(--rangeslider-thumb-color);
|
|
1976
2074
|
cursor: pointer;
|
|
1977
2075
|
margin: 0 !important;
|
|
1978
2076
|
}
|
|
@@ -1980,7 +2078,7 @@ body.controlpanel .is-wrapper {
|
|
|
1980
2078
|
width: 25px !important;
|
|
1981
2079
|
height: 24px !important;
|
|
1982
2080
|
border-radius: 3px !important;
|
|
1983
|
-
background:
|
|
2081
|
+
background: var(--rangeslider-thumb-color);
|
|
1984
2082
|
cursor: pointer;
|
|
1985
2083
|
margin: 0 !important;
|
|
1986
2084
|
}
|
|
@@ -2325,13 +2423,13 @@ body.frame-center.controlpanel .is-content-view {
|
|
|
2325
2423
|
.dark .builder-ui .is-controlpanel .panel-dialog.blocks .div-blocks > div {
|
|
2326
2424
|
outline: #d5d5d5 1px solid;
|
|
2327
2425
|
}
|
|
2328
|
-
.dark .builder-ui .is-controlpanel .group.imageeffect button.active, .dark .builder-ui .is-controlpanel .group.aspectratio button.active, .dark .builder-ui .is-controlpanel .group.duration button.active, .dark .builder-ui .is-controlpanel .group.
|
|
2426
|
+
.dark .builder-ui .is-controlpanel .group.imageeffect button.active, .dark .builder-ui .is-controlpanel .group.aspectratio button.active, .dark .builder-ui .is-controlpanel .group.duration button.active, .dark .builder-ui .is-controlpanel .group.topspacing button.active {
|
|
2329
2427
|
background-color: rgb(69, 69, 69);
|
|
2330
2428
|
}
|
|
2331
|
-
.dark .builder-ui .is-controlpanel .group.imageeffect button.active:hover, .dark .builder-ui .is-controlpanel .group.aspectratio button.active:hover, .dark .builder-ui .is-controlpanel .group.duration button.active:hover, .dark .builder-ui .is-controlpanel .group.
|
|
2429
|
+
.dark .builder-ui .is-controlpanel .group.imageeffect button.active:hover, .dark .builder-ui .is-controlpanel .group.aspectratio button.active:hover, .dark .builder-ui .is-controlpanel .group.duration button.active:hover, .dark .builder-ui .is-controlpanel .group.topspacing button.active:hover {
|
|
2332
2430
|
background-color: rgb(64, 64, 64);
|
|
2333
2431
|
}
|
|
2334
|
-
.dark .builder-ui .is-controlpanel .group.imageeffect button:hover, .dark .builder-ui .is-controlpanel .group.aspectratio button:hover, .dark .builder-ui .is-controlpanel .group.duration button:hover, .dark .builder-ui .is-controlpanel .group.
|
|
2432
|
+
.dark .builder-ui .is-controlpanel .group.imageeffect button:hover, .dark .builder-ui .is-controlpanel .group.aspectratio button:hover, .dark .builder-ui .is-controlpanel .group.duration button:hover, .dark .builder-ui .is-controlpanel .group.topspacing button:hover {
|
|
2335
2433
|
background-color: rgb(59, 59, 59);
|
|
2336
2434
|
}
|
|
2337
2435
|
.dark .builder-ui .is-controlpanel .group button.toggle {
|
|
@@ -2716,7 +2814,7 @@ body.frame-center.controlpanel .is-content-view {
|
|
|
2716
2814
|
margin: 30px 0 70px;
|
|
2717
2815
|
display: flex;
|
|
2718
2816
|
color: #000;
|
|
2719
|
-
border: rgba(205, 205, 205, 0.
|
|
2817
|
+
border: rgba(205, 205, 205, 0.75) 1px solid;
|
|
2720
2818
|
box-shadow: 0px 7px 10px -6px rgba(0, 0, 0, 0.08);
|
|
2721
2819
|
position: relative;
|
|
2722
2820
|
cursor: pointer;
|
|
@@ -2779,7 +2877,7 @@ body.frame-center.controlpanel .is-content-view {
|
|
|
2779
2877
|
}
|
|
2780
2878
|
|
|
2781
2879
|
#divStyles > div.active img {
|
|
2782
|
-
outline:
|
|
2880
|
+
outline: var(--focus-outline-color) 2px solid;
|
|
2783
2881
|
transition: none !important;
|
|
2784
2882
|
}
|
|
2785
2883
|
|
|
@@ -3031,7 +3129,7 @@ body.frame-center.controlpanel .is-content-view {
|
|
|
3031
3129
|
}
|
|
3032
3130
|
|
|
3033
3131
|
.ai-disclaimer .input-ok:focus {
|
|
3034
|
-
outline:
|
|
3132
|
+
outline: var(--focus-outline-color) 2px solid !important;
|
|
3035
3133
|
outline-offset: 2px !important;
|
|
3036
3134
|
}
|
|
3037
3135
|
|