@netless/app-slide 0.3.0-canary.2 → 0.3.0-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/app-slide",
3
- "version": "0.3.0-canary.2",
3
+ "version": "0.3.0-canary.3",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -429,6 +429,11 @@ export class SlideViewer {
429
429
 
430
430
  this.sideEffect.addDisposer(this.sidebar.destroy);
431
431
  this.sideEffect.addDisposer(() => this.slide.destroy());
432
+ this.sideEffect.addDisposer(() => {
433
+ this.$content.parentElement && this.$content.remove();
434
+ this.$footer.parentElement && this.$footer.remove();
435
+ this.$slide.parentElement && this.$slide.remove();
436
+ });
432
437
 
433
438
  let saved_is_frozen = false;
434
439
  this.sideEffect.addDisposer(
package/src/index.ts CHANGED
@@ -23,7 +23,6 @@ const SlideApp: NetlessApp<Attributes, MagixEvents, AppOptions, void> = {
23
23
  }
24
24
 
25
25
  const options = context.getAppOptions() || {};
26
- const debug = Boolean(options.debug);
27
26
  const logger = make_logger(context);
28
27
  logger.info("[Slide] setup @ " + __APP_VERSION__);
29
28
 
@@ -35,7 +34,6 @@ const SlideApp: NetlessApp<Attributes, MagixEvents, AppOptions, void> = {
35
34
  mode: "interactive",
36
35
  resize: true,
37
36
  enableGlobalClick: true,
38
- controller: debug,
39
37
  timestamp: make_timestamp(context),
40
38
  logger,
41
39
  renderOptions: {
@@ -92,6 +90,11 @@ export function previewSlide(options: SlideViewerOptions & { container: HTMLElem
92
90
  return viewer;
93
91
  }
94
92
 
93
+ if (import.meta.env.DEV) {
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ (window as any).previewSlide = previewSlide;
96
+ }
97
+
95
98
  function make_timestamp(context: AppContext): () => number {
96
99
  const room = context.room;
97
100
  const player = context.displayer as Player;
@@ -166,7 +169,7 @@ function connect({ context, viewer, sideEffect, logger }: ConnectParams) {
166
169
  viewer.prepare(({ width, height, slideCount }) => {
167
170
  if (context.destroyed) return;
168
171
  width && context.box.setStageRatio(height / width);
169
- whiteboard = context.createWhiteBoardView(slideCount);
172
+ whiteboard = context.createWhiteBoardView({ size: slideCount });
170
173
  kick_start();
171
174
  });
172
175
 
package/src/style.scss CHANGED
@@ -16,7 +16,7 @@ $namespace: "netless-app-slide";
16
16
  .#{$namespace}-preview-mask {
17
17
  display: none;
18
18
  position: absolute;
19
- z-index: 6000;
19
+ z-index: 10200;
20
20
  top: 0;
21
21
  left: 0;
22
22
  width: 100%;
@@ -28,7 +28,7 @@ $namespace: "netless-app-slide";
28
28
  flex-direction: column;
29
29
  align-items: center;
30
30
  position: absolute;
31
- z-index: 6100;
31
+ z-index: 10300;
32
32
  top: 0;
33
33
  left: 0;
34
34
  width: 33%;
@@ -87,7 +87,7 @@ $namespace: "netless-app-slide";
87
87
  transform: translate(-100%);
88
88
  text-align: right;
89
89
  font-size: 12px;
90
- color: #5f5f5f;
90
+ // color: #5f5f5f;
91
91
  user-select: none;
92
92
  }
93
93
 
@@ -98,7 +98,8 @@ $namespace: "netless-app-slide";
98
98
  align-items: center;
99
99
  padding: 0 16px;
100
100
  border-top: 1px solid #eeeef7;
101
- color: #191919;
101
+ font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Noto Sans",
102
+ sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
102
103
  }
103
104
 
104
105
  .#{$namespace}-float-footer {
@@ -171,11 +172,15 @@ $namespace: "netless-app-slide";
171
172
  }
172
173
 
173
174
  .#{$namespace}-page-number {
175
+ display: flex;
176
+ align-items: center;
177
+ height: 26px;
174
178
  margin-left: auto;
175
179
  font-size: 13px;
176
180
  user-select: none;
177
181
  white-space: nowrap;
178
182
  word-break: keep-all;
183
+ font-variant-numeric: tabular-nums;
179
184
  }
180
185
 
181
186
  .#{$namespace}-page-number-input {
@@ -183,7 +188,7 @@ $namespace: "netless-app-slide";
183
188
  outline: none;
184
189
  width: 3em;
185
190
  margin: 0;
186
- padding: 0 2px;
191
+ padding: 0 0.5em 0 2px;
187
192
  text-align: right;
188
193
  font-size: 13px;
189
194
  line-height: 1;
@@ -191,9 +196,12 @@ $namespace: "netless-app-slide";
191
196
  font-family: inherit;
192
197
  border-radius: 2px;
193
198
  color: currentColor;
199
+ font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Noto Sans",
200
+ sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
194
201
  background: transparent;
195
202
  transition: background 0.4s;
196
203
  user-select: text;
204
+ font-variant-numeric: tabular-nums;
197
205
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
198
206
 
199
207
  &:hover,
@@ -234,17 +242,13 @@ $namespace: "netless-app-slide";
234
242
  }
235
243
 
236
244
  .telebox-color-scheme-dark {
237
- .#{$namespace}-page-number-input {
238
- color: #a6a6a8;
239
- }
240
245
  .#{$namespace}-page-number-input:active,
241
246
  .#{$namespace}-page-number-input:focus,
242
247
  .#{$namespace}-page-number-input:hover {
243
- color: #222;
248
+ color: currentColor;
249
+ background: #25282e;
244
250
  }
245
251
  .#{$namespace}-footer {
246
- color: #a6a6a8;
247
- background: #2d2d33;
248
252
  border-top: none;
249
253
  }
250
254
  .#{$namespace}-footer-btn:hover {