@leavittsoftware/web 6.12.1 → 6.14.0

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.
@@ -0,0 +1,14 @@
1
+ import { LitElement } from 'lit';
2
+ import '@material/web/progress/circular-progress';
3
+ declare const LeavittServiceWorkerNotifier_base: import("../theme/theme-preference").Constructor<import("../theme/theme-preference").ThemePreferenceInterface> & typeof LitElement;
4
+ export declare class LeavittServiceWorkerNotifier extends LeavittServiceWorkerNotifier_base {
5
+ #private;
6
+ private accessor main;
7
+ private accessor isLoading;
8
+ connectedCallback(): Promise<void>;
9
+ static styles: import("lit").CSSResult[];
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ handleClick(): Promise<void>;
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=service-worker-notifier.d.ts.map
@@ -0,0 +1,180 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, query, state } from 'lit/decorators.js';
4
+ import { ThemePreference } from '../theme/theme-preference';
5
+ import '@material/web/progress/circular-progress';
6
+ let LeavittServiceWorkerNotifier = class LeavittServiceWorkerNotifier extends ThemePreference(LitElement) {
7
+ #main_accessor_storage;
8
+ get main() { return this.#main_accessor_storage; }
9
+ set main(value) { this.#main_accessor_storage = value; }
10
+ #isLoading_accessor_storage = false;
11
+ get isLoading() { return this.#isLoading_accessor_storage; }
12
+ set isLoading(value) { this.#isLoading_accessor_storage = value; }
13
+ #newWorker;
14
+ #refreshing = false;
15
+ async connectedCallback() {
16
+ super.connectedCallback();
17
+ if ('serviceWorker' in navigator) {
18
+ const originalSW = navigator.serviceWorker.controller;
19
+ const reg = await navigator.serviceWorker.getRegistration();
20
+ if (reg) {
21
+ reg.addEventListener('updatefound', () => {
22
+ this.#newWorker = reg.installing;
23
+ this.#newWorker?.addEventListener('statechange', () => {
24
+ if (this.#newWorker?.state === 'installed' && navigator.serviceWorker.controller) {
25
+ this.#newWorker?.postMessage({ type: 'SKIP_WAITING' });
26
+ }
27
+ });
28
+ });
29
+ if (reg.waiting && navigator.serviceWorker.controller) {
30
+ this.#newWorker = reg.waiting;
31
+ this.#newWorker?.postMessage({ type: 'SKIP_WAITING' });
32
+ }
33
+ }
34
+ navigator.serviceWorker.addEventListener('controllerchange', () => {
35
+ if (this.#refreshing) {
36
+ return;
37
+ }
38
+ if (originalSW) {
39
+ this.main.showPopover();
40
+ this.#refreshing = true;
41
+ }
42
+ else {
43
+ //This is due to a SW taking control for the first time
44
+ }
45
+ });
46
+ }
47
+ }
48
+ static { this.styles = [
49
+ css `
50
+ :host {
51
+ display: block;
52
+ container-type: inline-size;
53
+ }
54
+
55
+ main {
56
+ display: none;
57
+ position: fixed;
58
+ background-color: var(--app-background-color);
59
+ color: var(--md-sys-color-on-background);
60
+
61
+ cursor: pointer;
62
+
63
+ user-select: none;
64
+ -webkit-user-select: none;
65
+ -moz-user-select: none;
66
+ -ms-user-select: none;
67
+
68
+ grid: 'image text' / auto 1fr;
69
+ align-items: center;
70
+ gap: 16px 12px;
71
+
72
+ border: 0;
73
+ padding: 8px;
74
+
75
+ @container (max-width: 500px) {
76
+ grid:
77
+ 'image' auto
78
+ 'text' 1fr / auto;
79
+
80
+ justify-items: center;
81
+ text-align: center;
82
+ }
83
+ }
84
+
85
+ main::backdrop {
86
+ background-color: var(--app-background-color);
87
+ }
88
+
89
+ main:popover-open {
90
+ display: grid;
91
+ }
92
+
93
+ md-circular-progress,
94
+ img {
95
+ grid-area: image;
96
+ width: 48px;
97
+ height: 48px;
98
+ }
99
+
100
+ h1 {
101
+ font-family: var(--titanium-styles-h1-font-family, Metropolis, Roboto, Noto, sans-serif);
102
+ -webkit-font-smoothing: antialiased;
103
+ font-size: 32px;
104
+ line-height: 34px;
105
+ font-weight: 700;
106
+ letter-spacing: -1px;
107
+
108
+ margin: 0;
109
+ padding: 0;
110
+
111
+ @container (max-width: 500px) {
112
+ font-size: 24px;
113
+ line-height: 26px;
114
+
115
+ margin-bottom: 6px;
116
+ }
117
+ }
118
+
119
+ h3 {
120
+ font-family: var(--titanium-styles-h2-font-family, Metropolis, Roboto, Noto, sans-serif);
121
+ -webkit-font-smoothing: antialiased;
122
+ font-size: 16px;
123
+ line-height: 18px;
124
+ font-weight: 300;
125
+ letter-spacing: 0.6px;
126
+
127
+ margin: 0;
128
+ padding: 0;
129
+ margin-left: 6px;
130
+ }
131
+
132
+ click-blocker {
133
+ display: none;
134
+ position: fixed;
135
+ width: 100vw;
136
+ height: 100vh;
137
+ z-index: 9999;
138
+ left: 0;
139
+ right: 0;
140
+ background: transparent;
141
+ cursor: pointer;
142
+ pointer-events: all;
143
+ }
144
+
145
+ main:popover-open + click-blocker {
146
+ display: block;
147
+ }
148
+ `,
149
+ ]; }
150
+ render() {
151
+ return html `<main popover="manual" @click=${this.handleClick}>
152
+ ${this.isLoading
153
+ ? html `<md-circular-progress indeterminate></md-circular-progress>`
154
+ : html `<img
155
+ src=${this.themePreference === 'dark' ? 'https://cdn.leavitt.com/company-mark-57-dark.svg' : 'https://cdn.leavitt.com/company-mark-57.svg'}
156
+ />`}
157
+ <div>
158
+ <h1>This site has been updated!</h1>
159
+ <h3>Please click to reload</h3>
160
+ </div>
161
+ </main>
162
+ <click-blocker @click=${this.handleClick}></click-blocker>`;
163
+ }
164
+ async handleClick() {
165
+ this.isLoading = true;
166
+ await this.updateComplete;
167
+ window.location.reload();
168
+ }
169
+ };
170
+ __decorate([
171
+ query('main')
172
+ ], LeavittServiceWorkerNotifier.prototype, "main", null);
173
+ __decorate([
174
+ state()
175
+ ], LeavittServiceWorkerNotifier.prototype, "isLoading", null);
176
+ LeavittServiceWorkerNotifier = __decorate([
177
+ customElement('leavitt-service-worker-notifier')
178
+ ], LeavittServiceWorkerNotifier);
179
+ export { LeavittServiceWorkerNotifier };
180
+ //# sourceMappingURL=service-worker-notifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-worker-notifier.js","sourceRoot":"","sources":["service-worker-notifier.ts"],"names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,CAAC;;AArK+B;IAA/B,KAAK,CAAC,MAAM,CAAC;wDAAoC;AAExB;IAAzB,KAAK,EAAE;6DAA6C;AAH1C,4BAA4B;IADxC,aAAa,CAAC,iCAAiC,CAAC;GACpC,4BAA4B,CAuKxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavittsoftware/web",
3
- "version": "6.12.1",
3
+ "version": "6.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "files": [
@@ -44,5 +44,5 @@
44
44
  "url": "https://github.com/LeavittSoftware/titanium-elements/issues"
45
45
  },
46
46
  "homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
47
- "gitHead": "c188df05f8938a6ad6160e51f2bc2cf80e2eb078"
47
+ "gitHead": "ee3aa42fb22d8492823831ad97a3b4d51a708a88"
48
48
  }
