@wizishop/wizi-block 4.2.30-beta → 4.2.33-beta

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 (41) hide show
  1. package/bundles/wizishop-wizi-block.umd.js +141 -121
  2. package/bundles/wizishop-wizi-block.umd.js.map +1 -1
  3. package/bundles/wizishop-wizi-block.umd.min.js +1 -1
  4. package/bundles/wizishop-wizi-block.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/editorjs/editorjs.component.js +21 -12
  6. package/esm2015/lib/shared/components/editorjs/tools/inline/bold-tool.component.js +1 -1
  7. package/esm2015/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.js +1 -1
  8. package/esm2015/lib/shared/components/editorjs/tools/inline/italic-tool.component.js +1 -1
  9. package/esm2015/lib/shared/components/editorjs/tools/inline/link-tool.component.js +1 -1
  10. package/esm2015/lib/shared/components/editorjs/tools/inline/strike-tool.component.js +1 -1
  11. package/esm2015/lib/shared/components/editorjs/tools/inline/subscript-tool.component.js +1 -1
  12. package/esm2015/lib/shared/components/editorjs/tools/inline/superscript-tool.component.js +1 -1
  13. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.js +107 -64
  14. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.js +1 -18
  15. package/esm2015/lib/shared/components/editorjs/tools/inline/underline-tool.component.js +1 -1
  16. package/esm2015/lib/shared/components/editorjs/tools/paragraph/ordered-list-tool.component.js +2 -2
  17. package/esm2015/lib/shared/components/editorjs/tools/paragraph/quote-tool.component.js +2 -2
  18. package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-align-tool.component.js +2 -2
  19. package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-type-tool.component.js +2 -2
  20. package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.js +2 -18
  21. package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/text-edition.component.js +15 -16
  22. package/esm2015/lib/shared/components/editorjs/tools/paragraph/unordered-list-tool.component.js +2 -2
  23. package/esm2015/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.js +8 -1
  24. package/fesm2015/wizishop-wizi-block.js +153 -127
  25. package/fesm2015/wizishop-wizi-block.js.map +1 -1
  26. package/lib/shared/components/editorjs/editorjs.component.d.ts +1 -0
  27. package/lib/shared/components/editorjs/tools/inline/bold-tool.component.d.ts +1 -1
  28. package/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.d.ts +1 -1
  29. package/lib/shared/components/editorjs/tools/inline/italic-tool.component.d.ts +1 -1
  30. package/lib/shared/components/editorjs/tools/inline/link-tool.component.d.ts +1 -1
  31. package/lib/shared/components/editorjs/tools/inline/strike-tool.component.d.ts +1 -1
  32. package/lib/shared/components/editorjs/tools/inline/subscript-tool.component.d.ts +1 -1
  33. package/lib/shared/components/editorjs/tools/inline/superscript-tool.component.d.ts +1 -1
  34. package/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.d.ts +2 -0
  35. package/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.d.ts +0 -1
  36. package/lib/shared/components/editorjs/tools/inline/underline-tool.component.d.ts +1 -1
  37. package/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.d.ts +0 -1
  38. package/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.d.ts +2 -0
  39. package/package.json +5 -1
  40. package/wizi-block.scss +215 -215
  41. package/wizishop-wizi-block.metadata.json +1 -1
