@innovastudio/contentbox 1.6.179 → 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 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.179",
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.192",
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;
@@ -906,6 +921,7 @@ body.controlpanel .is-content-view.mobile {
906
921
  font-weight: inherit;
907
922
  letter-spacing: inherit;
908
923
  line-height: 1;
924
+ transition: all 0.15s ease;
909
925
  }
910
926
  .builder-ui button.auto {
911
927
  width: auto;
@@ -938,8 +954,11 @@ body.controlpanel .is-content-view.mobile {
938
954
  .builder-ui button.on {
939
955
  background-color: rgb(237, 237, 237);
940
956
  }
957
+ .builder-ui button.on:hover {
958
+ background-color: rgb(239, 239, 239);
959
+ }
941
960
  .builder-ui button:not(.is-btn-color):hover {
942
- background-color: rgb(237, 237, 237);
961
+ background-color: rgb(243, 244, 246);
943
962
  }
944
963
  .builder-ui .panel-plugin .is-accordion {
945
964
  display: flex;
@@ -974,7 +993,7 @@ body.controlpanel .is-content-view.mobile {
974
993
  border-radius: 4px;
975
994
  }
976
995
  .builder-ui .panel-plugin div[contenteditable=true]:focus-visible {
977
- outline: #3e93f7 2px solid;
996
+ outline: var(--focus-outline-color) 2px solid;
978
997
  }
979
998
  .builder-ui .panel-plugin button {
980
999
  background-color: rgb(239, 239, 239);
@@ -990,6 +1009,14 @@ body.controlpanel .is-content-view.mobile {
990
1009
  font-size: 14px;
991
1010
  padding: 10px 13px;
992
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
+ }
993
1020
  .builder-ui .flex-unit {
994
1021
  display: flex;
995
1022
  gap: 15px;
@@ -1124,7 +1151,7 @@ body.controlpanel .is-content-view.mobile {
1124
1151
  .builder-ui textarea:focus,
1125
1152
  .builder-ui select:focus,
1126
1153
  .builder-ui div[contenteditable=true]:focus {
1127
- outline: #3e93f7 2px solid;
1154
+ outline: var(--focus-outline-color) 2px solid;
1128
1155
  outline-offset: 0;
1129
1156
  box-shadow: none;
1130
1157
  }
@@ -1235,7 +1262,7 @@ body.controlpanel .is-content-view.mobile {
1235
1262
  margin-top: 3px;
1236
1263
  }
1237
1264
  .builder-ui .custom-select .select-styled:focus-visible {
1238
- outline: #3e93f7 2px solid;
1265
+ outline: var(--focus-outline-color) 2px solid;
1239
1266
  outline-offset: -1px;
1240
1267
  }
1241
1268
  .builder-ui .custom-select .select-styled > span:first-child {
@@ -1347,6 +1374,81 @@ body.controlpanel .is-wrapper {
1347
1374
  margin-left: 0 !important;
1348
1375
  }
1349
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
+
1350
1452
  .builder-ui .is-controlpanel {
1351
1453
  background-color: #fff;
1352
1454
  position: fixed;
@@ -1649,6 +1751,44 @@ body.controlpanel .is-wrapper {
1649
1751
  width: auto;
1650
1752
  padding: 0 14px;
1651
1753
  }
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 {
1755
+ width: 225px;
1756
+ }
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 {
1758
+ width: 50px;
1759
+ transition: all 0.15s ease;
1760
+ }
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 {
1762
+ background-color: rgb(233, 233, 233);
1763
+ }
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 {
1765
+ background-color: rgb(235, 235, 235);
1766
+ }
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 {
1768
+ background-color: rgb(243, 244, 246);
1769
+ }
1770
+ .builder-ui .is-controlpanel .group.imageeffect button {
1771
+ width: 105px;
1772
+ }
1773
+ .builder-ui .is-controlpanel .group.duration button {
1774
+ width: 39px;
1775
+ }
1776
+ .builder-ui .is-controlpanel .group.topspacing button {
1777
+ width: 39px;
1778
+ }
1779
+ .builder-ui .is-controlpanel button.toggle {
1780
+ width: 36px;
1781
+ transition: all 0.15s ease;
1782
+ }
1783
+ .builder-ui .is-controlpanel button.toggle.active {
1784
+ background-color: rgb(233, 233, 233);
1785
+ }
1786
+ .builder-ui .is-controlpanel button.toggle.active:hover {
1787
+ background-color: rgb(235, 235, 235);
1788
+ }
1789
+ .builder-ui .is-controlpanel button.toggle:hover {
1790
+ background-color: rgb(243, 244, 246);
1791
+ }
1652
1792
  .builder-ui .is-controlpanel .label.changedevice {
1653
1793
  display: flex;
1654
1794
  flex-direction: row;
@@ -1921,7 +2061,7 @@ body.controlpanel .is-wrapper {
1921
2061
  opacity: 1;
1922
2062
  }
1923
2063
  .is-rangeslider:focus {
1924
- outline: #3e93f7 2px solid;
2064
+ outline: var(--focus-outline-color) 2px solid;
1925
2065
  outline-offset: 2px;
1926
2066
  }
1927
2067
  .is-rangeslider::-webkit-slider-thumb {
@@ -1930,7 +2070,7 @@ body.controlpanel .is-wrapper {
1930
2070
  width: 25px !important;
1931
2071
  height: 24px !important;
1932
2072
  border-radius: 3px !important;
1933
- background: #0e75de;
2073
+ background: var(--rangeslider-thumb-color);
1934
2074
  cursor: pointer;
1935
2075
  margin: 0 !important;
1936
2076
  }
@@ -1938,7 +2078,7 @@ body.controlpanel .is-wrapper {
1938
2078
  width: 25px !important;
1939
2079
  height: 24px !important;
1940
2080
  border-radius: 3px !important;
1941
- background: #0e75de;
2081
+ background: var(--rangeslider-thumb-color);
1942
2082
  cursor: pointer;
1943
2083
  margin: 0 !important;
1944
2084
  }
@@ -2221,11 +2361,14 @@ body.frame-center.controlpanel .is-content-view {
2221
2361
  .dark .builder-ui button.is-btn-color {
2222
2362
  border: 1px solid transparent;
2223
2363
  }
2224
- .dark .builder-ui button.on {
2364
+ .dark .builder-ui button:not(.is-btn-color).on {
2225
2365
  background-color: rgb(69, 69, 69);
2226
2366
  }
2367
+ .dark .builder-ui button:not(.is-btn-color).on:hover {
2368
+ background-color: rgb(64, 64, 64);
2369
+ }
2227
2370
  .dark .builder-ui button:not(.is-btn-color):hover {
2228
- background-color: rgb(69, 69, 69);
2371
+ background-color: rgb(59, 59, 59);
2229
2372
  }
2230
2373
  .dark .builder-ui .panel-plugin .is-accordion > div {
2231
2374
  border: 1px solid #6e6e6e;
@@ -2280,6 +2423,28 @@ body.frame-center.controlpanel .is-content-view {
2280
2423
  .dark .builder-ui .is-controlpanel .panel-dialog.blocks .div-blocks > div {
2281
2424
  outline: #d5d5d5 1px solid;
2282
2425
  }
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 {
2427
+ background-color: rgb(69, 69, 69);
2428
+ }
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 {
2430
+ background-color: rgb(64, 64, 64);
2431
+ }
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 {
2433
+ background-color: rgb(59, 59, 59);
2434
+ }
2435
+ .dark .builder-ui .is-controlpanel .group button.toggle {
2436
+ width: 36px;
2437
+ transition: all 0.15s ease;
2438
+ }
2439
+ .dark .builder-ui .is-controlpanel .group button.toggle.active {
2440
+ background-color: rgb(69, 69, 69);
2441
+ }
2442
+ .dark .builder-ui .is-controlpanel .group button.toggle.active:hover {
2443
+ background-color: rgb(64, 64, 64);
2444
+ }
2445
+ .dark .builder-ui .is-controlpanel .group button.toggle:hover {
2446
+ background-color: rgb(59, 59, 59);
2447
+ }
2283
2448
  .dark .builder-ui .custom-select {
2284
2449
  --cs-height: 46px;
2285
2450
  --cs-border: 1px solid #5e5e5e;
@@ -2649,7 +2814,7 @@ body.frame-center.controlpanel .is-content-view {
2649
2814
  margin: 30px 0 70px;
2650
2815
  display: flex;
2651
2816
  color: #000;
2652
- border: rgba(205, 205, 205, 0.32) 1px solid;
2817
+ border: rgba(205, 205, 205, 0.75) 1px solid;
2653
2818
  box-shadow: 0px 7px 10px -6px rgba(0, 0, 0, 0.08);
2654
2819
  position: relative;
2655
2820
  cursor: pointer;
@@ -2712,7 +2877,7 @@ body.frame-center.controlpanel .is-content-view {
2712
2877
  }
2713
2878
 
2714
2879
  #divStyles > div.active img {
2715
- outline: #5fa1f0 2px solid;
2880
+ outline: var(--focus-outline-color) 2px solid;
2716
2881
  transition: none !important;
2717
2882
  }
2718
2883
 
@@ -2964,7 +3129,7 @@ body.frame-center.controlpanel .is-content-view {
2964
3129
  }
2965
3130
 
2966
3131
  .ai-disclaimer .input-ok:focus {
2967
- outline: #3e93f7 2px solid !important;
3132
+ outline: var(--focus-outline-color) 2px solid !important;
2968
3133
  outline-offset: 2px !important;
2969
3134
  }
2970
3135