@@ -0,0 +1,12 @@
1
+ import '@material/web/ripple/ripple';
2
+ import '@material/web/focus/md-focus-ring';
3
+ import '@material/web/elevation/elevation';
4
+ import '@material/web/icon/icon';
5
+ import { LitElement } from 'lit';
6
+ export declare class TitaniumCollapsibleContainer extends LitElement {
7
+ accessor disabled: boolean;
8
+ accessor opened: boolean;
9
+ static styles: import("lit").CSSResult;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ }
12
+ //# sourceMappingURL=collapsible-container.d.ts.map
@@ -0,0 +1,115 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/web/ripple/ripple';
3
+ import '@material/web/focus/md-focus-ring';
4
+ import '@material/web/elevation/elevation';
5
+ import '@material/web/icon/icon';
6
+ import { css, html, LitElement } from 'lit';
7
+ import { property, customElement } from 'lit/decorators.js';
8
+ let TitaniumCollapsibleContainer = class TitaniumCollapsibleContainer extends LitElement {
9
+ #disabled_accessor_storage = false;
10
+ get disabled() { return this.#disabled_accessor_storage; }
11
+ set disabled(value) { this.#disabled_accessor_storage = value; }
12
+ #opened_accessor_storage = false;
13
+ get opened() { return this.#opened_accessor_storage; }
14
+ set opened(value) { this.#opened_accessor_storage = value; }
15
+ static { this.styles = css `
16
+ :host {
17
+ display: grid;
18
+ --titanium-collapsible-container-border-radius: 12px;
19
+ border-radius: var(--titanium-collapsible-container-border-radius);
20
+ }
21
+
22
+ button {
23
+ display: grid;
24
+ position: relative;
25
+
26
+ grid-auto-columns: 1fr auto;
27
+ grid-auto-flow: column;
28
+ padding: 12px;
29
+ margin: 0;
30
+ outline: none;
31
+
32
+ text-align: left;
33
+
34
+ cursor: pointer;
35
+ color: inherit;
36
+ background-color: inherit;
37
+
38
+ border: none;
39
+ align-items: center;
40
+ box-sizing: border-box;
41
+
42
+ border-radius: var(--titanium-collapsible-container-border-radius);
43
+ --md-focus-ring-shape: var(--titanium-collapsible-container-border-radius);
44
+
45
+ width: 100%;
46
+
47
+ md-icon {
48
+ transition: transform 0.35s;
49
+ }
50
+ }
51
+
52
+ main {
53
+ display: grid;
54
+
55
+ color: inherit;
56
+ background-color: inherit;
57
+
58
+ interpolate-size: allow-keywords;
59
+
60
+ height: 0;
61
+ overflow: hidden;
62
+ transition: all 0.35s;
63
+
64
+ border-radius: 0 0 var(--titanium-collapsible-container-border-radius) var(--titanium-collapsible-container-border-radius);
65
+ box-sizing: border-box;
66
+
67
+ @starting-style {
68
+ height: 0px;
69
+ }
70
+ }
71
+
72
+ :host([opened]) {
73
+ main {
74
+ height: auto;
75
+ }
76
+
77
+ md-icon {
78
+ transform: rotate(-180deg);
79
+ }
80
+
81
+ button {
82
+ border-bottom-right-radius: 0;
83
+ border-bottom-left-radius: 0;
84
+ --md-focus-ring-shape-end-start: 0;
85
+ --md-focus-ring-shape-end-end: 0;
86
+ }
87
+ }
88
+ `; }
89
+ render() {
90
+ return html `
91
+ <button part="button" draggable="false" @click=${() => (this.opened = !this.opened)}>
92
+ <header><slot name="header"></slot></header>
93
+ <md-icon arrow>expand_more</md-icon>
94
+
95
+ <md-ripple ?disabled=${this.disabled}></md-ripple>
96
+ <md-focus-ring inward ?inward=${!this.opened}></md-focus-ring>
97
+ </button>
98
+ <main part="main">
99
+ <slot name="content"></slot>
100
+ </main>
101
+ <md-elevation></md-elevation>
102
+ `;
103
+ }
104
+ };
105
+ __decorate([
106
+ property({ type: Boolean, reflect: true })
107
+ ], TitaniumCollapsibleContainer.prototype, "disabled", null);
108
+ __decorate([
109
+ property({ type: Boolean, reflect: true })
110
+ ], TitaniumCollapsibleContainer.prototype, "opened", null);
111
+ TitaniumCollapsibleContainer = __decorate([
112
+ customElement('titanium-collapsible-container')
113
+ ], TitaniumCollapsibleContainer);
114
+ export { TitaniumCollapsibleContainer };
115
+ //# sourceMappingURL=collapsible-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible-container.js","sourceRoot":"","sources":["collapsible-container.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,UAAU;IACL,6BAAoB,KAAK,CAAC;IAA1B,IAAA,QAAQ,8CAAkB;IAA1B,IAAA,QAAQ,oDAAkB;IAC1B,2BAAkB,KAAK,CAAC;IAAxB,IAAA,MAAM,4CAAkB;IAAxB,IAAA,MAAM,kDAAkB;aAEtE,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyElB,AAzEY,CAyEX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;uDACwC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;;;;+BAI1D,IAAI,CAAC,QAAQ;wCACJ,CAAC,IAAI,CAAC,MAAM;;;;;;KAM/C,CAAC;IACJ,CAAC;;AA5FoD;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4DAAoC;AAC1B;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAAkC;AAFlE,4BAA4B;IADxC,aAAa,CAAC,gCAAgC,CAAC;GACnC,4BAA4B,CA8FxC"}