@@ -15,6 +15,7 @@ export declare class EditorJsComponent implements OnInit, OnDestroy {
15
15
  timeoutHandle: any;
16
16
  timeoutTextEditionHandle: any;
17
17
  onChangeTimeoutHandle: any;
18
+ editorInitialized: boolean;
18
19
  wrapperTags: string;
19
20
  constructor(translateService: TranslateService, editorJSConversionService: EditorJSConversionService, editorJSTranslationService: EditorJSTranslationService);
20
21
  ngOnInit(): Promise<void>;
@@ -5,7 +5,7 @@ export declare class BoldTool extends InlineStyleTool implements InlineTool {
5
5
  private readonly commandName;
6
6
  private readonly CSS;
7
7
  private nodes;
8
- private api;
8
+ api: any;
9
9
  private _state;
10
10
  tag: string;
11
11
  hasSeparatorBefore: boolean;
@@ -6,7 +6,7 @@ export declare class CapitalizeTool extends InlineStyleTool implements InlineToo
6
6
  private readonly commandName;
7
7
  private readonly CSS;
8
8
  private nodes;
9
- private api;
9
+ api: any;
10
10
  private _state;
11
11
  tag: string;
12
12
  style: StyleObject;
@@ -5,7 +5,7 @@ export declare class ItalicTool extends InlineStyleTool implements InlineTool {
5
5
  private readonly commandName;
6
6
  private readonly CSS;
7
7
  private nodes;
8
- private api;
8
+ api: any;
9
9
  private _state;
10
10
  tag: string;
11
11
  modifies: {
@@ -6,7 +6,7 @@ export declare class LinkTool extends InlineStyleTool implements InlineTool {
6
6
  private readonly commandName;
7
7
  private readonly CSS;
8
8
  private nodes;
9
- private api;
9
+ api: any;
10
10
  private _state;
11
11
  tag: string;
12
12
  hasSeparatorBefore: boolean;
@@ -5,7 +5,7 @@ export declare class StrikeTool extends InlineStyleTool implements InlineTool {
5
5
  private readonly commandName;
6
6
  private readonly CSS;
7
7
  private nodes;
8
- private api;
8
+ api: any;
9
9
  private _state;
10
10
  tag: string;
11
11
  modifies: {
@@ -5,7 +5,7 @@ export declare class SubscriptTool extends InlineStyleTool implements InlineTool
5
5
  private readonly commandName;
6
6
  private readonly CSS;
7
7
  private nodes;
8
- private api;
8
+ api: any;
9
9
  private _state;
10
10
  tag: string;
11
11
  modifies: {
@@ -5,7 +5,7 @@ export declare class SuperscriptTool extends InlineStyleTool implements InlineTo
5
5
  private readonly commandName;
6
6
  private readonly CSS;
7
7
  private nodes;
8
- private api;
8
+ api: any;
9
9
  private _state;
10
10
  tag: string;
11
11
  modifies: {
@@ -30,9 +30,11 @@ export declare abstract class InlineStyleTool extends EditorJSTool {
30
30
  private findStyleNode;
31
31
  private createElement;
32
32
  private removeChildrenClasses;
33
+ parentHasStyle(currentElement: HTMLElement, referenceElement: HTMLElement): boolean;
33
34
  private cleanupContainer;
34
35
  private hasNoAttributes;
35
36
  private identicalClassList;
37
+ private identicalAttributes;
36
38
  private identicalInlineStyle;
37
39
  private sortInlineStyle;
38
40
  private getInlineStyle;
@@ -17,5 +17,4 @@ export declare abstract class InlineTextTool extends InlineStyleTool {
17
17
  saveUserSelection(): void;
18
18
  resetUserSelection(): void;
19
19
  isDropdownFocusedOut($event: any): boolean;
20
- findParentModifier(element: HTMLElement): HTMLElement | null;
21
20
  }
@@ -6,7 +6,7 @@ export declare class UnderlineTool extends InlineStyleTool implements InlineTool
6
6
  private readonly commandName;
7
7
  private readonly CSS;
8
8
  private nodes;
9
- private api;
9
+ api: any;
10
10
  private _state;
11
11
  tag: string;
12
12
  style: StyleObject;
@@ -14,7 +14,6 @@ export declare abstract class ParagraphStyleTool extends EditorJSTool {
14
14
  private getCurrentParagraph;
15
15
  private changeContainerTag;
16
16
  private changeCurrentClass;
17
- findParentModifier(element: HTMLElement): HTMLElement | null;
18
17
  }
19
18
  export declare var listApi: any;
20
19
  export declare var listEditor: any;
@@ -10,6 +10,7 @@ export declare class AttributeObject {
10
10
  value: string;
11
11
  }
12
12
  export declare abstract class EditorJSTool {
13
+ api: any;
13
14
  parentEditor: HTMLDivElement;
14
15
  textContainers: string;
15
16
  currentSelection?: Selection;
@@ -25,6 +26,7 @@ export declare abstract class EditorJSTool {
25
26
  resetUserSelection(): void;
26
27
  collapseSelection(): void;
27
28
  findParentEditor(): HTMLDivElement | null;
29
+ findParentModifier(): HTMLElement | null;
28
30
  clear(): void;
29
31
  private getTextNodes;
30
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizishop/wizi-block",
3
- "version": "4.2.30-beta",
3
+ "version": "4.2.33-beta",
4
4
  "description": "## To use WiziBlock, you have to :",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,6 +20,10 @@
20
20
  "@angular/common": "^10.1.4",
21
21
  "@angular/core": "^10.1.4",
22
22
  "@asymmetrik/ngx-leaflet": "^8.1.0",
23
+ "@codemirror/commands": "^6.0.0",
24
+ "@codemirror/lang-html": "^6.1.0",
25
+ "@codemirror/state": "^6.0.1",
26
+ "@codemirror/view": "^6.0.2",
23
27
  "@ctrl/tinycolor": "^3.1.5",
24
28
  "@fortawesome/fontawesome-svg-core": "^1.2.31",
25
29
  "@fortawesome/free-brands-svg-icons": "^5.15.0",
package/wizi-block.scss CHANGED
@@ -1882,33 +1882,204 @@ wb-structure-tools {
1882
1882
  }
1883
1883
  }
1884
1884
  }
1885
- .wb-previews {
1886
- &__iframe {
1887
- opacity: 0;
1888
- width: 100%;
1889
- height: calc(100vh - #{rem(280)});
1890
- min-height: calc(100vh - #{rem(280)});
1891
- overflow-y: scroll;
1892
- &.is-active {
1893
- opacity: 1;
1885
+ .wb-blocks {
1886
+ position: relative;
1887
+ z-index: 1;
1888
+
1889
+ span[class^='wb-dynamic-size'] {
1890
+ position: absolute;
1891
+ color: $wb-secondary-text-color;
1892
+ top: 1vw !important;
1893
+ font-size: rem(14);
1894
+ text-align: center;
1895
+ width: rem(200);
1896
+ left: 0;
1897
+ right: 0;
1898
+ margin: auto;
1894
1899
  }
1895
- border: rem(1) dashed $wb-border-color;
1896
- }
1897
1900
 
1898
- &__loader {
1899
- display: none;
1900
- height: calc(100vh - #{rem(280)});
1901
- min-height: calc(100vh - #{rem(280)});
1901
+ .button.is-hidden-button.is-rounded {
1902
+ padding: rem(8) rem(8);
1903
+ border: rem(1) solid transparent;
1904
+ position: absolute;
1905
+ top: -#{rem(45)};
1906
+ right: 0;
1907
+ @include media('<=#{$block-width-mobile * 1.4}') {
1908
+ right: -#{rem(26)};
1909
+ }
1910
+ z-index: 11000;
1911
+ width: rem(36);
1912
+ @include simple_transition();
1902
1913
 
1903
- &.is-active {
1904
- display: block;
1914
+ &:not(.is-danger) {
1915
+ color: lighten($wb-secondary-text-color, 20%);
1916
+ @include media('>=1419px', '<1515px') {
1917
+ right: -20px !important;
1918
+ }
1919
+
1920
+ &:hover {
1921
+ background-color: lighten($wb-secondary-text-color, 20%);
1922
+ color: $wb-white;
1923
+ }
1924
+ }
1905
1925
  }
1906
- }
1907
1926
 
1908
- .wb-loader {
1909
- margin: 0 auto 1.875rem auto;
1910
- padding-top: rem(85);
1911
- }
1927
+ &__container {
1928
+ padding-bottom: rem(30);
1929
+ display: block;
1930
+ height: 100%;
1931
+ width: 100%;
1932
+ box-sizing: border-box;
1933
+ transition: 0s !important;
1934
+ position: relative;
1935
+ z-index: 1;
1936
+
1937
+ &--focused {
1938
+ z-index: 50;
1939
+ }
1940
+
1941
+ .wb-component__container {
1942
+ display: block;
1943
+ height: 100%;
1944
+ width: 100%;
1945
+ position: relative;
1946
+ }
1947
+ &:hover,
1948
+ &:focus,
1949
+ .hover & {
1950
+ .wb-component__container {
1951
+ border-color: $wizishop-blue;
1952
+ }
1953
+ .wb-structure-tools {
1954
+ background-color: $wizishop-blue;
1955
+ }
1956
+ }
1957
+ }
1958
+
1959
+ .border-blue {
1960
+ .wb-component__container {
1961
+ border-color: $wizishop-blue;
1962
+ }
1963
+ }
1964
+
1965
+ &.cdk-drop-list-dragging .wb-blocks__container:not(.cdk-drag-placeholder) {
1966
+ transition: all 250ms cubic-bezier(0, 0, 0.2, 1);
1967
+
1968
+ .wb-videos-simple,
1969
+ .wb-videos-txt,
1970
+ .wb-videos-txt-left,
1971
+ .wb-videos-txt-content {
1972
+ &__fakeframe {
1973
+ display: flex !important;
1974
+ }
1975
+
1976
+ &__frame {
1977
+ display: none !important;
1978
+ }
1979
+ }
1980
+ }
1981
+
1982
+ &.cdk-drop-list-dragging {
1983
+ .wb-videos-simple,
1984
+ .wb-videos-txt,
1985
+ .wb-videos-txt-left,
1986
+ .wb-videos-txt-content {
1987
+ &__fakeframe {
1988
+ display: flex !important;
1989
+ }
1990
+ &__frame {
1991
+ display: none !important;
1992
+ }
1993
+ }
1994
+
1995
+ .wb-component__container {
1996
+ border: rem(2) solid $wizishop-blue !important;
1997
+ }
1998
+ }
1999
+
2000
+ &-empty {
2001
+ text-align: center;
2002
+ background-color: lighten($wb-border-color, 13%);
2003
+ padding: rem(80);
2004
+ margin-bottom: rem(30);
2005
+
2006
+ img {
2007
+ width: rem(75);
2008
+ margin: 0 auto;
2009
+ display: block;
2010
+ }
2011
+
2012
+ p {
2013
+ &:first-of-type {
2014
+ font-size: rem(16);
2015
+ font-weight: 500;
2016
+ color: $wb-main-text-color;
2017
+ margin: rem(20);
2018
+ }
2019
+
2020
+ &:last-of-type {
2021
+ font-size: rem(14);
2022
+ font-weight: 400;
2023
+ color: $wb-secondary-text-color;
2024
+ }
2025
+ }
2026
+ }
2027
+ }
2028
+
2029
+ .wb-blocks__container.cdk-drag-animating {
2030
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
2031
+
2032
+ .wb-videos-simple,
2033
+ .wb-videos-txt,
2034
+ .wb-videos-txt-left,
2035
+ .wb-videos-txt-content {
2036
+ &__fakeframe {
2037
+ display: flex !important;
2038
+ }
2039
+ &__frame {
2040
+ display: none !important;
2041
+ }
2042
+ }
2043
+ }
2044
+
2045
+ .wb-blocks__container.cdk-drag-placeholder {
2046
+ opacity: 0.2;
2047
+ .wb-videos-simple,
2048
+ .wb-videos-txt,
2049
+ .wb-videos-txt-left,
2050
+ .wb-videos-txt-content {
2051
+ &__fakeframe {
2052
+ display: flex !important;
2053
+ }
2054
+ &__frame {
2055
+ display: none !important;
2056
+ }
2057
+ }
2058
+ }
2059
+
2060
+ .wb-blocks__container.cdk-drag-preview {
2061
+ box-shadow: 0 rem(30) rem(30) rgba(0, 0, 0, 0.2);
2062
+ cursor: move;
2063
+
2064
+ .wb-videos-simple,
2065
+ .wb-videos-txt,
2066
+ .wb-videos-txt-left,
2067
+ .wb-videos-txt-content {
2068
+ &__fakeframe {
2069
+ display: flex !important;
2070
+ }
2071
+ &__frame {
2072
+ display: none !important;
2073
+ }
2074
+ }
2075
+ }
2076
+
2077
+ .wb-component {
2078
+ &.border-grey {
2079
+ .wb-component__container {
2080
+ border-color: darken(#95a5a6, 15%);
2081
+ }
2082
+ }
1912
2083
  }
1913
2084
  .wb-forms-onboarding {
1914
2085
  width: 100%;
@@ -14175,204 +14346,33 @@ $color-size-choose: #6c6c6c;
14175
14346
  }
14176
14347
  }
14177
14348
  }
14178
- .wb-blocks {
14179
- position: relative;
14180
- z-index: 1;
14181
-
14182
- span[class^='wb-dynamic-size'] {
14183
- position: absolute;
14184
- color: $wb-secondary-text-color;
14185
- top: 1vw !important;
14186
- font-size: rem(14);
14187
- text-align: center;
14188
- width: rem(200);
14189
- left: 0;
14190
- right: 0;
14191
- margin: auto;
14192
- }
14193
-
14194
- .button.is-hidden-button.is-rounded {
14195
- padding: rem(8) rem(8);
14196
- border: rem(1) solid transparent;
14197
- position: absolute;
14198
- top: -#{rem(45)};
14199
- right: 0;
14200
- @include media('<=#{$block-width-mobile * 1.4}') {
14201
- right: -#{rem(26)};
14202
- }
14203
- z-index: 11000;
14204
- width: rem(36);
14205
- @include simple_transition();
14206
-
14207
- &:not(.is-danger) {
14208
- color: lighten($wb-secondary-text-color, 20%);
14209
- @include media('>=1419px', '<1515px') {
14210
- right: -20px !important;
14211
- }
14212
-
14213
- &:hover {
14214
- background-color: lighten($wb-secondary-text-color, 20%);
14215
- color: $wb-white;
14216
- }
14217
- }
14218
- }
14219
-
14220
- &__container {
14221
- padding-bottom: rem(30);
14222
- display: block;
14223
- height: 100%;
14224
- width: 100%;
14225
- box-sizing: border-box;
14226
- transition: 0s !important;
14227
- position: relative;
14228
- z-index: 1;
14229
-
14230
- &--focused {
14231
- z-index: 50;
14232
- }
14233
-
14234
- .wb-component__container {
14235
- display: block;
14236
- height: 100%;
14237
- width: 100%;
14238
- position: relative;
14239
- }
14240
- &:hover,
14241
- &:focus,
14242
- .hover & {
14243
- .wb-component__container {
14244
- border-color: $wizishop-blue;
14245
- }
14246
- .wb-structure-tools {
14247
- background-color: $wizishop-blue;
14248
- }
14249
- }
14250
- }
14251
-
14252
- .border-blue {
14253
- .wb-component__container {
14254
- border-color: $wizishop-blue;
14255
- }
14256
- }
14257
-
14258
- &.cdk-drop-list-dragging .wb-blocks__container:not(.cdk-drag-placeholder) {
14259
- transition: all 250ms cubic-bezier(0, 0, 0.2, 1);
14260
-
14261
- .wb-videos-simple,
14262
- .wb-videos-txt,
14263
- .wb-videos-txt-left,
14264
- .wb-videos-txt-content {
14265
- &__fakeframe {
14266
- display: flex !important;
14267
- }
14268
-
14269
- &__frame {
14270
- display: none !important;
14271
- }
14272
- }
14273
- }
14274
-
14275
- &.cdk-drop-list-dragging {
14276
- .wb-videos-simple,
14277
- .wb-videos-txt,
14278
- .wb-videos-txt-left,
14279
- .wb-videos-txt-content {
14280
- &__fakeframe {
14281
- display: flex !important;
14282
- }
14283
- &__frame {
14284
- display: none !important;
14285
- }
14286
- }
14287
-
14288
- .wb-component__container {
14289
- border: rem(2) solid $wizishop-blue !important;
14290
- }
14291
- }
14292
-
14293
- &-empty {
14294
- text-align: center;
14295
- background-color: lighten($wb-border-color, 13%);
14296
- padding: rem(80);
14297
- margin-bottom: rem(30);
14298
-
14299
- img {
14300
- width: rem(75);
14301
- margin: 0 auto;
14302
- display: block;
14303
- }
14304
-
14305
- p {
14306
- &:first-of-type {
14307
- font-size: rem(16);
14308
- font-weight: 500;
14309
- color: $wb-main-text-color;
14310
- margin: rem(20);
14311
- }
14312
-
14313
- &:last-of-type {
14314
- font-size: rem(14);
14315
- font-weight: 400;
14316
- color: $wb-secondary-text-color;
14317
- }
14318
- }
14319
- }
14320
- }
14321
-
14322
- .wb-blocks__container.cdk-drag-animating {
14323
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
14324
-
14325
- .wb-videos-simple,
14326
- .wb-videos-txt,
14327
- .wb-videos-txt-left,
14328
- .wb-videos-txt-content {
14329
- &__fakeframe {
14330
- display: flex !important;
14331
- }
14332
- &__frame {
14333
- display: none !important;
14334
- }
14335
- }
14336
- }
14337
-
14338
- .wb-blocks__container.cdk-drag-placeholder {
14339
- opacity: 0.2;
14340
- .wb-videos-simple,
14341
- .wb-videos-txt,
14342
- .wb-videos-txt-left,
14343
- .wb-videos-txt-content {
14344
- &__fakeframe {
14345
- display: flex !important;
14346
- }
14347
- &__frame {
14348
- display: none !important;
14349
- }
14349
+ .wb-previews {
14350
+ &__iframe {
14351
+ opacity: 0;
14352
+ width: 100%;
14353
+ height: calc(100vh - #{rem(280)});
14354
+ min-height: calc(100vh - #{rem(280)});
14355
+ overflow-y: scroll;
14356
+ &.is-active {
14357
+ opacity: 1;
14350
14358
  }
14351
- }
14359
+ border: rem(1) dashed $wb-border-color;
14360
+ }
14352
14361
 
14353
- .wb-blocks__container.cdk-drag-preview {
14354
- box-shadow: 0 rem(30) rem(30) rgba(0, 0, 0, 0.2);
14355
- cursor: move;
14362
+ &__loader {
14363
+ display: none;
14364
+ height: calc(100vh - #{rem(280)});
14365
+ min-height: calc(100vh - #{rem(280)});
14356
14366
 
14357
- .wb-videos-simple,
14358
- .wb-videos-txt,
14359
- .wb-videos-txt-left,
14360
- .wb-videos-txt-content {
14361
- &__fakeframe {
14362
- display: flex !important;
14363
- }
14364
- &__frame {
14365
- display: none !important;
14366
- }
14367
+ &.is-active {
14368
+ display: block;
14367
14369
  }
14368
- }
14370
+ }
14369
14371
 
14370
- .wb-component {
14371
- &.border-grey {
14372
- .wb-component__container {
14373
- border-color: darken(#95a5a6, 15%);
14374
- }
14375
- }
14372
+ .wb-loader {
14373
+ margin: 0 auto 1.875rem auto;
14374
+ padding-top: rem(85);
14375
+ }
14376
14376
  }
14377
14377
  .wb-text-backgrounds-link {
14378
14378
  position: relative;