@silexlabs/silex 3.0.0-alpha.60 → 3.0.0-alpha.62

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.
@@ -3812,15 +3812,6 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
3812
3812
  color: #ffffff;
3813
3813
  }
3814
3814
 
3815
- :root {
3816
- --primaryColor: #444;
3817
- --secondaryColor: #ddd;
3818
- --tertiaryColor: #5e85a8;
3819
- --quaternaryColor: #7bc0ff;
3820
- --darkerPrimaryColor: #363636;
3821
- --lighterPrimaryColor: #575757;
3822
- }
3823
-
3824
3815
  .silex-workspace {
3825
3816
  position: absolute;
3826
3817
  top: 0;
@@ -3829,6 +3820,9 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
3829
3820
  height: 100%;
3830
3821
  display: flex;
3831
3822
  }
3823
+ .silex-workspace body {
3824
+ font-family: "Ubuntu", sans-serif;
3825
+ }
3832
3826
  .silex-workspace a {
3833
3827
  color: inherit;
3834
3828
  }
@@ -3871,7 +3865,7 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
3871
3865
  left: 0;
3872
3866
  width: 100%;
3873
3867
  padding: 20px 0;
3874
- background-color: #444;
3868
+ background-color: #333333;
3875
3869
  }
3876
3870
  .settings-dialog > div footer > *:last-child {
3877
3871
  margin-right: 30px;
@@ -3910,7 +3904,7 @@ input.silex-button[type=submit] {
3910
3904
  }
3911
3905
 
3912
3906
  .silex-button.silex-button--secondary {
3913
- background-color: #444;
3907
+ background-color: #333333;
3914
3908
  }
3915
3909
 
3916
3910
  .silex-button--size {
@@ -4021,7 +4015,7 @@ form.silex-form .silex-form__group.col2 {
4021
4015
  color: #ddd;
4022
4016
  justify-content: center;
4023
4017
  align-items: center;
4024
- background-color: #444;
4018
+ background-color: #333333;
4025
4019
  z-index: 10;
4026
4020
  }
4027
4021
 
@@ -4029,10 +4023,11 @@ form.silex-form .silex-form__group.col2 {
4029
4023
  bottom: 0;
4030
4024
  left: 35px;
4031
4025
  right: 15%;
4032
- border-top: 1px solid #dee2e6;
4033
4026
  display: flex;
4034
4027
  justify-content: space-between;
4035
4028
  align-items: center;
4029
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
4030
+ height: 30px;
4036
4031
  }
4037
4032
 
4038
4033
  .silex-main {
@@ -4051,7 +4046,7 @@ form.silex-form .silex-form__group.col2 {
4051
4046
 
4052
4047
  .silex-dialog-inline {
4053
4048
  position: absolute;
4054
- background-color: #444;
4049
+ background-color: #333333;
4055
4050
  z-index: 10;
4056
4051
  border-radius: 3px;
4057
4052
  border: 2px solid rgba(0, 0, 0, 0.25);
@@ -4070,162 +4065,12 @@ form.silex-form .silex-form__group.col2 {
4070
4065
  text-align: right;
4071
4066
  }
4072
4067
  .silex-dialog-inline a {
4073
- color: #7bc0ff;
4068
+ color: #56E3FF;
4074
4069
  }
4075
4070
  .silex-dialog-inline header > * {
4076
4071
  margin: 0;
4077
4072
  }
4078
4073
 
4079
- #gjs {
4080
- flex: 1 1 auto;
4081
- }
4082
-
4083
- .gjs-one-bg {
4084
- background-color: #444;
4085
- }
4086
- .gjs-one-color {
4087
- color: #444;
4088
- }
4089
- .gjs-one-color-h:hover {
4090
- color: #444;
4091
- }
4092
- .gjs-two-bg {
4093
- background-color: #ddd;
4094
- }
4095
- .gjs-two-color {
4096
- color: #ddd;
4097
- }
4098
- .gjs-two-color-h:hover {
4099
- color: #ddd;
4100
- }
4101
- .gjs-three-bg {
4102
- background-color: #5e85a8;
4103
- }
4104
- .gjs-three-color {
4105
- color: #5e85a8;
4106
- }
4107
- .gjs-three-color-h:hover {
4108
- color: #5e85a8;
4109
- }
4110
- .gjs-four-bg {
4111
- background-color: #7bc0ff;
4112
- }
4113
- .gjs-four-color {
4114
- color: #7bc0ff;
4115
- }
4116
- .gjs-four-color-h:hover {
4117
- color: #7bc0ff;
4118
- }
4119
-
4120
- .gjs-cv-canvas,
4121
- .gjs-pn-panel,
4122
- .gjs-pn-commands {
4123
- left: 35px;
4124
- }
4125
-
4126
- .gjs-pn-project-bar-panel,
4127
- .gjs-pn-views,
4128
- .gjs-pn-options,
4129
- .gjs-pn-views-container {
4130
- left: auto;
4131
- }
4132
-
4133
- .gjs-cv-canvas {
4134
- width: calc(85% - 35px);
4135
- }
4136
-
4137
- .gjs-pn-devices-c {
4138
- display: flex;
4139
- }
4140
- .gjs-pn-devices-c .gjs-device-label {
4141
- display: none;
4142
- }
4143
-
4144
- .gjs-pn-views-container {
4145
- width: 15%;
4146
- }
4147
-
4148
- /*
4149
- */
4150
- .gjs-editor-cont .fa {
4151
- font-weight: 400;
4152
- }
4153
-
4154
- .fa-square-o:before {
4155
- content: "\f0c8";
4156
- }
4157
-
4158
- .fa-trash-o:before {
4159
- content: "\f1f8";
4160
- }
4161
-
4162
- .fa-map-o:before {
4163
- content: "\f279";
4164
- }
4165
-
4166
- .fa-youtube-play:before {
4167
- content: "\f04b";
4168
- }
4169
-
4170
- /* Fix: open close chevrons: FA5 has the tags in different order ?!!? */
4171
- .fa-chevron-right:before {
4172
- content: "\f054";
4173
- }
4174
-
4175
- .fa-chevron-down:before {
4176
- content: "\f078";
4177
- }
4178
-
4179
- .fa-cog:before {
4180
- font-weight: 900;
4181
- }
4182
-
4183
- .fa-paint-brush:before {
4184
- font-weight: 900;
4185
- }
4186
-
4187
- .fa-arrows-alt:before {
4188
- content: "\f065";
4189
- font-weight: 900;
4190
- }
4191
-
4192
- .fa-caret-down:before {
4193
- content: "\f0d7";
4194
- font-weight: 900;
4195
- }
4196
-
4197
- .fa-caret-right:before {
4198
- content: "\f0da";
4199
- font-weight: 900;
4200
- }
4201
-
4202
- .fa-trash:before {
4203
- content: "\f2ed";
4204
- font-weight: 900;
4205
- }
4206
-
4207
- .fa-list:before {
4208
- content: "\f03a";
4209
- font-weight: 900;
4210
- }
4211
-
4212
- .fa-sign-out:before {
4213
- content: "\f08b";
4214
- font-weight: 900;
4215
- }
4216
-
4217
- /*
4218
- .fa-plus:before {
4219
- content: "+";
4220
- font-size: 35px;
4221
- }
4222
- .fa-diamond:before {
4223
- content: "\f3a5";
4224
- }
4225
- // .fa-plus {
4226
- // background-image: svg(<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"/></svg>);
4227
- // }
4228
- */
4229
4074
  iframe.enable-squeeze.gjs-frame {
4230
4075
  transition: width 0.35s, height 0.35s, left 0.35s;
4231
4076
  }
@@ -4268,7 +4113,7 @@ iframe.enable-squeeze.silex-squeeze-left {
4268
4113
  top: 40px;
4269
4114
  width: 13%;
4270
4115
  min-width: 150px;
4271
- height: calc(100% - 40px);
4116
+ height: calc(100% - 40px - 30px);
4272
4117
  background-color: #575757;
4273
4118
  }
4274
4119
  .gjs-pn-project-bar-container:not(.gjs-hidden) {
@@ -4279,11 +4124,11 @@ iframe.enable-squeeze.silex-squeeze-left {
4279
4124
  flex: 1;
4280
4125
  display: flex;
4281
4126
  flex-direction: column;
4282
- background-color: #444;
4127
+ background-color: #333333;
4283
4128
  overflow: auto;
4284
4129
  }
4285
4130
  .gjs-pn-project-bar-container .project-bar__panel:not(.gjs-hidden) .gjs-layer {
4286
- background-color: #444;
4131
+ background-color: #333333;
4287
4132
  }
4288
4133
  .gjs-pn-project-bar-container .project-bar__panel > *:not(header) {
4289
4134
  flex: 1;
@@ -4322,7 +4167,7 @@ iframe.enable-squeeze.silex-squeeze-left {
4322
4167
  line-height: 13px;
4323
4168
  }
4324
4169
  .gjs-pn-project-bar-container .project-bar__panel-header .project-bar__panel-header-button:hover {
4325
- color: #7bc0ff;
4170
+ color: #56E3FF;
4326
4171
  }
4327
4172
 
4328
4173
  .page-panel-container .pages__wrapper {
@@ -4336,7 +4181,7 @@ iframe.enable-squeeze.silex-squeeze-left {
4336
4181
  .page-panel-container .pages .pages__main {
4337
4182
  flex: 1;
4338
4183
  border: 1px solid #363636;
4339
- background-color: #444;
4184
+ background-color: #333333;
4340
4185
  }
4341
4186
  .page-panel-container .pages .pages__page {
4342
4187
  display: flex;
@@ -4346,17 +4191,17 @@ iframe.enable-squeeze.silex-squeeze-left {
4346
4191
  cursor: pointer;
4347
4192
  }
4348
4193
  .page-panel-container .pages .pages__page:hover {
4349
- background-color: #444;
4194
+ background-color: #333333;
4350
4195
  }
4351
4196
  .page-panel-container .pages .pages__page:hover .pages__page-name {
4352
- color: #7bc0ff;
4197
+ color: #56E3FF;
4353
4198
  }
4354
4199
  .page-panel-container .pages .pages__page-selected {
4355
4200
  background-color: #575757;
4356
4201
  cursor: default;
4357
4202
  }
4358
4203
  .page-panel-container .pages .pages__page-selected .pages__page-name {
4359
- color: #7bc0ff;
4204
+ color: #56E3FF;
4360
4205
  }
4361
4206
  .page-panel-container .pages .pages__main.pages__single-page .pages__remove-btn {
4362
4207
  visibility: hidden;
@@ -4377,7 +4222,7 @@ iframe.enable-squeeze.silex-squeeze-left {
4377
4222
  cursor: pointer;
4378
4223
  }
4379
4224
  .page-panel-container .pages .pages__icon:hover {
4380
- color: #7bc0ff;
4225
+ color: #56E3FF;
4381
4226
  }
4382
4227
  .page-panel-container .gjs-pn-buttons {
4383
4228
  flex-direction: column;
@@ -4397,8 +4242,242 @@ iframe.enable-squeeze.silex-squeeze-left {
4397
4242
  background-color: #363636;
4398
4243
  }
4399
4244
 
4245
+ #gjs {
4246
+ flex: 1 1 auto;
4247
+ }
4248
+
4249
+ .gjs-one-bg {
4250
+ background-color: #333333;
4251
+ }
4252
+ .gjs-one-color {
4253
+ color: #333333;
4254
+ }
4255
+ .gjs-one-color-h:hover {
4256
+ color: #333333;
4257
+ }
4258
+ .gjs-two-bg {
4259
+ background-color: #ddd;
4260
+ }
4261
+ .gjs-two-color {
4262
+ color: #ddd;
4263
+ }
4264
+ .gjs-two-color-h:hover {
4265
+ color: #ddd;
4266
+ }
4267
+ .gjs-three-bg {
4268
+ background-color: #8873FE;
4269
+ }
4270
+ .gjs-three-color {
4271
+ color: #8873FE;
4272
+ }
4273
+ .gjs-three-color-h:hover {
4274
+ color: #8873FE;
4275
+ }
4276
+ .gjs-four-bg {
4277
+ background-color: #56E3FF;
4278
+ }
4279
+ .gjs-four-color {
4280
+ color: #56E3FF;
4281
+ }
4282
+ .gjs-four-color-h:hover {
4283
+ color: #56E3FF;
4284
+ }
4285
+
4286
+ .gjs-cv-canvas,
4287
+ .gjs-pn-panel,
4288
+ .gjs-pn-commands {
4289
+ left: 35px;
4290
+ }
4291
+
4292
+ .gjs-pn-project-bar-panel,
4293
+ .gjs-pn-views,
4294
+ .gjs-pn-options,
4295
+ .gjs-pn-views-container {
4296
+ left: auto;
4297
+ }
4298
+
4299
+ .gjs-cv-canvas {
4300
+ width: calc(85% - 35px);
4301
+ }
4302
+
4303
+ .gjs-pn-devices-c {
4304
+ display: flex;
4305
+ }
4306
+ .gjs-pn-devices-c .gjs-device-label {
4307
+ display: none;
4308
+ }
4309
+
4310
+ .gjs-pn-views-container {
4311
+ width: 15%;
4312
+ }
4313
+
4314
+ .gjs-editor {
4315
+ font-family: "Ubuntu", sans-serif;
4316
+ font-size: 0.75rem;
4317
+ }
4318
+
4319
+ .gjs-toolbar {
4320
+ background-color: #8873FE;
4321
+ }
4322
+
4323
+ .gjs-resizer-h {
4324
+ border-color: #8873FE;
4325
+ }
4326
+
4327
+ .gjs-com-badge, .gjs-com-badge-red, .gjs-badge {
4328
+ background-color: #8873FE;
4329
+ }
4330
+
4331
+ .gjs-cv-canvas .gjs-highlighter, .gjs-cv-canvas .gjs-highlighter-sel {
4332
+ outline: 1px solid #8873FE;
4333
+ }
4334
+
4335
+ /*
4336
+ */
4337
+ .gjs-editor-cont .fa {
4338
+ font-weight: 400;
4339
+ }
4340
+
4341
+ .fa-square-o:before {
4342
+ content: "\f0c8";
4343
+ }
4344
+
4345
+ .fa-trash-o:before {
4346
+ content: "\f1f8";
4347
+ }
4348
+
4349
+ .fa-map-o:before {
4350
+ content: "\f279";
4351
+ }
4352
+
4353
+ .fa-youtube-play:before {
4354
+ content: "\f04b";
4355
+ }
4356
+
4357
+ /* Fix: open close chevrons: FA5 has the tags in different order ?!!? */
4358
+ .fa-chevron-right:before {
4359
+ content: "\f054";
4360
+ }
4361
+
4362
+ .fa-chevron-down:before {
4363
+ content: "\f078";
4364
+ }
4365
+
4366
+ .fa-cog:before {
4367
+ font-weight: 900;
4368
+ }
4369
+
4370
+ .fa-paint-brush:before {
4371
+ font-weight: 900;
4372
+ }
4373
+
4374
+ .fa-arrows-alt:before {
4375
+ content: "\f065";
4376
+ font-weight: 900;
4377
+ }
4378
+
4379
+ .fa-caret-down:before {
4380
+ content: "\f0d7";
4381
+ font-weight: 900;
4382
+ }
4383
+
4384
+ .fa-caret-right:before {
4385
+ content: "\f0da";
4386
+ font-weight: 900;
4387
+ }
4388
+
4389
+ .fa-trash:before {
4390
+ content: "\f2ed";
4391
+ font-weight: 900;
4392
+ }
4393
+
4394
+ .fa-list:before {
4395
+ content: "\f03a";
4396
+ font-weight: 900;
4397
+ }
4398
+
4399
+ .fa-sign-out:before {
4400
+ content: "\f08b";
4401
+ font-weight: 900;
4402
+ }
4403
+
4404
+ /*
4405
+ .fa-plus:before {
4406
+ content: "+";
4407
+ font-size: 35px;
4408
+ }
4409
+ .fa-diamond:before {
4410
+ content: "\f3a5";
4411
+ }
4412
+ // .fa-plus {
4413
+ // background-image: svg(<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"/></svg>);
4414
+ // }
4415
+ */
4416
+ /* ubuntu-cyrillic-ext-400-normal */
4417
+ @font-face {
4418
+ font-family: "Ubuntu";
4419
+ font-style: normal;
4420
+ font-display: swap;
4421
+ font-weight: 400;
4422
+ src: url(./files/ubuntu-cyrillic-ext-400-normal.woff2) format("woff2"), url(./files/ubuntu-cyrillic-ext-400-normal.woff) format("woff");
4423
+ unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
4424
+ }
4425
+ /* ubuntu-cyrillic-400-normal */
4426
+ @font-face {
4427
+ font-family: "Ubuntu";
4428
+ font-style: normal;
4429
+ font-display: swap;
4430
+ font-weight: 400;
4431
+ src: url(./files/ubuntu-cyrillic-400-normal.woff2) format("woff2"), url(./files/ubuntu-cyrillic-400-normal.woff) format("woff");
4432
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
4433
+ }
4434
+ /* ubuntu-greek-ext-400-normal */
4435
+ @font-face {
4436
+ font-family: "Ubuntu";
4437
+ font-style: normal;
4438
+ font-display: swap;
4439
+ font-weight: 400;
4440
+ src: url(./files/ubuntu-greek-ext-400-normal.woff2) format("woff2"), url(./files/ubuntu-greek-ext-400-normal.woff) format("woff");
4441
+ unicode-range: U+1F00-1FFF;
4442
+ }
4443
+ /* ubuntu-greek-400-normal */
4444
+ @font-face {
4445
+ font-family: "Ubuntu";
4446
+ font-style: normal;
4447
+ font-display: swap;
4448
+ font-weight: 400;
4449
+ src: url(./files/ubuntu-greek-400-normal.woff2) format("woff2"), url(./files/ubuntu-greek-400-normal.woff) format("woff");
4450
+ unicode-range: U+0370-03FF;
4451
+ }
4452
+ /* ubuntu-latin-ext-400-normal */
4453
+ @font-face {
4454
+ font-family: "Ubuntu";
4455
+ font-style: normal;
4456
+ font-display: swap;
4457
+ font-weight: 400;
4458
+ src: url(./files/ubuntu-latin-ext-400-normal.woff2) format("woff2"), url(./files/ubuntu-latin-ext-400-normal.woff) format("woff");
4459
+ unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
4460
+ }
4461
+ /* ubuntu-latin-400-normal */
4462
+ @font-face {
4463
+ font-family: "Ubuntu";
4464
+ font-style: normal;
4465
+ font-display: swap;
4466
+ font-weight: 400;
4467
+ src: url(./files/ubuntu-latin-400-normal.woff2) format("woff2"), url(./files/ubuntu-latin-400-normal.woff) format("woff");
4468
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
4469
+ }
4400
4470
  /* Normalize css */
4401
4471
  /* Silex styles imports */
4472
+ :root {
4473
+ --primaryColor: $primaryColor;
4474
+ --secondaryColor: $secondaryColor;
4475
+ --tertiaryColor: $tertiaryColor;
4476
+ --quaternaryColor: $quaternaryColor;
4477
+ --darkerPrimaryColor: $darkerPrimaryColor;
4478
+ --lighterPrimaryColor: $lighterPrimaryColor;
4479
+ }
4480
+
4402
4481
  .container-png::before {
4403
4482
  content: " ";
4404
4483
  background-image: url("../assets/container.png");
@@ -1,6 +1,6 @@
1
1
  <!DOCTYPE html><html lang="en" translate="no"><head><title>Silex</title><meta name="description" content="This is a public instance of Silex website builder. Build websites in the browser"><link rel="shortcut icon" href="assets/favicon.png"><style>body {
2
2
  background-color: #444444;
3
- font-family: Helvetica,sans-serif;
3
+ font-family: "Ubuntu", "Helvetica Neue", Helvetica, Arial, sans-serif;
4
4
  }
5
5
  .silex-loader {
6
6
  display: none;
@@ -97,7 +97,7 @@ var silex;(()=>{var t={357:function(t){var e;"undefined"!=typeof globalThis?glob
97
97
  ><span>${e.text}</span></div>
98
98
  `))}
99
99
  </header>
100
- `,r),document.body.appendChild(r),t.on("load",(()=>{n.view.el.appendChild(r)}))),t.Commands.add(e.command,{run(){e.link&&window.open(e.link),e.attributes.containerClassName&&(n.set("visible",!0),r.classList.remove("gjs-hidden"),t.Canvas.getFrameEl().classList.add("silex-squeeze-left"))},stop(){e.attributes.containerClassName&&(n.set("visible",!1),r.classList.add("gjs-hidden"),t.Canvas.getFrameEl().classList.remove("silex-squeeze-left"))}})})),t.on("load device:select page",(()=>{!function(){const e=n.view.el,r=t.Canvas.getFrameEl();r.classList.remove("enable-squeeze"),setTimeout((()=>{const t=r.getClientRects()[0]?.left,n=e.getClientRects()[0]?.right;t<n||!n?r.classList.add("enable-squeeze"):r.classList.remove("enable-squeeze")}),400),n.get("visible")?r.classList.add("silex-squeeze-left"):r.classList.remove("silex-squeeze-left")}()}))},Nn=document.createElement("div");let In;const Dn="open-settings";let $n="v3";const Rn=nt.plugins.add("settings-dialog",((t,e)=>{try{$n="3.0.0-alpha.60"}catch(t){}console.info("Silex version:",$n),t.Commands.add(Dn,{run:(e,n,{page:r})=>{In=t.Modal.open({title:r?"Page settings":"Site Settings",content:"",attributes:{class:"settings-dialog"}}).onceClose((()=>{n.set("active",0),t.stopCommand(Dn)})),function(t,e,n=t.getModel()){const r=n.get("settings")||{};n.set("settings",r),we(ne`
100
+ `,r),document.body.appendChild(r),t.on("load",(()=>{n.view.el.appendChild(r)}))),t.Commands.add(e.command,{run(){e.link&&window.open(e.link),e.attributes.containerClassName&&(n.set("visible",!0),r.classList.remove("gjs-hidden"),t.Canvas.getFrameEl().classList.add("silex-squeeze-left"))},stop(){e.attributes.containerClassName&&(n.set("visible",!1),r.classList.add("gjs-hidden"),t.Canvas.getFrameEl().classList.remove("silex-squeeze-left"))}})})),t.on("load device:select page",(()=>{!function(){const e=n.view.el,r=t.Canvas.getFrameEl();r.classList.remove("enable-squeeze"),setTimeout((()=>{const t=r.getClientRects()[0]?.left,n=e.getClientRects()[0]?.right;t<n||!n?r.classList.add("enable-squeeze"):r.classList.remove("enable-squeeze")}),400),n.get("visible")?r.classList.add("silex-squeeze-left"):r.classList.remove("silex-squeeze-left")}()}))},Nn=document.createElement("div");let In;const Dn="open-settings";let $n="v3";const Rn=nt.plugins.add("settings-dialog",((t,e)=>{try{$n="3.0.0-alpha.62"}catch(t){}console.info("Silex version:",$n),t.Commands.add(Dn,{run:(e,n,{page:r})=>{In=t.Modal.open({title:r?"Page settings":"Site Settings",content:"",attributes:{class:"settings-dialog"}}).onceClose((()=>{n.set("active",0),t.stopCommand(Dn)})),function(t,e,n=t.getModel()){const r=n.get("settings")||{};n.set("settings",r),we(ne`
101
101
  <p>The page settings will override site settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
102
102
  <form class="silex-form">
103
103
  <h2>General settings</h2>
@@ -319,4 +319,4 @@ var silex;(()=>{var t={357:function(t){var e;"undefined"!=typeof globalThis?glob
319
319
  @click=${()=>this.editor.Commands.stop(Zn)}
320
320
  >Close</button>
321
321
  </footer>
322
- `}}displayPending(t,e){this.errorMessage=null,this.renderDialog(t,e)}displayError(t,e,n){console.info(t),this.errorMessage=t,this.renderDialog(e,n)}async closeDialog(){this.isOpen=!1,this.renderDialog(null,null),this.sender&&this.sender.set("active",0),this.sender=null}async toggleDialog(){this.isOpen?this.closeDialog():this.openDialog()}async openDialog(){this.isOpen=!0;const t=this.editor.Panels.getPanel("options")?.view.el.querySelector(".publish-button");if(t){const e=t.getBoundingClientRect(),n=450,r=20,o=50;this.move({left:e.right-n-r,top:e.bottom+10,width:n,minHeight:o})}else console.error("Unable to find publish button");this.renderDialog(null,hr.STATUS_NONE)}}var er;function nr(t,e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>e(t)))}))}!function(t){t.STARTUP_START="silex:startup:start",t.STARTUP_END="silex:startup:end",t.GRAPESJS_START="silex:grapesjs:start",t.GRAPESJS_END="silex:grapesjs:end",t.PUBLISH_START="silex:publish:start",t.PUBLISH_DATA="silex:publish:data",t.PUBLISH_END="silex:publish:end",t.PUBLISH_ERROR="silex:publish:error",t.PUBLISH_LOGIN_START="silex:publish:login:start",t.PUBLISH_LOGIN_END="silex:publish:login:end",t.ASSET_WRITE_END="silex:asset:write:end",t.WRITE_END="silex:write:end"}(er||(er={}));const rr="tmp-pre-publication-transformer-tohtml",or="tmp-pre-publication-transformer-src",ir="tmp-pre-publication-transformer-inline-css",sr="tmp-pre-publication-transformer-href",ar="tmp-pre-publication-transformer-tocss";function lr(t,e){const n=e["background-image"],r=n?.match(/url\(["']?(.*?)["']?\)/)?.pop();return r?{...e,"background-image":`url(${cr(t,r,$.ASSET)})`}:e}function cr(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPermalink?e.transformPermalink(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}function ur(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPath?e.transformPath(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}const pr="publish",dr="publish-login",fr="publish-logout";var hr;function gr(t,e){t.PublicationManager=new mr(t,e)}function vr(t){switch(t){case H.IN_PROGRESS:return hr.STATUS_PENDING;case H.ERROR:return hr.STATUS_ERROR;case H.SUCCESS:return hr.STATUS_SUCCESS}throw new Error(`Unknown job status ${t}`)}!function(t){t.STATUS_NONE="STATUS_NONE",t.STATUS_PENDING="STATUS_PENDING",t.STATUS_ERROR="STATUS_ERROR",t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_LOGGED_OUT="STATUS_AUTH_ERROR"}(hr||(hr={}));class mr{editor;dialog;_settings;get settings(){return this._settings}set settings(t){this._settings=t,this.dialog&&(this.dialog.settings=t)}options;job=null;status=hr.STATUS_NONE;constructor(t,e){this.editor=t,this.options={appendTo:"options",...e},t.on("storage:start:store",(t=>{t.publication=this.settings})),t.on("storage:end:load",(t=>{this.settings=t.publication??{},ze({type:R.HOSTING,connectorId:this.settings.connector?.connectorId}).then((t=>{})).catch((t=>{this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login",this.job,this.status)}))})),t.Commands.add(pr,(()=>this.startPublication())),t.Commands.add(dr,((t,e,n)=>this.goLogin(n))),t.Commands.add(fr,(()=>this.goLogout())),this.options.appendTo?this.dialog=new tr(t,{appendTo:this.options.appendTo}):console.info("PublicationUi is disabled because no appendTo option is set")}async goLogin(t){this.settings={},this.status=hr.STATUS_LOGGED_OUT,this.dialog&&this.dialog.displayPending(this.job,this.status);const e=t.connectorId,n=t.type;return window.open(t.oauthUrl||`${f}${h}${y}?connectorId=${e}&type=${n}`,"_blank"),new Promise((e=>{const n=async e=>{const r=e.data;"login"===r?.type&&(window.removeEventListener("message",n),r.error?(this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError(r.message,this.job,this.status)):(this.editor.trigger(er.PUBLISH_LOGIN_END),this.settings.connector=t,this.settings.options=r.options,this.status=hr.STATUS_NONE,this.editor.store(null),this.dialog&&this.dialog.displayPending(this.job,this.status)))};window.addEventListener("message",n,!1)}))}async goLogout(){try{await We({type:R.HOSTING,connectorId:this.settings.connector.connectorId}),this.settings={},this.dialog&&this.dialog.displayPending(this.job,this.status)}catch(t){console.error("logout error",t),this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(t.message,this.job,this.status)}}async startPublication(){if(this.status===hr.STATUS_PENDING)throw new Error("Publication is already in progress");this.status=hr.STATUS_PENDING,this.job=null,this.dialog&&this.dialog.displayPending(this.job,this.status),this.editor.trigger(er.PUBLISH_START);const t=this.editor.getModel().get("user");if(!t)throw new Error("User not logged in to a storage connector");if(!this.settings.connector?.connectorId)throw new Error("User not logged in to a hosting connector");const e=this.options.websiteId,n=t.storage.connectorId;this.setPublicationTransformers();const r=this.editor.getProjectData(),o=this.editor.getModel().get("settings"),i=(await this.getHtmlFiles(o)).flatMap((t=>[{path:t.htmlPath,content:t.html,type:$.HTML},{path:t.cssPath,content:t.css,type:$.CSS}])).concat(r.assets.map((t=>{const e=t.src.replace(/^\/assets/,""),n=ur(this.editor,e,$.ASSET),r=cr(this.editor,e,$.ASSET);return{...t,path:n,src:r,type:$.ASSET}}))),s={...r,settings:o,publication:this.settings,files:i};this.resetPublicationTransformers(),function(t,e){const n=t.getModel().get("config");e.files=n.publicationTransformers.reduce(((t,n)=>t.map(((t,r)=>{try{return e.pages[r],n.transformFile?n.transformFile(t)??t:t}catch(e){return console.error("Publication transformer: error transforming file",t,e),t}}))),e.files)}(this.editor,s),this.editor.trigger(er.PUBLISH_DATA,s);try{const[t,r]=await qe({websiteId:e,hostingId:this.settings.connector.connectorId,storageId:n,data:s,options:this.settings.options});this.job=r,this.status=vr(this.job.status),this.trackProgress()}catch(t){return console.error("publish error",t),401===t.code||401===t.httpStatusCode?(this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login.",this.job,this.status)):(this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status)),this.editor.trigger(er.PUBLISH_ERROR,{success:!1,message:t.message}),void this.editor.trigger(er.PUBLISH_END,{success:!1,message:t.message})}}async getHtmlFiles(t){return this.editor.Pages.getAll().map((e=>{const n=e.get("settings");function r(e){return(n||{})[e]||(t||[])[e]||""}const o=e.getMainComponent(),i=qn(e.get("name")),s=`/css/${i}.css`,a=`/${i}.html`,l=cr(this.editor,s,$.CSS),c=ur(this.editor,s,$.CSS),u=ur(this.editor,a,$.HTML);return{html:`\n <!DOCTYPE html>\n <html lang="${r("lang")}">\n <head>\n <link rel="stylesheet" href="${l}" />\n ${t?.head||""}\n ${n?.head||""}\n <title>${r("title")}</title>\n <link rel="icon" href="${r("favicon")}" />\n ${["description","og:title","og:description","og:image"].map((t=>`<meta property="${t}" content="${r(t)}"/>`)).join("\n")}\n </head>\n ${this.editor.getHtml({component:o})}\n </html>\n `,css:this.editor.getCss({component:o}),cssPath:c,htmlPath:u}}))}async trackProgress(){try{this.job=await Ge({jobId:this.job.jobId}),this.status=vr(this.job.status)}catch(t){return this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status),this.editor.trigger(er.PUBLISH_END,{success:!1,message:t.message}),void this.editor.trigger(er.PUBLISH_ERROR,{success:!1,message:t.message})}this.job.status===H.IN_PROGRESS?setTimeout((()=>this.trackProgress()),2e3):this.editor.trigger(er.PUBLISH_END,{success:this.job.status===H.SUCCESS,message:this.job.message}),this.dialog&&this.dialog.displayPending(this.job,this.status)}setPublicationTransformers(){!function(t){const e=t.getModel().get("config");nr(t,(n=>{if(n.get(rr))console.warn("Publication transformer: HTML transform already altered",n);else{const r=n.toHTML.bind(n);n[rr]=n.toHTML;const o=n.getStyle.bind(n);n[ir]=n.getStyle;const i=n.get("attributes").href;if(i?.startsWith("./")&&(n[sr]=i,n.set("attributes",{...n.get("attributes"),href:cr(t,i,$.HTML)})),n.get("attributes").src){n[or]=n.get("attributes").src;const e=cr(t,n.get("attributes").src,$.ASSET);n.set("attributes",{...n.get("attributes"),src:e})}n.toHTML=()=>e.publicationTransformers.reduce(((t,e)=>{try{return e.renderComponent?e.renderComponent(n,(()=>t))??t:t}catch(e){return console.error("Publication transformer: error rendering component",n,e),t}}),r()),n.getStyle=()=>lr(t,o())}}))}(this.editor),function(t){const e=t.getModel().get("config");t.Css.getAll().forEach((n=>{if(n[ar])console.warn("Publication transformer: CSS transform already altered",n);else{const r=n.getStyle.bind(n);n[ar]=n.getStyle,n.getStyle=()=>{try{const n=e.publicationTransformers.reduce(((t,e)=>({...e.renderCssRule?e.renderCssRule(t,r)??t:t})),lr(t,r()));return n}catch(t){return console.error("Publication transformer: error rendering style",n,t),r()}}}}))}(this.editor)}resetPublicationTransformers(){!function(t){nr(t,(t=>{t[rr]&&(t.toHTML=t[rr],delete t[rr]),t[ir]&&(t.getStyle=t[ir],delete t[ir]),t[or]&&(t.set("attributes",{...t.get("attributes"),src:t[or]}),delete t[or]),t[sr]&&(t.set("attributes",{...t.get("attributes"),href:t[sr]}),delete t[sr])}))}(this.editor),function(t){t.Css.getAll().forEach((t=>{t[ar]&&(t.getStyle=t[ar],delete t[ar])}))}(this.editor)}}const yr=[{name:"./project-bar",value:Ln},{name:"./settings",value:Rn},{name:"@silexlabs/grapesjs-fonts",value:He()},{name:"./new-page-dialog",value:Mn},{name:"./page-panel",value:Cn},{name:"grapesjs-blocks-basic",value:it()},{name:"./blocks",value:(t,e)=>{const n="container";t.BlockManager.add(n,{label:"Container",category:"Basics",attributes:{class:"container-png"},content:{type:n,style:{"min-height":"100px"}}}),t.DomComponents.addType(n,{})}},{name:"./semantic",value:zn},{name:"./rich-text",value:Wn},{name:"grapesjs-style-filter",value:at()},{name:"grapesjs-plugin-forms",value:ct()},{name:"grapesjs-custom-code",value:pt()},{name:"./internal-links",value:Yn},{name:"@silexlabs/grapesjs-ui-suggest-classes",value:ft()},{name:"./symbolDialogs",value:Ve},{name:"@silexlabs/grapesjs-symbols",value:Ie},{name:"./PublicationManager",value:gr},{name:"./storage",value:t=>{function e(e){const n="string"==typeof e?JSON.parse(e):e;if(console.error("Error with loading or saving website or uploading asset",n,n instanceof N),!(n instanceof N))return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`});switch(console.error("ApiError",n.httpStatusCode,n.message),n.httpStatusCode){case 404:return t.Modal.open({title:"Website not found",content:`This website could not be found.<br><hr>${n.message}`});case 403:return t.Modal.open({title:"Access denied",content:`You are not allowed to access this website.<br><hr>${n.message}`});case 401:return void t.trigger(pn);default:return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`})}}t.Storage.add("connector",{async load(e){try{const i=await dn(t)??await fn(t,R.STORAGE,e.connectorId);if(i){const t=await Je({websiteId:e.id,connectorId:i.storage.connectorId});return t.assets&&(t.assets=(n=t.assets,r=e.id,o=i.storage.connectorId,n.map((t=>({...t,src:V(t.src,r,o)}))))),t.pages&&(t.pages=function(t,e,n){return t.map((t=>({...t,frames:t.frames.map((t=>({...t,component:z(t.component,e,n)})))})))}(t.pages,e.id,i.storage.connectorId)),t.styles&&(t.styles=function(t,e,n){const r=/url\((["']?)([^"']+?)\1\)/g;return t.map((t=>{if(t.style&&t.style["background-image"]){const o=[...t.style["background-image"].matchAll(r)].map((t=>V(t[2],e,n)));return{...t,style:{...t.style,"background-image":o.map((t=>`url('${t}')`)).join(", ")}}}return t}))}(t.styles,e.id,i.storage.connectorId)),t}return new Promise(((n,r)=>{t.once(cn,(async()=>{try{t.StorageManager.setAutosave(!1);const r=await t.Storage.load(e);t.StorageManager.setAutosave(!0),n(r)}catch(t){console.error("connectorPlugin load error",t),r(t)}})),t.Commands.run(sn)}))}catch(t){throw console.error("connectorPlugin load error",t),t}var n,r,o},async store(e,n){try{if(await dn(t)){const r=await dn(t);e.assets=e.assets.map((t=>({...t,src:U(t.src)}))),e.pages=e.pages.map((t=>({...t,frames:t.frames.map((t=>({...t,component:W(t.component)})))}))),e.styles=function(t){const e=/url\((["']?)([^"']+?)\1\)/g;return t.map((t=>{if(t.style&&t.style["background-image"]){const n=[...t.style["background-image"].matchAll(e)].map((t=>U(t[2])));return{...t,style:{...t.style,"background-image":n.map((t=>`url('${t}')`)).join(", ")}}}return t}))}(e.styles),await Xe({websiteId:n.id,connectorId:r.storage.connectorId,data:e})}else t.once(cn,(()=>t.Storage.save(n))),t.Commands.run(sn)}catch(t){throw console.error("connectorPlugin store error",t),t}}}),t.on("storage:error:load",(t=>{e(t)})),t.on("storage:error:store",(t=>{e(t)})),t.on("asset:upload:end",(e=>{t.store()})),t.on("asset:upload:error",(t=>{e(t)}))}},{name:"./LoginDialog",value:vn},{name:"@silexlabs/grapesjs-loading",value:$e()},{name:"./breadcrumbs",value:function(t,e){let n;var r;function o(){let e=t.getSelected()??t.Pages.getSelected().getMainComponent();if(!n)return;for(n.innerHTML="";e;){const t=i(e);n.prepend(t),console.log(e,e.tagName),e=e.parent()}const r=document.createElement("span");r.innerHTML="<h3>Selection:&nbsp;</h3>",n.prepend(r)}function i(e){const n=document.createElement("span");return e.model,n.onclick=()=>{t.select(e)},n.classList.add("breadcrumb"),n.innerHTML=`<span>${e.get("tagName")}${e.getClasses().length?`.${e.getClasses().join(".")}`:""}</span>`,n}r=t=>{n=document.createElement("div"),n.id="breadcrumbs-container",t.prepend(n);const e=document.createElement("style");e.innerHTML='\n #breadcrumbs-container {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0 10px;\n font-size: 12px;\n color: #999;\n }\n #breadcrumbs-container h3 {\n margin: 0;\n }\n #breadcrumbs-container .breadcrumb {\n margin: 5px;\n font-size: large;\n line-height: 1;\n cursor: pointer;\n }\n #breadcrumbs-container .breadcrumb span {\n text-decoration: underline;\n }\n #breadcrumbs-container .breadcrumb::after {\n content: "➔";\n margin-left: 10px;\n }\n\n #breadcrumbs-container .breadcrumb:last-child::after {\n content: "";\n }\n ',t.prepend(e),o()},mn?r(mn):bn.push(r),t.on("component:selected style",(()=>o()))}},{name:"./footer",value:function(t,e){const n=t.Panels.addPanel({id:"footer",visible:!0,buttons:[{id:"myNewButton",className:"someClass",command:"someCommand",attributes:{title:"Some title"},active:!1}]});setTimeout((()=>{mn=n.view?.el,bn.forEach((t=>t(mn))),bn=[]}))}}];yr.filter((t=>"function"!=typeof t.value)).forEach((t=>{throw new Error(`Plugin ${t.name} could not be loaded correctly (${t.value})`)}));const br="Containers",wr="Components";function _r(t,e,n){return{container:"#gjs",height:"100%",showOffsets:!0,showDevices:!0,layerManager:{appendTo:".layer-manager-container"},blockManager:{appendTo:".block-manager-container"},assetManager:{upload:`${n}${f}${S}${j}/?websiteId=${t}${e?`&connectorId=${e}`:""}`},storageManager:{autoload:!1,type:"connector",options:{connector:{id:t,connectorId:e}}},cssIcons:"/css/all.min.css",plugins:yr.map((t=>t.value)),pluginsOpts:{[it()]:{blocks:["text","image","video","map"],category:br},[Ln]:{panels:[{id:"dash",className:"logo",attributes:{title:"Go to your dashboard"},link:"/",command:"open-dash"},{id:"block-manager-btn",className:"block-manager-btn fa fa-fw fa-plus",attributes:{title:"Blocks",containerClassName:"block-manager-container"},command:"open-blocks"},{id:"symbols-btn",className:"symbols-btn fa-regular fa-gem",attributes:{title:"Symbols",containerClassName:"symbols-list-container"},command:"open-symbols",buttons:[{id:"symbol-create-button",className:"pages__add-page fa-solid fa-plus",label:"Create symbol from selection",command:Fe}]},{id:"page-panel-btn",className:"page-panel-btn fa fa-fw fa-file",attributes:{title:"Pages",containerClassName:"page-panel-container"},command:wn,buttons:[{className:"pages__add-page fa fa-file",command:_n,text:"+"}]},{id:"layer-manager-btn",className:"layer-manager-btn fa-solid fa-layer-group",attributes:{title:"Layers",containerClassName:"layer-manager-container"},command:"open-layers"},{id:"font-dialog-btn",className:"font-manager-btn fa-solid fa-font",attributes:{title:"Fonts"},command:Re.cmdOpenFonts},{id:"settings-dialog-btn",className:"page-panel-btn fa-solid fa-gears",attributes:{title:"Settings"},command:Dn},{id:"spacer",attributes:{},className:"project-bar-spacer"},{id:"logout-button",className:"page-panel-btn fa fa-fw fa-sign-out",attributes:{title:"Sign out"},command:an}]},[gr]:{appendTo:"options",websiteId:t},[Cn]:{cmdOpenNewPageDialog:jn,cmdOpenSettings:Dn,appendTo:".page-panel-container"},[ft()]:{enableCount:!1,enablePerformance:!1},[Yn]:{onError:t=>console.warn("Links errors:",t)},[pt()]:{blockLabel:"HTML",blockCustomCode:{category:wr}},[Ie]:{appendTo:".symbols-list-container"},[He()]:{api_key:"AIzaSyAdJTYSLPlKz4w5Iqyy-JAF2o8uQKd1FKc"},[vn]:{id:t}}}}let xr;async function Cr(t){if(xr)throw new Error("Grapesjs editor already created");return new Promise(((e,n)=>{try{xr=rt().init(t)}catch(t){console.error("Error initializing GrapesJs with plugins:",yr,t),n(t)}["text"].forEach((t=>xr.Blocks.get(t)?.set("category","Basics"))),["image","video"].forEach((t=>xr.Blocks.get(t)?.set("category","Media"))),["map"].forEach((t=>xr.Blocks.get(t)?.set("category","Components"))),xr.Blocks.render([]),xr.Commands.add("gjs-open-import-webpage",function(t,e){const n=t.getConfig("stylePrefix"),r=t.Modal,o=t.CodeManager.getViewer("CodeMirror").clone(),i=document.createElement("div"),s=e.modalImportLabel,a=e.modalImportContent;let l=o.editor;const c=document.createElement("button");return c.type="button",c.innerHTML=e.modalImportButton,c.className=`${n}btn-prim ${n}btn-import`,c.onclick=e=>{t.setComponents(l.getValue().trim()),r.close()},o.set({codeName:"htmlmixed",theme:"hopscotch",readOnly:0,...e.importViewerOptions}),{run(u){if(!l){const t=document.createElement("textarea");if(s){const t=document.createElement("div");t.className=`${n}import-label`,t.innerHTML=s,i.appendChild(t)}i.appendChild(t),i.appendChild(c),o.init(t),l=o.editor}r.setTitle(e.modalImportTitle),r.setContent(i);const p="function"==typeof a?a(t):a;o.setContent(p||""),r.open().getModel().once("change:open",(()=>t.stopCommand(this.id))),l.refresh()},stop(){r.close()}}}(xr,{modalImportLabel:"",modalImportContent:"Paste a web page HTML code here.",modalImportButton:"Import",modalImportTitle:"Import from website"})),xr.on("load",(()=>{xr.Panels.getPanel("views").buttons.remove("open-blocks"),xr.Panels.getPanel("views").buttons.remove("open-layers"),xr.Panels.getPanel("views").view.el.firstChild.style.justifyContent="initial",xr.Panels.getPanel("options").buttons.remove("export-template"),xr.BlockManager.render(null),xr.StyleManager.addProperty("extra",{extend:"filter"}),e(xr)}))}))}function Sr(){return xr}class Or extends et{api=o;websiteId=new URL(location.href).searchParams.get("id")??u;storageId=new URL(location.href).searchParams.get("connectorId");lang=new URL(location.href).searchParams.get("lang")??p;rootUrl=window.location.origin;debug=!1;grapesJsConfig;clientConfigUrl=`${this.rootUrl}/${d}`;initGrapesConfig(){this.grapesJsConfig=_r(this.websiteId,this.storageId,this.rootUrl)}getEditor(){return Sr()}publicationTransformers=[];addPublicationTransformers(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{!function(t){const e=["renderComponent","renderCssRule","transformFile","transformPermalink","transformPath"];Object.keys(t).forEach((t=>{if(!e.includes(t))throw new Error(`Publication transformer: unknown property ${t}`)})),e.forEach((e=>{if("function"!=typeof t[e]&&void 0!==t[e])throw new Error(`Publication transformer: ${e} must be a function`)}))}(t)})),this.publicationTransformers=this.publicationTransformers.concat(t)}}async function Tr(t={}){const e=new Or;Object.assign(e,t),e.addPublicationTransformers(B),await e.addPlugin(e.clientConfigUrl,{}),e.debug&&console.warn("Silex starting in debug mode.",{config:e}),e.emit(er.STARTUP_START),e.initGrapesConfig(),e.emit(er.GRAPESJS_START);try{await Cr(e.grapesJsConfig)}catch(t){throw console.error("Error starting Silex",t),t}const n=Sr();n.getModel().set("config",e),e.emit(er.GRAPESJS_END,{editor:n}),n.I18n.setLocale(e.lang),n.StorageManager.setAutosave(!1);try{await n.load(null)}catch(t){t.httpStatusCode}finally{setTimeout((()=>{n.editor.set("changesCount",0),n.StorageManager.setAutosave(!0),document.querySelector(".silex-loader").classList.add("silex-dialog-hide"),document.querySelector("#gjs").classList.remove("silex-dialog-hide"),e.emit(er.STARTUP_END,{editor:n,config:e})}),100)}}console.info("\nSilex client loaded\n")})(),silex=r})();
322
+ `}}displayPending(t,e){this.errorMessage=null,this.renderDialog(t,e)}displayError(t,e,n){console.info(t),this.errorMessage=t,this.renderDialog(e,n)}async closeDialog(){this.isOpen=!1,this.renderDialog(null,null),this.sender&&this.sender.set("active",0),this.sender=null}async toggleDialog(){this.isOpen?this.closeDialog():this.openDialog()}async openDialog(){this.isOpen=!0;const t=this.editor.Panels.getPanel("options")?.view.el.querySelector(".publish-button");if(t){const e=t.getBoundingClientRect(),n=450,r=20,o=50;this.move({left:e.right-n-r,top:e.bottom+10,width:n,minHeight:o})}else console.error("Unable to find publish button");this.renderDialog(null,hr.STATUS_NONE)}}var er;function nr(t,e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>e(t)))}))}!function(t){t.STARTUP_START="silex:startup:start",t.STARTUP_END="silex:startup:end",t.GRAPESJS_START="silex:grapesjs:start",t.GRAPESJS_END="silex:grapesjs:end",t.PUBLISH_START="silex:publish:start",t.PUBLISH_DATA="silex:publish:data",t.PUBLISH_END="silex:publish:end",t.PUBLISH_ERROR="silex:publish:error",t.PUBLISH_LOGIN_START="silex:publish:login:start",t.PUBLISH_LOGIN_END="silex:publish:login:end",t.ASSET_WRITE_END="silex:asset:write:end",t.WRITE_END="silex:write:end"}(er||(er={}));const rr="tmp-pre-publication-transformer-tohtml",or="tmp-pre-publication-transformer-src",ir="tmp-pre-publication-transformer-inline-css",sr="tmp-pre-publication-transformer-href",ar="tmp-pre-publication-transformer-tocss";function lr(t,e){const n=e["background-image"],r=n?.match(/url\(["']?(.*?)["']?\)/)?.pop();return r?{...e,"background-image":`url(${cr(t,r,$.ASSET)})`}:e}function cr(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPermalink?e.transformPermalink(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}function ur(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPath?e.transformPath(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}const pr="publish",dr="publish-login",fr="publish-logout";var hr;function gr(t,e){t.PublicationManager=new mr(t,e)}function vr(t){switch(t){case H.IN_PROGRESS:return hr.STATUS_PENDING;case H.ERROR:return hr.STATUS_ERROR;case H.SUCCESS:return hr.STATUS_SUCCESS}throw new Error(`Unknown job status ${t}`)}!function(t){t.STATUS_NONE="STATUS_NONE",t.STATUS_PENDING="STATUS_PENDING",t.STATUS_ERROR="STATUS_ERROR",t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_LOGGED_OUT="STATUS_AUTH_ERROR"}(hr||(hr={}));class mr{editor;dialog;_settings;get settings(){return this._settings}set settings(t){this._settings=t,this.dialog&&(this.dialog.settings=t)}options;job=null;status=hr.STATUS_NONE;constructor(t,e){this.editor=t,this.options={appendTo:"options",...e},t.on("storage:start:store",(t=>{t.publication=this.settings})),t.on("storage:end:load",(t=>{this.settings=t.publication??{},ze({type:R.HOSTING,connectorId:this.settings.connector?.connectorId}).then((t=>{})).catch((t=>{this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login",this.job,this.status)}))})),t.Commands.add(pr,(()=>this.startPublication())),t.Commands.add(dr,((t,e,n)=>this.goLogin(n))),t.Commands.add(fr,(()=>this.goLogout())),this.options.appendTo?this.dialog=new tr(t,{appendTo:this.options.appendTo}):console.info("PublicationUi is disabled because no appendTo option is set")}async goLogin(t){this.settings={},this.status=hr.STATUS_LOGGED_OUT,this.dialog&&this.dialog.displayPending(this.job,this.status);const e=t.connectorId,n=t.type;return window.open(t.oauthUrl||`${f}${h}${y}?connectorId=${e}&type=${n}`,"_blank"),new Promise((e=>{const n=async e=>{const r=e.data;"login"===r?.type&&(window.removeEventListener("message",n),r.error?(this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError(r.message,this.job,this.status)):(this.editor.trigger(er.PUBLISH_LOGIN_END),this.settings.connector=t,this.settings.options=r.options,this.status=hr.STATUS_NONE,this.editor.store(null),this.dialog&&this.dialog.displayPending(this.job,this.status)))};window.addEventListener("message",n,!1)}))}async goLogout(){try{await We({type:R.HOSTING,connectorId:this.settings.connector.connectorId}),this.settings={},this.dialog&&this.dialog.displayPending(this.job,this.status)}catch(t){console.error("logout error",t),this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(t.message,this.job,this.status)}}async startPublication(){if(this.status===hr.STATUS_PENDING)throw new Error("Publication is already in progress");this.status=hr.STATUS_PENDING,this.job=null,this.dialog&&this.dialog.displayPending(this.job,this.status),this.editor.trigger(er.PUBLISH_START);const t=this.editor.getModel().get("user");if(!t)throw new Error("User not logged in to a storage connector");if(!this.settings.connector?.connectorId)throw new Error("User not logged in to a hosting connector");const e=this.options.websiteId,n=t.storage.connectorId;this.setPublicationTransformers();const r=this.editor.getProjectData(),o=this.editor.getModel().get("settings"),i=(await this.getHtmlFiles(o)).flatMap((t=>[{path:t.htmlPath,content:t.html,type:$.HTML},{path:t.cssPath,content:t.css,type:$.CSS}])).concat(r.assets.map((t=>{const e=t.src.replace(/^\/assets/,""),n=ur(this.editor,e,$.ASSET),r=cr(this.editor,e,$.ASSET);return{...t,path:n,src:r,type:$.ASSET}}))),s={...r,settings:o,publication:this.settings,files:i};this.resetPublicationTransformers(),function(t,e){const n=t.getModel().get("config");e.files=n.publicationTransformers.reduce(((t,n)=>t.map(((t,r)=>{try{return e.pages[r],n.transformFile?n.transformFile(t)??t:t}catch(e){return console.error("Publication transformer: error transforming file",t,e),t}}))),e.files)}(this.editor,s),this.editor.trigger(er.PUBLISH_DATA,s);try{const[t,r]=await qe({websiteId:e,hostingId:this.settings.connector.connectorId,storageId:n,data:s,options:this.settings.options});this.job=r,this.status=vr(this.job.status),this.trackProgress()}catch(t){return console.error("publish error",t),401===t.code||401===t.httpStatusCode?(this.status=hr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login.",this.job,this.status)):(this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status)),this.editor.trigger(er.PUBLISH_ERROR,{success:!1,message:t.message}),void this.editor.trigger(er.PUBLISH_END,{success:!1,message:t.message})}}async getHtmlFiles(t){return this.editor.Pages.getAll().map((e=>{const n=e.get("settings");function r(e){return(n||{})[e]||(t||[])[e]||""}const o=e.getMainComponent(),i=qn(e.get("name")),s=`/css/${i}.css`,a=`/${i}.html`,l=cr(this.editor,s,$.CSS),c=ur(this.editor,s,$.CSS),u=ur(this.editor,a,$.HTML);return{html:`\n <!DOCTYPE html>\n <html lang="${r("lang")}">\n <head>\n <link rel="stylesheet" href="${l}" />\n ${t?.head||""}\n ${n?.head||""}\n <title>${r("title")}</title>\n <link rel="icon" href="${r("favicon")}" />\n ${["description","og:title","og:description","og:image"].map((t=>`<meta property="${t}" content="${r(t)}"/>`)).join("\n")}\n </head>\n ${this.editor.getHtml({component:o})}\n </html>\n `,css:this.editor.getCss({component:o}),cssPath:c,htmlPath:u}}))}async trackProgress(){try{this.job=await Ge({jobId:this.job.jobId}),this.status=vr(this.job.status)}catch(t){return this.status=hr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status),this.editor.trigger(er.PUBLISH_END,{success:!1,message:t.message}),void this.editor.trigger(er.PUBLISH_ERROR,{success:!1,message:t.message})}this.job.status===H.IN_PROGRESS?setTimeout((()=>this.trackProgress()),2e3):this.editor.trigger(er.PUBLISH_END,{success:this.job.status===H.SUCCESS,message:this.job.message}),this.dialog&&this.dialog.displayPending(this.job,this.status)}setPublicationTransformers(){!function(t){const e=t.getModel().get("config");nr(t,(n=>{if(n.get(rr))console.warn("Publication transformer: HTML transform already altered",n);else{const r=n.toHTML.bind(n);n[rr]=n.toHTML;const o=n.getStyle.bind(n);n[ir]=n.getStyle;const i=n.get("attributes").href;if(i?.startsWith("./")&&(n[sr]=i,n.set("attributes",{...n.get("attributes"),href:cr(t,i,$.HTML)})),n.get("attributes").src){n[or]=n.get("attributes").src;const e=cr(t,n.get("attributes").src,$.ASSET);n.set("attributes",{...n.get("attributes"),src:e})}n.toHTML=()=>e.publicationTransformers.reduce(((t,e)=>{try{return e.renderComponent?e.renderComponent(n,(()=>t))??t:t}catch(e){return console.error("Publication transformer: error rendering component",n,e),t}}),r()),n.getStyle=()=>lr(t,o())}}))}(this.editor),function(t){const e=t.getModel().get("config");t.Css.getAll().forEach((n=>{if(n[ar])console.warn("Publication transformer: CSS transform already altered",n);else{const r=n.getStyle.bind(n);n[ar]=n.getStyle,n.getStyle=()=>{try{const n=e.publicationTransformers.reduce(((t,e)=>({...e.renderCssRule?e.renderCssRule(t,r)??t:t})),lr(t,r()));return n}catch(t){return console.error("Publication transformer: error rendering style",n,t),r()}}}}))}(this.editor)}resetPublicationTransformers(){!function(t){nr(t,(t=>{t[rr]&&(t.toHTML=t[rr],delete t[rr]),t[ir]&&(t.getStyle=t[ir],delete t[ir]),t[or]&&(t.set("attributes",{...t.get("attributes"),src:t[or]}),delete t[or]),t[sr]&&(t.set("attributes",{...t.get("attributes"),href:t[sr]}),delete t[sr])}))}(this.editor),function(t){t.Css.getAll().forEach((t=>{t[ar]&&(t.getStyle=t[ar],delete t[ar])}))}(this.editor)}}const yr=[{name:"./project-bar",value:Ln},{name:"./settings",value:Rn},{name:"@silexlabs/grapesjs-fonts",value:He()},{name:"./new-page-dialog",value:Mn},{name:"./page-panel",value:Cn},{name:"grapesjs-blocks-basic",value:it()},{name:"./blocks",value:(t,e)=>{const n="container";t.BlockManager.add(n,{label:"Container",category:"Basics",attributes:{class:"container-png"},content:{type:n,style:{"min-height":"100px"}}}),t.DomComponents.addType(n,{})}},{name:"./semantic",value:zn},{name:"./rich-text",value:Wn},{name:"grapesjs-style-filter",value:at()},{name:"grapesjs-plugin-forms",value:ct()},{name:"grapesjs-custom-code",value:pt()},{name:"./internal-links",value:Yn},{name:"@silexlabs/grapesjs-ui-suggest-classes",value:ft()},{name:"./symbolDialogs",value:Ve},{name:"@silexlabs/grapesjs-symbols",value:Ie},{name:"./PublicationManager",value:gr},{name:"./storage",value:t=>{function e(e){const n="string"==typeof e?JSON.parse(e):e;if(console.error("Error with loading or saving website or uploading asset",n,n instanceof N),!(n instanceof N))return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`});switch(console.error("ApiError",n.httpStatusCode,n.message),n.httpStatusCode){case 404:return t.Modal.open({title:"Website not found",content:`This website could not be found.<br><hr>${n.message}`});case 403:return t.Modal.open({title:"Access denied",content:`You are not allowed to access this website.<br><hr>${n.message}`});case 401:return void t.trigger(pn);default:return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`})}}t.Storage.add("connector",{async load(e){try{const i=await dn(t)??await fn(t,R.STORAGE,e.connectorId);if(i){const t=await Je({websiteId:e.id,connectorId:i.storage.connectorId});return t.assets&&(t.assets=(n=t.assets,r=e.id,o=i.storage.connectorId,n.map((t=>({...t,src:V(t.src,r,o)}))))),t.pages&&(t.pages=function(t,e,n){return t.map((t=>({...t,frames:t.frames.map((t=>({...t,component:z(t.component,e,n)})))})))}(t.pages,e.id,i.storage.connectorId)),t.styles&&(t.styles=function(t,e,n){const r=/url\((["']?)([^"']+?)\1\)/g;return t.map((t=>{if(t.style&&t.style["background-image"]){const o=[...t.style["background-image"].matchAll(r)].map((t=>V(t[2],e,n)));return{...t,style:{...t.style,"background-image":o.map((t=>`url('${t}')`)).join(", ")}}}return t}))}(t.styles,e.id,i.storage.connectorId)),t}return new Promise(((n,r)=>{t.once(cn,(async()=>{try{t.StorageManager.setAutosave(!1);const r=await t.Storage.load(e);t.StorageManager.setAutosave(!0),n(r)}catch(t){console.error("connectorPlugin load error",t),r(t)}})),t.Commands.run(sn)}))}catch(t){throw console.error("connectorPlugin load error",t),t}var n,r,o},async store(e,n){try{if(await dn(t)){const r=await dn(t);e.assets=e.assets.map((t=>({...t,src:U(t.src)}))),e.pages=e.pages.map((t=>({...t,frames:t.frames.map((t=>({...t,component:W(t.component)})))}))),e.styles=function(t){const e=/url\((["']?)([^"']+?)\1\)/g;return t.map((t=>{if(t.style&&t.style["background-image"]){const n=[...t.style["background-image"].matchAll(e)].map((t=>U(t[2])));return{...t,style:{...t.style,"background-image":n.map((t=>`url('${t}')`)).join(", ")}}}return t}))}(e.styles),await Xe({websiteId:n.id,connectorId:r.storage.connectorId,data:e})}else t.once(cn,(()=>t.Storage.save(n))),t.Commands.run(sn)}catch(t){throw console.error("connectorPlugin store error",t),t}}}),t.on("storage:error:load",(t=>{e(t)})),t.on("storage:error:store",(t=>{e(t)})),t.on("asset:upload:end",(e=>{t.store()})),t.on("asset:upload:error",(t=>{e(t)}))}},{name:"./LoginDialog",value:vn},{name:"@silexlabs/grapesjs-loading",value:$e()},{name:"./breadcrumbs",value:function(t,e){let n;var r;function o(){let e=t.getSelected()??t.Pages.getSelected().getMainComponent();if(!n)return;for(n.innerHTML="";e;){const t=i(e);n.prepend(t),console.log(e,e.tagName),e=e.parent()}const r=document.createElement("span");r.innerHTML="<h3>Selection:&nbsp;</h3>",n.prepend(r)}function i(e){const n=document.createElement("span");return e.model,n.onclick=()=>{t.select(e)},n.classList.add("breadcrumb"),n.innerHTML=`<span>${e.getName()??e.get("tagName")}</span>`,n}r=t=>{n=document.createElement("div"),n.id="breadcrumbs-container",t.prepend(n);const e=document.createElement("style");e.innerHTML='\n #breadcrumbs-container {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 5px 10px 0;\n font-size: 12px;\n color: #999;\n overflow-x: auto;\n overflow-y: hidden;\n }\n #breadcrumbs-container h3 {\n margin: 0;\n }\n #breadcrumbs-container .breadcrumb {\n margin: 5px;\n font-size: 15px;\n line-height: 1;\n cursor: pointer;\n white-space: nowrap;\n }\n #breadcrumbs-container .breadcrumb::after {\n content: "➔";\n margin-left: 10px;\n }\n\n #breadcrumbs-container .breadcrumb:last-child::after {\n content: "";\n }\n ',t.prepend(e),o()},mn?r(mn):bn.push(r),t.on("component:selected style:target component:drag:end",(()=>o()))}},{name:"./footer",value:function(t,e){const n=t.Panels.addPanel({id:"footer",visible:!0,buttons:[{id:"myNewButton",className:"someClass",command:"someCommand",attributes:{title:"Some title"},active:!1}]});setTimeout((()=>{mn=n.view?.el,bn.forEach((t=>t(mn))),bn=[]}))}}];yr.filter((t=>"function"!=typeof t.value)).forEach((t=>{throw new Error(`Plugin ${t.name} could not be loaded correctly (${t.value})`)}));const br="Containers",wr="Components";function _r(t,e,n){return{container:"#gjs",height:"100%",showOffsets:!0,showDevices:!0,layerManager:{appendTo:".layer-manager-container"},blockManager:{appendTo:".block-manager-container"},assetManager:{upload:`${n}${f}${S}${j}/?websiteId=${t}${e?`&connectorId=${e}`:""}`},storageManager:{autoload:!1,type:"connector",options:{connector:{id:t,connectorId:e}}},cssIcons:"/css/all.min.css",canvasCss:"\n :root {\n --primaryColor: #333333;\n --secondaryColor: #ddd;\n --tertiaryColor: #8873FE;\n --quaternaryColor: #56E3FF;\n --darkerPrimaryColor: #363636;\n --lighterPrimaryColor: #575757;\n }\n .gjs-frame-selected {\n box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5) !important; // Change to red border\n }\n .gjs-selected {\n outline: 2px solid var(--tertiaryColor) !important;\n outline-offset: -2px;\n }\n .gjs-tools .gjs-badge { /* for the label */\n background-color: red;\n }\n .gjs-toolbar { /* for the toolbar */\n background-color: red;\n }\n ",plugins:yr.map((t=>t.value)),pluginsOpts:{[it()]:{blocks:["text","image","video","map"],category:br},[Ln]:{panels:[{id:"dash",className:"logo",attributes:{title:"Dashboard"},link:"/",command:"open-dash"},{id:"block-manager-btn",className:"block-manager-btn fa fa-fw fa-plus",attributes:{title:"Blocks",containerClassName:"block-manager-container"},command:"open-blocks"},{id:"symbols-btn",className:"symbols-btn fa-regular fa-gem",attributes:{title:"Symbols",containerClassName:"symbols-list-container"},command:"open-symbols",buttons:[{id:"symbol-create-button",className:"pages__add-page fa-solid fa-plus",label:"Create symbol from selection",command:Fe}]},{id:"page-panel-btn",className:"page-panel-btn fa fa-fw fa-file",attributes:{title:"Pages",containerClassName:"page-panel-container"},command:wn,buttons:[{className:"pages__add-page fa fa-file",command:_n,text:"+"}]},{id:"layer-manager-btn",className:"layer-manager-btn fa-solid fa-layer-group",attributes:{title:"Layers",containerClassName:"layer-manager-container"},command:"open-layers"},{id:"font-dialog-btn",className:"font-manager-btn fa-solid fa-font",attributes:{title:"Fonts"},command:Re.cmdOpenFonts},{id:"settings-dialog-btn",className:"page-panel-btn fa-solid fa-gears",attributes:{title:"Settings"},command:Dn},{id:"spacer",attributes:{},className:"project-bar-spacer"},{id:"dash2",className:"fa-solid fa-house",attributes:{title:"Dashboard"},link:"/",command:"open-dash"},{id:"help",className:"fa fa-fw fa-question-circle",attributes:{title:"Documentation"},link:"https://docs.silex.me/",command:"open-help"},{id:"logout-button",className:"page-panel-btn fa fa-fw fa-sign-out",attributes:{title:"Sign out"},command:an}]},[gr]:{appendTo:"options",websiteId:t},[Cn]:{cmdOpenNewPageDialog:jn,cmdOpenSettings:Dn,appendTo:".page-panel-container"},[ft()]:{enableCount:!1,enablePerformance:!1},[Yn]:{onError:t=>console.warn("Links errors:",t)},[pt()]:{blockLabel:"HTML",blockCustomCode:{category:wr}},[Ie]:{appendTo:".symbols-list-container"},[He()]:{api_key:"AIzaSyAdJTYSLPlKz4w5Iqyy-JAF2o8uQKd1FKc"},[vn]:{id:t}}}}let xr;async function Cr(t){if(xr)throw new Error("Grapesjs editor already created");return new Promise(((e,n)=>{try{xr=rt().init(t)}catch(t){console.error("Error initializing GrapesJs with plugins:",yr,t),n(t)}["text"].forEach((t=>xr.Blocks.get(t)?.set("category","Basics"))),["image","video"].forEach((t=>xr.Blocks.get(t)?.set("category","Media"))),["map"].forEach((t=>xr.Blocks.get(t)?.set("category","Components"))),xr.Blocks.render([]),xr.Commands.add("gjs-open-import-webpage",function(t,e){const n=t.getConfig("stylePrefix"),r=t.Modal,o=t.CodeManager.getViewer("CodeMirror").clone(),i=document.createElement("div"),s=e.modalImportLabel,a=e.modalImportContent;let l=o.editor;const c=document.createElement("button");return c.type="button",c.innerHTML=e.modalImportButton,c.className=`${n}btn-prim ${n}btn-import`,c.onclick=e=>{t.setComponents(l.getValue().trim()),r.close()},o.set({codeName:"htmlmixed",theme:"hopscotch",readOnly:0,...e.importViewerOptions}),{run(u){if(!l){const t=document.createElement("textarea");if(s){const t=document.createElement("div");t.className=`${n}import-label`,t.innerHTML=s,i.appendChild(t)}i.appendChild(t),i.appendChild(c),o.init(t),l=o.editor}r.setTitle(e.modalImportTitle),r.setContent(i);const p="function"==typeof a?a(t):a;o.setContent(p||""),r.open().getModel().once("change:open",(()=>t.stopCommand(this.id))),l.refresh()},stop(){r.close()}}}(xr,{modalImportLabel:"",modalImportContent:"Paste a web page HTML code here.",modalImportButton:"Import",modalImportTitle:"Import from website"})),xr.on("load",(()=>{xr.Panels.getPanel("views").buttons.remove("open-blocks"),xr.Panels.getPanel("views").buttons.remove("open-layers"),xr.Panels.getPanel("views").view.el.firstChild.style.justifyContent="initial",xr.Panels.getPanel("options").buttons.remove("export-template"),xr.BlockManager.render(null),xr.StyleManager.addProperty("extra",{extend:"filter"}),e(xr)}))}))}function Sr(){return xr}class Or extends et{api=o;websiteId=new URL(location.href).searchParams.get("id")??u;storageId=new URL(location.href).searchParams.get("connectorId");lang=new URL(location.href).searchParams.get("lang")??p;rootUrl=window.location.origin;debug=!1;grapesJsConfig;clientConfigUrl=`${this.rootUrl}/${d}`;initGrapesConfig(){this.grapesJsConfig=_r(this.websiteId,this.storageId,this.rootUrl)}getEditor(){return Sr()}publicationTransformers=[];addPublicationTransformers(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{!function(t){const e=["renderComponent","renderCssRule","transformFile","transformPermalink","transformPath"];Object.keys(t).forEach((t=>{if(!e.includes(t))throw new Error(`Publication transformer: unknown property ${t}`)})),e.forEach((e=>{if("function"!=typeof t[e]&&void 0!==t[e])throw new Error(`Publication transformer: ${e} must be a function`)}))}(t)})),this.publicationTransformers=this.publicationTransformers.concat(t)}}async function Tr(t={}){const e=new Or;Object.assign(e,t),e.addPublicationTransformers(B),await e.addPlugin(e.clientConfigUrl,{}),e.debug&&console.warn("Silex starting in debug mode.",{config:e}),e.emit(er.STARTUP_START),e.initGrapesConfig(),e.emit(er.GRAPESJS_START);try{await Cr(e.grapesJsConfig)}catch(t){throw console.error("Error starting Silex",t),t}const n=Sr();n.getModel().set("config",e),e.emit(er.GRAPESJS_END,{editor:n}),n.I18n.setLocale(e.lang),n.StorageManager.setAutosave(!1);try{await n.load(null)}catch(t){t.httpStatusCode}finally{setTimeout((()=>{n.editor.set("changesCount",0),n.StorageManager.setAutosave(!0),document.querySelector(".silex-loader").classList.add("silex-dialog-hide"),document.querySelector("#gjs").classList.remove("silex-dialog-hide"),e.emit(er.STARTUP_END,{editor:n,config:e})}),100)}}console.info("\nSilex client loaded\n")})(),silex=r})();
@@ -13,21 +13,21 @@ export default function (editor, options) {
13
13
  display: flex;
14
14
  align-items: center;
15
15
  height: 100%;
16
- padding: 0 10px;
16
+ padding: 5px 10px 0;
17
17
  font-size: 12px;
18
18
  color: #999;
19
+ overflow-x: auto;
20
+ overflow-y: hidden;
19
21
  }
20
22
  #breadcrumbs-container h3 {
21
23
  margin: 0;
22
24
  }
23
25
  #breadcrumbs-container .breadcrumb {
24
26
  margin: 5px;
25
- font-size: large;
27
+ font-size: 15px;
26
28
  line-height: 1;
27
29
  cursor: pointer;
28
- }
29
- #breadcrumbs-container .breadcrumb span {
30
- text-decoration: underline;
30
+ white-space: nowrap;
31
31
  }
32
32
  #breadcrumbs-container .breadcrumb::after {
33
33
  content: "➔";
@@ -42,7 +42,7 @@ export default function (editor, options) {
42
42
  renderBreadcrumbs();
43
43
  });
44
44
  // Append the breadcrumbs container to the editor's container
45
- editor.on('component:selected style', () => renderBreadcrumbs());
45
+ editor.on('component:selected style:target component:drag:end', () => renderBreadcrumbs());
46
46
  function renderBreadcrumbs() {
47
47
  let component = editor.getSelected() ?? editor.Pages.getSelected().getMainComponent();
48
48
  if (!breadcrumbsContainer)
@@ -68,7 +68,7 @@ export default function (editor, options) {
68
68
  editor.select(component);
69
69
  };
70
70
  breadcrumb.classList.add('breadcrumb');
71
- breadcrumb.innerHTML = `<span>${component.get('tagName')}${component.getClasses().length ? `.${component.getClasses().join('.')}` : ''}</span>`;
71
+ breadcrumb.innerHTML = `<span>${component.getName() ?? component.get('tagName')}</span>`;
72
72
  return breadcrumb;
73
73
  }
74
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../../../src/ts/client/grapesjs/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,CAAC,OAAO,WA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U,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QACtC,UAAU,CAAC,SAAS,GAAG,SAAS,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAA;QACxF,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC"}
@@ -113,6 +113,29 @@ export function getEditorConfig(id, connectorId, rootUrl) {
113
113
  },
114
114
  },
115
115
  cssIcons: '/css/all.min.css',
116
+ canvasCss: `
117
+ :root {
118
+ --primaryColor: #333333;
119
+ --secondaryColor: #ddd;
120
+ --tertiaryColor: #8873FE;
121
+ --quaternaryColor: #56E3FF;
122
+ --darkerPrimaryColor: #363636;
123
+ --lighterPrimaryColor: #575757;
124
+ }
125
+ .gjs-frame-selected {
126
+ box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5) !important; // Change to red border
127
+ }
128
+ .gjs-selected {
129
+ outline: 2px solid var(--tertiaryColor) !important;
130
+ outline-offset: -2px;
131
+ }
132
+ .gjs-tools .gjs-badge { /* for the label */
133
+ background-color: red;
134
+ }
135
+ .gjs-toolbar { /* for the toolbar */
136
+ background-color: red;
137
+ }
138
+ `,
116
139
  plugins: plugins.map(p => p.value),
117
140
  pluginsOpts: {
118
141
  [blocksBasicPlugin]: {
@@ -125,7 +148,7 @@ export function getEditorConfig(id, connectorId, rootUrl) {
125
148
  {
126
149
  id: 'dash',
127
150
  className: 'logo',
128
- attributes: { title: 'Go to your dashboard' },
151
+ attributes: { title: 'Dashboard' },
129
152
  link: '/',
130
153
  command: 'open-dash',
131
154
  }, {
@@ -175,6 +198,18 @@ export function getEditorConfig(id, connectorId, rootUrl) {
175
198
  id: 'spacer',
176
199
  attributes: {},
177
200
  className: 'project-bar-spacer',
201
+ }, {
202
+ id: 'dash2',
203
+ className: 'fa-solid fa-house',
204
+ attributes: { title: 'Dashboard' },
205
+ link: '/',
206
+ command: 'open-dash',
207
+ }, {
208
+ id: 'help',
209
+ className: 'fa fa-fw fa-question-circle',
210
+ attributes: { title: 'Documentation' },
211
+ link: 'https://docs.silex.me/',
212
+ command: 'open-help',
178
213
  }, {
179
214
  id: 'logout-button',
180
215
  className: 'page-panel-btn fa fa-fw fa-sign-out',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ts/client/grapesjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,QAAkC,MAAM,UAAU,CAAA;AACzD,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC;;;GAGG;AAEH,uBAAuB;AACvB,UAAU;AACV,uBAAuB;AACvB,OAAO,iBAAiB,MAAM,uBAAuB,CAAA;AACrD,OAAO,iBAAiB,MAAM,uBAAuB,CAAA;AACrD,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAC9C,OAAO,UAAU,MAAM,sBAAsB,CAAA;AAC7C,OAAO,gBAAgB,MAAM,wCAAwC,CAAA;AACrE,OAAO,aAAa,MAAM,6BAA6B,CAAA;AACvD,OAAO,aAAa,MAAM,6BAA6B,CAAA;AACvD,OAAO,iBAAiB,EAAE,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,mBAAmB,EAAE,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,iBAAiB,EAAE,EAAsB,SAAS,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,YAAY,MAAM,UAAU,CAAA;AACnC,OAAO,iBAAiB,MAAM,eAAe,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,YAAY,EAA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,EAAE,qBAAqB;SACxC,CAAC,CAAC,CAAA;QAEH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACrB,uDAAuD;YACvD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;YAC7D,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;YAC7D,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,cAAc,GAAG,SAAS,CAAA,CAAC,aAAa;YACjG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;YAEnE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAEhC,8BAA8B;YAC9B,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;YAE7D,2BAA2B;YAC3B,OAAO,CAAC,MAAM,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,MAAM,CAAA;AACf,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silexlabs/silex",
3
3
  "description": "Free and easy website builder for everyone.",
4
- "version": "3.0.0-alpha.60",
4
+ "version": "3.0.0-alpha.62",
5
5
  "version:backwardcompat": "3.0.0",
6
6
  "author": {
7
7
  "name": "Alex Hoyau",
@@ -101,6 +101,7 @@
101
101
  },
102
102
  "dependencies": {
103
103
  "@directus/sdk": "10.3.3",
104
+ "@fontsource/ubuntu": "^5.0.5",
104
105
  "@fortawesome/fontawesome-free": "6.4.0",
105
106
  "@gitbeaker/rest": "^39.7.0",
106
107
  "@silexlabs/grapesjs-directus-storage": "1.0.15",
@@ -1,22 +1,18 @@
1
- // $silexlightergrey: #ddd;
2
- // $silexlightgrey: #535353;
3
- // $silexmediumgrey: #444;
4
- // $silexmediumdarkgrey: #393939;
5
- // $silexdarkgrey: #2f2f2f;
6
- // $silexdarkergrey: #2a2a2a;
7
- // $silexlightblue: #7bc0ff;
1
+ // All colors
2
+ // /!\ Duplicated in the grapesjs/index.ts too => keep in sync
3
+ $primaryColor: #333333 !default;
4
+ $secondaryColor: #ddd !default;
5
+ $tertiaryColor: #8873FE !default;
6
+ $quaternaryColor: #56E3FF !default;
7
+ $darkerPrimaryColor: #363636 !default;
8
+ $lighterPrimaryColor: #575757 !default;
8
9
 
9
- $primaryColor: #444;
10
- $secondaryColor: #ddd;
11
- $tertiaryColor: #5e85a8;
12
- $quaternaryColor: #7bc0ff;
13
- $darkerPrimaryColor: #363636;
14
- $lighterPrimaryColor: #575757;
15
10
  $topBarHeight: 40px;
16
11
  $projectBarWidth: 35px;
17
12
  $projectPanelWidth: 13%;
18
13
  $projectPanelMinWidth: 150px;
19
14
  $viewsPanelWidth: 15%; // 15% is grapesjs default
15
+ $footerHeight: 30px;
20
16
  $transitionSpeedMedium: .35s;
21
17
  $transitionSpeedSlow: .5s;
22
18
  $prefix: 'gjs-';
@@ -25,11 +21,4 @@ $cv-prefix: '#{$prefix}cv-';
25
21
  $z-dialog-inline: 10;
26
22
  $z-loader: 10;
27
23
 
28
- :root {
29
- --primaryColor: #444;
30
- --secondaryColor: #ddd;
31
- --tertiaryColor: #5e85a8;
32
- --quaternaryColor: #7bc0ff;
33
- --darkerPrimaryColor: #363636;
34
- --lighterPrimaryColor: #575757;
35
- }
24
+ $fontFamily: 'Ubuntu', sans-serif;
@@ -4,8 +4,9 @@
4
4
  bottom: 0;
5
5
  left: $projectBarWidth;
6
6
  right: $viewsPanelWidth;
7
- border-top: 1px solid #dee2e6;
8
7
  display: flex;
9
8
  justify-content: space-between;
10
9
  align-items: center;
10
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
11
+ height: $footerHeight;
11
12
  }
@@ -22,6 +22,7 @@
22
22
  }
23
23
  }
24
24
  }
25
+
25
26
  .#{$cv-prefix}canvas,
26
27
  .#{$pn-prefix}panel,
27
28
  .#{$pn-prefix}commands {
@@ -46,6 +47,25 @@
46
47
  width: $viewsPanelWidth;
47
48
  }
48
49
 
50
+ .gjs-editor {
51
+ font-family: $fontFamily;
52
+ font-size: 0.75rem;
53
+ }
54
+
55
+ // Inside the canvas
56
+ .gjs-toolbar {
57
+ background-color: $tertiaryColor;
58
+ }
59
+ .gjs-resizer-h {
60
+ border-color: $tertiaryColor;
61
+ }
62
+ .gjs-com-badge, .gjs-com-badge-red, .gjs-badge {
63
+ background-color: $tertiaryColor;
64
+ }
65
+ .gjs-cv-canvas .gjs-highlighter, .gjs-cv-canvas .gjs-highlighter-sel {
66
+ outline: 1px solid $tertiaryColor;
67
+ }
68
+
49
69
  /*
50
70
  */
51
71
  // Font awesome 5 fix
@@ -1,5 +1,8 @@
1
1
  /* Normalize css */
2
2
  @use "normalize.css/normalize";
3
+
4
+ @use "_variables";
5
+ //@use "light";
3
6
  @use "grapesjs/src/styles/scss/main";
4
7
 
5
8
  /* Silex styles imports */
@@ -7,10 +10,24 @@
7
10
  @use "loader";
8
11
  @use "footer";
9
12
  @use "dialog";
10
- @use "grapesjs";
11
13
  @use "project-bar";
12
14
  @use "page-panel";
13
15
  @use "website-info";
16
+ @use "grapesjs";
17
+
18
+ //@use "grapesjs-light";
19
+
20
+ // Ubuntu Fonts
21
+ @use "@fontsource/ubuntu";
22
+
23
+ :root {
24
+ --primaryColor: $primaryColor;
25
+ --secondaryColor: $secondaryColor;
26
+ --tertiaryColor: $tertiaryColor;
27
+ --quaternaryColor: $quaternaryColor;
28
+ --darkerPrimaryColor: $darkerPrimaryColor;
29
+ --lighterPrimaryColor: $lighterPrimaryColor;
30
+ }
14
31
 
15
32
  .container-png::before {
16
33
  content: " ";
@@ -43,7 +43,7 @@ iframe.enable-squeeze.silex-squeeze-left {
43
43
  top: $topBarHeight;
44
44
  width: $projectPanelWidth;
45
45
  min-width: $projectPanelMinWidth;
46
- height: calc(100% - $topBarHeight);
46
+ height: calc(100% - $topBarHeight - $footerHeight);
47
47
  background-color: $lighterPrimaryColor;
48
48
  &:not(.gjs-hidden) {
49
49
  display: flex; // let the child take the whole height
@@ -3,6 +3,9 @@
3
3
 
4
4
  .silex-workspace {
5
5
  @include mixins.silex-ui-full;
6
+ body {
7
+ font-family: $fontFamily;
8
+ }
6
9
  display: flex;
7
10
  a {
8
11
  color: inherit;
@@ -12,7 +12,7 @@ html(lang="en", translate="no")
12
12
  style.
13
13
  body {
14
14
  background-color: #444444;
15
- font-family: Helvetica,sans-serif;
15
+ font-family: "Ubuntu", "Helvetica Neue", Helvetica, Arial, sans-serif;
16
16
  }
17
17
  .silex-loader {
18
18
  display: none;
@@ -14,21 +14,21 @@ export default function (editor, options) {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  height: 100%;
17
- padding: 0 10px;
17
+ padding: 5px 10px 0;
18
18
  font-size: 12px;
19
19
  color: #999;
20
+ overflow-x: auto;
21
+ overflow-y: hidden;
20
22
  }
21
23
  #breadcrumbs-container h3 {
22
24
  margin: 0;
23
25
  }
24
26
  #breadcrumbs-container .breadcrumb {
25
27
  margin: 5px;
26
- font-size: large;
28
+ font-size: 15px;
27
29
  line-height: 1;
28
30
  cursor: pointer;
29
- }
30
- #breadcrumbs-container .breadcrumb span {
31
- text-decoration: underline;
31
+ white-space: nowrap;
32
32
  }
33
33
  #breadcrumbs-container .breadcrumb::after {
34
34
  content: "➔";
@@ -44,7 +44,7 @@ export default function (editor, options) {
44
44
  })
45
45
  // Append the breadcrumbs container to the editor's container
46
46
 
47
- editor.on('component:selected style', () => renderBreadcrumbs())
47
+ editor.on('component:selected style:target component:drag:end', () => renderBreadcrumbs())
48
48
  function renderBreadcrumbs() {
49
49
  let component = editor.getSelected() ?? editor.Pages.getSelected().getMainComponent()
50
50
 
@@ -73,7 +73,7 @@ export default function (editor, options) {
73
73
  editor.select(component)
74
74
  }
75
75
  breadcrumb.classList.add('breadcrumb')
76
- breadcrumb.innerHTML = `<span>${component.get('tagName')}${component.getClasses().length ? `.${component.getClasses().join('.')}` : ''}</span>`
76
+ breadcrumb.innerHTML = `<span>${component.getName() ?? component.get('tagName')}</span>`
77
77
  return breadcrumb
78
78
  }
79
79
  }
@@ -127,6 +127,29 @@ export function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl
127
127
  },
128
128
 
129
129
  cssIcons: '/css/all.min.css',
130
+ canvasCss: `
131
+ :root {
132
+ --primaryColor: #333333;
133
+ --secondaryColor: #ddd;
134
+ --tertiaryColor: #8873FE;
135
+ --quaternaryColor: #56E3FF;
136
+ --darkerPrimaryColor: #363636;
137
+ --lighterPrimaryColor: #575757;
138
+ }
139
+ .gjs-frame-selected {
140
+ box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5) !important; // Change to red border
141
+ }
142
+ .gjs-selected {
143
+ outline: 2px solid var(--tertiaryColor) !important;
144
+ outline-offset: -2px;
145
+ }
146
+ .gjs-tools .gjs-badge { /* for the label */
147
+ background-color: red;
148
+ }
149
+ .gjs-toolbar { /* for the toolbar */
150
+ background-color: red;
151
+ }
152
+ `,
130
153
 
131
154
  plugins: plugins.map(p => p.value),
132
155
 
@@ -141,7 +164,7 @@ export function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl
141
164
  {
142
165
  id: 'dash',
143
166
  className: 'logo',
144
- attributes: { title: 'Go to your dashboard' },
167
+ attributes: { title: 'Dashboard' },
145
168
  link: '/',
146
169
  command: 'open-dash',
147
170
  }, {
@@ -191,6 +214,18 @@ export function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl
191
214
  id: 'spacer',
192
215
  attributes: {},
193
216
  className: 'project-bar-spacer',
217
+ }, {
218
+ id: 'dash2',
219
+ className: 'fa-solid fa-house',
220
+ attributes: { title: 'Dashboard' },
221
+ link: '/',
222
+ command: 'open-dash',
223
+ }, {
224
+ id: 'help',
225
+ className: 'fa fa-fw fa-question-circle',
226
+ attributes: { title: 'Documentation' },
227
+ link: 'https://docs.silex.me/',
228
+ command: 'open-help',
194
229
  }, {
195
230
  id: 'logout-button',
196
231
  className: 'page-panel-btn fa fa-fw fa-sign-out',