@design.estate/dees-catalog 3.52.3 → 3.52.5

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": "@design.estate/dees-catalog",
3
- "version": "3.52.3",
3
+ "version": "3.52.5",
4
4
  "private": false,
5
5
  "description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
6
6
  "main": "dist_ts_web/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '3.52.3',
6
+ version: '3.52.5',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  }
@@ -70,7 +70,7 @@ export class DeesAppuiMaincontent extends DeesElement {
70
70
  grid-template-rows: auto 1fr;
71
71
  width: 100%;
72
72
  height: 100%;
73
- background: ${cssManager.bdTheme('#ffffff', '#161616')};
73
+ background: ${cssManager.bdTheme('#fafafa', '#0a0a0a')};
74
74
  }
75
75
 
76
76
  .maincontainer {
@@ -3,6 +3,7 @@ import { PdfManager } from '../dees-pdf-shared/PdfManager.js';
3
3
  import { viewerStyles } from './styles.js';
4
4
  import { demo as demoFunc } from './demo.js';
5
5
  import '../../00group-utility/dees-icon/dees-icon.js';
6
+ import '../../00group-layout/dees-tile/dees-tile.js';
6
7
 
7
8
  declare global {
8
9
  interface HTMLElementTagNameMap {
@@ -54,6 +55,9 @@ export class DeesPdfViewer extends DeesElement {
54
55
  @property({ type: Array })
55
56
  accessor pageData: Array<{page: number, rendered: boolean, rendering: boolean, textLayerRendered: boolean}> = [];
56
57
 
58
+ @property({ type: Number })
59
+ accessor pdfFileSize: number = 0;
60
+
57
61
  private pdfDocument: any;
58
62
  private renderState: RenderState = 'idle';
59
63
  private renderAbortController: AbortController | null = null;
@@ -85,9 +89,9 @@ export class DeesPdfViewer extends DeesElement {
85
89
 
86
90
  public render(): TemplateResult {
87
91
  return html`
88
- <div class="pdf-viewer ${this.showSidebar ? 'with-sidebar' : ''}">
92
+ <dees-tile class="${this.showSidebar ? 'with-sidebar' : ''}">
89
93
  ${this.showToolbar ? html`
90
- <div class="toolbar">
94
+ <div slot="header" class="toolbar">
91
95
  <div class="toolbar-group">
92
96
  <button
93
97
  class="toolbar-button"
@@ -240,7 +244,23 @@ export class DeesPdfViewer extends DeesElement {
240
244
  `}
241
245
  </div>
242
246
  </div>
243
- </div>
247
+ <div slot="footer" class="pdf-footer">
248
+ <div class="pdf-footer-left">
249
+ <span class="pdf-footer-item">Zoom ${Math.round(this.currentZoom * 100)}%</span>
250
+ ${this.pdfFileSize > 0 ? html`
251
+ <span class="pdf-footer-item">${this.formatFileSize(this.pdfFileSize)}</span>
252
+ ` : ''}
253
+ </div>
254
+ <div class="pdf-footer-center" style="margin-left: ${this.showSidebar ? '100px' : '0'}">
255
+ <span>Page ${this.currentPage} of ${this.totalPages}</span>
256
+ </div>
257
+ <div class="pdf-footer-right">
258
+ ${this.pdfUrl ? html`
259
+ <span class="pdf-footer-filename">${this.pdfUrl.split('/').pop()}</span>
260
+ ` : ''}
261
+ </div>
262
+ </div>
263
+ </dees-tile>
244
264
  `;
245
265
  }
246
266
 
@@ -305,6 +325,12 @@ export class DeesPdfViewer extends DeesElement {
305
325
  }
306
326
  }
307
327
 
328
+ private formatFileSize(bytes: number): string {
329
+ if (bytes < 1024) return `${bytes} B`;
330
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
331
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
332
+ }
333
+
308
334
  private async loadPdf() {
309
335
  this.loading = true;
310
336
  this.renderState = 'loading';
@@ -323,6 +349,14 @@ export class DeesPdfViewer extends DeesElement {
323
349
  this.currentPage = this.initialPage;
324
350
  this.resolveInitialViewportMode();
325
351
 
352
+ // Get file size
353
+ try {
354
+ const data = await this.pdfDocument.getData();
355
+ this.pdfFileSize = data.length;
356
+ } catch (e) {
357
+ this.pdfFileSize = 0;
358
+ }
359
+
326
360
  // Initialize thumbnail and page data arrays
327
361
  this.thumbnailData = Array.from({length: this.totalPages}, (_, i) => ({
328
362
  page: i + 1,
@@ -699,8 +733,8 @@ export class DeesPdfViewer extends DeesElement {
699
733
  const viewerRect = this.viewerMain.getBoundingClientRect();
700
734
  const currentScrollTop = this.viewerMain.scrollTop;
701
735
 
702
- // Calculate the target scroll position
703
- const targetScrollTop = currentScrollTop + (pageRect.top - viewerRect.top) - this.viewerMain.clientTop;
736
+ // Calculate the target scroll position (offset by 16px so page doesn't touch the top edge)
737
+ const targetScrollTop = currentScrollTop + (pageRect.top - viewerRect.top) - this.viewerMain.clientTop - 16;
704
738
 
705
739
  // Scroll to the calculated position
706
740
  if (smooth) {
@@ -3,8 +3,8 @@ import { html } from '@design.estate/dees-element';
3
3
  export const demo = () => html`
4
4
  <style>
5
5
  .demo-container {
6
- padding: 40px;
7
- background: #f5f5f5;
6
+ padding: 20px;
7
+ background: #000000;
8
8
  }
9
9
 
10
10
  .demo-section {
@@ -15,6 +15,7 @@ export const demo = () => html`
15
15
  margin-bottom: 20px;
16
16
  font-size: 18px;
17
17
  font-weight: 600;
18
+ color: #fafafa;
18
19
  }
19
20
 
20
21
  dees-pdf-viewer {
@@ -12,25 +12,47 @@ export const viewerStyles = [
12
12
  contain: layout style;
13
13
  }
14
14
 
15
- .pdf-viewer {
16
- width: 100%;
15
+ dees-tile {
17
16
  height: 100%;
18
- display: flex;
19
- flex-direction: column;
20
- background: ${cssManager.bdTheme('hsl(0 0% 97%)', 'hsl(215 20% 10%)')};
21
- position: relative;
22
- overflow: hidden;
17
+ }
18
+
19
+ .viewer-container::before,
20
+ .viewer-container::after {
21
+ content: '';
22
+ position: absolute;
23
+ left: 0;
24
+ right: 0;
25
+ height: 8px;
26
+ z-index: 5;
27
+ pointer-events: none;
28
+ }
29
+
30
+ .viewer-container::before {
31
+ top: 0;
32
+ background: linear-gradient(
33
+ to bottom,
34
+ ${cssManager.bdTheme('hsl(0 0% 0% / 0.08)', 'hsl(0 0% 0% / 0.4)')},
35
+ ${cssManager.bdTheme('hsl(0 0% 0% / 0.03)', 'hsl(0 0% 0% / 0.12)')},
36
+ transparent
37
+ );
38
+ }
39
+
40
+ .viewer-container::after {
41
+ bottom: 0;
42
+ background: linear-gradient(
43
+ to top,
44
+ ${cssManager.bdTheme('hsl(0 0% 0% / 0.08)', 'hsl(0 0% 0% / 0.4)')},
45
+ ${cssManager.bdTheme('hsl(0 0% 0% / 0.03)', 'hsl(0 0% 0% / 0.12)')},
46
+ transparent
47
+ );
23
48
  }
24
49
 
25
50
  .toolbar {
26
- height: 48px;
27
- background: ${cssManager.bdTheme('hsl(0 0% 100%)', 'hsl(215 20% 15%)')};
28
- border-bottom: 1px solid ${cssManager.bdTheme('hsl(214 31% 91%)', 'hsl(217 25% 22%)')};
51
+ height: 40px;
29
52
  display: flex;
30
53
  align-items: center;
31
- padding: 0 16px;
32
- gap: 16px;
33
- flex-shrink: 0;
54
+ padding: 0 12px;
55
+ gap: 12px;
34
56
  }
35
57
 
36
58
  .toolbar-group {
@@ -108,16 +130,15 @@ export const viewerStyles = [
108
130
  }
109
131
 
110
132
  .viewer-container {
111
- flex: 1;
133
+ position: absolute;
134
+ inset: 0;
112
135
  display: flex;
113
136
  overflow: hidden;
114
- position: relative;
115
- min-height: 0;
116
137
  }
117
138
 
118
139
  .sidebar {
119
140
  width: 200px;
120
- background: ${cssManager.bdTheme('hsl(0 0% 100%)', 'hsl(215 20% 15%)')};
141
+ background: transparent;
121
142
  border-right: 1px solid ${cssManager.bdTheme('hsl(214 31% 91%)', 'hsl(217 25% 22%)')};
122
143
  display: flex;
123
144
  flex-direction: column;
@@ -334,5 +355,52 @@ export const viewerStyles = [
334
355
  .pdf-viewer.with-sidebar .viewer-main {
335
356
  margin-left: 0;
336
357
  }
358
+
359
+ .pdf-footer {
360
+ height: 28px;
361
+ padding: 0 16px;
362
+ display: flex;
363
+ align-items: center;
364
+ font-size: 11px;
365
+ color: ${cssManager.bdTheme('hsl(0 0% 45%)', 'hsl(0 0% 55%)')};
366
+ width: 100%;
367
+ box-sizing: border-box;
368
+ position: relative;
369
+ }
370
+
371
+ .pdf-footer-left {
372
+ display: flex;
373
+ align-items: center;
374
+ gap: 12px;
375
+ }
376
+
377
+ .pdf-footer-left .pdf-footer-item + .pdf-footer-item {
378
+ padding-left: 12px;
379
+ border-left: 1px solid ${cssManager.bdTheme('hsl(0 0% 89.8%)', 'hsl(0 0% 14.9%)')};
380
+ }
381
+
382
+ .pdf-footer-center {
383
+ position: absolute;
384
+ left: 50%;
385
+ transform: translateX(-50%);
386
+ font-weight: 500;
387
+ transition: margin-left 0.15s ease;
388
+ }
389
+
390
+ .pdf-footer-right {
391
+ margin-left: auto;
392
+ }
393
+
394
+ .pdf-footer-item {
395
+ white-space: nowrap;
396
+ }
397
+
398
+ .pdf-footer-filename {
399
+ font-family: 'Intel One Mono', 'Geist Mono', monospace;
400
+ opacity: 0.7;
401
+ overflow: hidden;
402
+ text-overflow: ellipsis;
403
+ white-space: nowrap;
404
+ }
337
405
  `,
338
406
  ];