@operato/font 8.0.0 → 9.0.0-beta.10
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/CHANGELOG.md +202 -22
- package/dist/src/font-creation-card.d.ts +1 -1
- package/dist/src/font-creation-card.js +38 -12
- package/dist/src/font-creation-card.js.map +1 -1
- package/dist/src/font-selector.d.ts +1 -1
- package/dist/src/font-selector.js +55 -12
- package/dist/src/font-selector.js.map +1 -1
- package/dist/src/ox-file-selector.js +38 -7
- package/dist/src/ox-file-selector.js.map +1 -1
- package/dist/src/ox-font-selector.d.ts +1 -1
- package/dist/src/ox-font-selector.js +30 -4
- package/dist/src/ox-font-selector.js.map +1 -1
- package/dist/src/ox-property-editor-font-selector.d.ts +1 -1
- package/dist/src/ox-property-editor-font-selector.js +1 -1
- package/dist/src/ox-property-editor-font-selector.js.map +1 -1
- package/dist/src/redux-font-actions.js +1 -1
- package/dist/src/redux-font-actions.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,100 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [
|
|
6
|
+
## [9.0.0-beta.10](https://github.com/hatiolab/operato/compare/v9.0.0-beta.9...v9.0.0-beta.10) (2025-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [9.0.0-beta.7](https://github.com/hatiolab/operato/compare/v9.0.0-beta.6...v9.0.0-beta.7) (2025-01-20)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @operato/font
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @operato/font
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### :bug: Bug Fix
|
|
35
|
+
|
|
36
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### :bug: Bug Fix
|
|
44
|
+
|
|
45
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @operato/font
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [8.0.0-beta.6](https://github.com/hatiolab/operato/compare/v8.0.0-beta.5...v8.0.0-beta.6) (2025-01-11)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @operato/font
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [8.0.0-beta.5](https://github.com/hatiolab/operato/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2025-01-10)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @operato/font
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [8.0.0-beta.4](https://github.com/hatiolab/operato/compare/v8.0.0-beta.3...v8.0.0-beta.4) (2025-01-09)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @operato/font
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### :bug: Bug Fix
|
|
85
|
+
|
|
86
|
+
* typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### :bug: Bug Fix
|
|
94
|
+
|
|
95
|
+
* missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
|
|
7
100
|
|
|
8
101
|
**Note:** Version bump only for package @operato/font
|
|
9
102
|
|
|
@@ -11,7 +104,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
104
|
|
|
12
105
|
|
|
13
106
|
|
|
14
|
-
|
|
107
|
+
## [8.0.0-alpha.54](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.53...v8.0.0-alpha.54) (2024-12-09)
|
|
15
108
|
|
|
16
109
|
**Note:** Version bump only for package @operato/font
|
|
17
110
|
|
|
@@ -19,17 +112,104 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
112
|
|
|
20
113
|
|
|
21
114
|
|
|
22
|
-
|
|
115
|
+
## [8.0.0-alpha.52](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.51...v8.0.0-alpha.52) (2024-12-03)
|
|
116
|
+
|
|
117
|
+
**Note:** Version bump only for package @operato/font
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## [8.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.50...v8.0.0-alpha.51) (2024-11-29)
|
|
124
|
+
|
|
125
|
+
**Note:** Version bump only for package @operato/font
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## [8.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.49...v8.0.0-alpha.50) (2024-11-16)
|
|
132
|
+
|
|
133
|
+
**Note:** Version bump only for package @operato/font
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## [8.0.0-alpha.49](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.48...v8.0.0-alpha.49) (2024-11-13)
|
|
140
|
+
|
|
141
|
+
**Note:** Version bump only for package @operato/font
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## [8.0.0-alpha.48](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.47...v8.0.0-alpha.48) (2024-11-13)
|
|
148
|
+
|
|
149
|
+
**Note:** Version bump only for package @operato/font
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## [8.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.45...v8.0.0-alpha.46) (2024-10-23)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @operato/font
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## [8.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.44...v8.0.0-alpha.45) (2024-10-23)
|
|
164
|
+
|
|
165
|
+
**Note:** Version bump only for package @operato/font
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## [8.0.0-alpha.44](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.43...v8.0.0-alpha.44) (2024-10-23)
|
|
172
|
+
|
|
173
|
+
**Note:** Version bump only for package @operato/font
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
|
|
180
|
+
|
|
181
|
+
**Note:** Version bump only for package @operato/font
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
## [8.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.36...v8.0.0-alpha.37) (2024-10-20)
|
|
23
188
|
|
|
24
189
|
|
|
25
190
|
### :bug: Bug Fix
|
|
26
191
|
|
|
27
|
-
*
|
|
28
|
-
|
|
192
|
+
* update dev-dependencies version ([d6fe342](https://github.com/hatiolab/operato/commit/d6fe342de738c6bad3528550a862b5a1d2573161))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## [8.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.33...v8.0.0-alpha.34) (2024-10-15)
|
|
197
|
+
|
|
198
|
+
**Note:** Version bump only for package @operato/font
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
## [8.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.32...v8.0.0-alpha.33) (2024-10-14)
|
|
205
|
+
|
|
206
|
+
**Note:** Version bump only for package @operato/font
|
|
207
|
+
|
|
208
|
+
|
|
29
209
|
|
|
30
210
|
|
|
31
211
|
|
|
32
|
-
|
|
212
|
+
## [8.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.29...v8.0.0-alpha.30) (2024-10-11)
|
|
33
213
|
|
|
34
214
|
**Note:** Version bump only for package @operato/font
|
|
35
215
|
|
|
@@ -37,7 +217,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
37
217
|
|
|
38
218
|
|
|
39
219
|
|
|
40
|
-
|
|
220
|
+
## [8.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.28...v8.0.0-alpha.29) (2024-10-10)
|
|
41
221
|
|
|
42
222
|
**Note:** Version bump only for package @operato/font
|
|
43
223
|
|
|
@@ -45,7 +225,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
45
225
|
|
|
46
226
|
|
|
47
227
|
|
|
48
|
-
|
|
228
|
+
## [8.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.26...v8.0.0-alpha.27) (2024-10-06)
|
|
49
229
|
|
|
50
230
|
**Note:** Version bump only for package @operato/font
|
|
51
231
|
|
|
@@ -53,7 +233,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
53
233
|
|
|
54
234
|
|
|
55
235
|
|
|
56
|
-
|
|
236
|
+
## [8.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.25...v8.0.0-alpha.26) (2024-10-06)
|
|
57
237
|
|
|
58
238
|
**Note:** Version bump only for package @operato/font
|
|
59
239
|
|
|
@@ -61,7 +241,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
61
241
|
|
|
62
242
|
|
|
63
243
|
|
|
64
|
-
|
|
244
|
+
## [8.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.20...v8.0.0-alpha.21) (2024-10-05)
|
|
65
245
|
|
|
66
246
|
**Note:** Version bump only for package @operato/font
|
|
67
247
|
|
|
@@ -69,7 +249,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
69
249
|
|
|
70
250
|
|
|
71
251
|
|
|
72
|
-
|
|
252
|
+
## [8.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.19...v8.0.0-alpha.20) (2024-10-04)
|
|
73
253
|
|
|
74
254
|
**Note:** Version bump only for package @operato/font
|
|
75
255
|
|
|
@@ -77,7 +257,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
77
257
|
|
|
78
258
|
|
|
79
259
|
|
|
80
|
-
|
|
260
|
+
## [8.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.18...v8.0.0-alpha.19) (2024-10-04)
|
|
81
261
|
|
|
82
262
|
**Note:** Version bump only for package @operato/font
|
|
83
263
|
|
|
@@ -85,7 +265,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
85
265
|
|
|
86
266
|
|
|
87
267
|
|
|
88
|
-
|
|
268
|
+
## [8.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2024-09-18)
|
|
89
269
|
|
|
90
270
|
**Note:** Version bump only for package @operato/font
|
|
91
271
|
|
|
@@ -93,7 +273,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
93
273
|
|
|
94
274
|
|
|
95
275
|
|
|
96
|
-
|
|
276
|
+
## [8.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.8...v8.0.0-alpha.9) (2024-09-15)
|
|
97
277
|
|
|
98
278
|
**Note:** Version bump only for package @operato/font
|
|
99
279
|
|
|
@@ -101,7 +281,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
101
281
|
|
|
102
282
|
|
|
103
283
|
|
|
104
|
-
|
|
284
|
+
## [8.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.7...v8.0.0-alpha.8) (2024-09-15)
|
|
105
285
|
|
|
106
286
|
**Note:** Version bump only for package @operato/font
|
|
107
287
|
|
|
@@ -109,7 +289,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
109
289
|
|
|
110
290
|
|
|
111
291
|
|
|
112
|
-
|
|
292
|
+
## [8.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.5...v8.0.0-alpha.6) (2024-09-14)
|
|
113
293
|
|
|
114
294
|
**Note:** Version bump only for package @operato/font
|
|
115
295
|
|
|
@@ -117,7 +297,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
117
297
|
|
|
118
298
|
|
|
119
299
|
|
|
120
|
-
|
|
300
|
+
## [8.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.4...v8.0.0-alpha.5) (2024-09-12)
|
|
121
301
|
|
|
122
302
|
**Note:** Version bump only for package @operato/font
|
|
123
303
|
|
|
@@ -125,7 +305,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
125
305
|
|
|
126
306
|
|
|
127
307
|
|
|
128
|
-
|
|
308
|
+
## [8.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2024-09-07)
|
|
129
309
|
|
|
130
310
|
**Note:** Version bump only for package @operato/font
|
|
131
311
|
|
|
@@ -133,7 +313,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
133
313
|
|
|
134
314
|
|
|
135
315
|
|
|
136
|
-
|
|
316
|
+
## [8.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.2...v8.0.0-alpha.3) (2024-09-06)
|
|
137
317
|
|
|
138
318
|
**Note:** Version bump only for package @operato/font
|
|
139
319
|
|
|
@@ -141,7 +321,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
141
321
|
|
|
142
322
|
|
|
143
323
|
|
|
144
|
-
|
|
324
|
+
## [8.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2024-09-05)
|
|
145
325
|
|
|
146
326
|
**Note:** Version bump only for package @operato/font
|
|
147
327
|
|
|
@@ -149,7 +329,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
149
329
|
|
|
150
330
|
|
|
151
331
|
|
|
152
|
-
|
|
332
|
+
## [8.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-04)
|
|
153
333
|
|
|
154
334
|
**Note:** Version bump only for package @operato/font
|
|
155
335
|
|
|
@@ -157,7 +337,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
157
337
|
|
|
158
338
|
|
|
159
339
|
|
|
160
|
-
|
|
340
|
+
## [8.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v7.1.1...v8.0.0-alpha.0) (2024-09-01)
|
|
161
341
|
|
|
162
342
|
**Note:** Version bump only for package @operato/font
|
|
163
343
|
|
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import './ox-file-selector';
|
|
2
|
+
import './ox-file-selector.js';
|
|
3
3
|
import { LitElement, css, html } from 'lit';
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
5
|
import { i18next, localize } from '@operato/i18n';
|
|
6
6
|
let FontCreationCard = class FontCreationCard extends localize(i18next)(LitElement) {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
this
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
Object.defineProperty(this, "provider", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: 'google'
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "googleFonts", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: []
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "files", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "providers", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: [
|
|
32
|
+
{ value: 'google', display: 'Google' },
|
|
33
|
+
// TODO 구글 외 폰트 서비스 구현
|
|
34
|
+
// { value: 'typekit', display: 'Typekit' },
|
|
35
|
+
{ value: 'custom', display: 'Custom' }
|
|
36
|
+
]
|
|
37
|
+
});
|
|
17
38
|
}
|
|
18
39
|
render() {
|
|
19
40
|
let isProviderGoogle = this.provider == 'google' && this.googleFonts.length > 0;
|
|
@@ -117,8 +138,12 @@ let FontCreationCard = class FontCreationCard extends localize(i18next)(LitEleme
|
|
|
117
138
|
this.classList.remove('flipped');
|
|
118
139
|
}
|
|
119
140
|
};
|
|
120
|
-
FontCreationCard
|
|
121
|
-
|
|
141
|
+
Object.defineProperty(FontCreationCard, "styles", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
configurable: true,
|
|
144
|
+
writable: true,
|
|
145
|
+
value: [
|
|
146
|
+
css `
|
|
122
147
|
:host {
|
|
123
148
|
position: relative;
|
|
124
149
|
|
|
@@ -244,7 +269,8 @@ FontCreationCard.styles = [
|
|
|
244
269
|
display: none !important;
|
|
245
270
|
}
|
|
246
271
|
`
|
|
247
|
-
]
|
|
272
|
+
]
|
|
273
|
+
});
|
|
248
274
|
__decorate([
|
|
249
275
|
property({ type: String })
|
|
250
276
|
], FontCreationCard.prototype, "provider", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-creation-card.js","sourceRoot":"","sources":["../../src/font-creation-card.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA5D;;QAkIuB,aAAQ,GAAW,QAAQ,CAAA;QAC5B,gBAAW,GAAkB,EAAE,CAAA;QAG1D,cAAS,GAA8C;YACrD,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;YACtC,sBAAsB;YACtB,4CAA4C;YAC5C,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;SACvC,CAAA;IAoHH,CAAC;IAlHC,MAAM;QACJ,IAAI,gBAAgB,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/E,IAAI,cAAc,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;QAEvE,OAAO,IAAI,CAAA;oBACK,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;oBAEjC,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;wBAC7B,CAAC,CAAQ,EAAE,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6HF;CACF,AA/HY,CA+HZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA4B;AAC5B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAgC;AAC/B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAmB;AApIlC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+P5B","sourcesContent":["import './ox-file-selector'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('font-creation-card')\nexport class FontCreationCard extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n position: relative;\n\n padding: 0;\n margin: 0;\n height: 100%;\n\n -webkit-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 0.5s ease-in-out;\n transition: all 0.5s ease-in-out;\n }\n\n :host(.flipped) {\n -webkit-transform: var(--card-list-flip-transform);\n transform: var(--card-list-flip-transform);\n }\n\n [front],\n [back] {\n position: absolute;\n\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n border: var(--card-list-create-border);\n\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface);\n\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n }\n\n [front] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n text-align: center;\n font-size: 0.8em;\n text-transform: capitalize;\n }\n\n [front] md-icon {\n --md-icon-size: 42px;\n font-size: 3.5em;\n color: var(--md-sys-color-primary);\n }\n\n [back] {\n -webkit-transform: var(--card-list-flip-transform);\n transform: var(--card-list-flip-transform);\n box-sizing: border-box;\n display: grid;\n }\n\n [back] form {\n padding: var(--card-list-create-form-padding);\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto 1fr auto;\n justify-content: center;\n align-items: center;\n }\n\n [back] form .props {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-row-gap: 7px;\n justify-content: center;\n align-items: center;\n }\n\n [back] form .props label {\n grid-column: span 4;\n font: var(--card-list-create-label-font);\n color: var(--card-list-create-label-color, var(--md-sys-color-secondary));\n }\n\n input,\n select,\n ox-file-selector {\n background-color: var(--card-list-create-input-background-color, var(--md-sys-color-surface-variant));\n color: var(--card-list-create-input-color, var(--md-sys-color-on-surface));\n }\n\n [back] form .props input,\n [back] form .props select {\n grid-column: span 6;\n border: var(--card-list-create-input-border);\n border-radius: var(--card-list-create-input-border-radius);\n font: var(--card-list-create-input-font);\n width: -moz-available;\n }\n\n ox-file-selector {\n grid-column: span 6;\n font: var(--card-list-create-input-font);\n border: none;\n box-sizing: border-box;\n padding: 0;\n }\n\n [back] input[type='submit'] {\n font: var(--button-font);\n border-radius: var(--button-radius);\n border: var(--button-border);\n grid-column: span 10;\n grid-row: auto / -1;\n }\n\n .hidden {\n display: none !important;\n }\n `\n ]\n\n @property({ type: String }) provider: string = 'google'\n @property({ type: Array }) googleFonts: Array<string> = []\n @property({ type: Array }) files?: Array<any>\n\n providers: Array<{ value: string; display: string }> = [\n { value: 'google', display: 'Google' },\n // TODO 구글 외 폰트 서비스 구현\n // { value: 'typekit', display: 'Typekit' },\n { value: 'custom', display: 'Custom' }\n ]\n\n render() {\n let isProviderGoogle = this.provider == 'google' && this.googleFonts.length > 0\n let isFileAttached = this.files && this.files.length > 0 ? true : false\n\n return html`\n <div @click=${(e: Event) => this.onClickFlip(e)} front><md-icon>add_circle_outline</md-icon>create font</div>\n\n <div @click=${(e: Event) => this.onClickFlip(e)} back>\n <form @submit=${(e: Event) => this.onClickSubmit(e)}>\n <div class=\"props\">\n <label>${i18next.t('label.provider')}</label>\n <select\n name=\"provider\"\n @change=${(e: Event) => {\n this.provider = (e.target as HTMLInputElement).value\n if (this.provider === 'google') {\n fetch(`/all-google-fonts`).then(async response => {\n if (response.ok) this.googleFonts = await response.json()\n else {\n console.warn(\n `(${response.url}) ${response.status} ${response.statusText}. Could not load Google fonts.`\n )\n }\n })\n }\n }}\n >\n ${this.providers.map(\n p => html` <option value=${p.value} ?selected=${this.provider == p.value}>${p.display}</option> `\n )}\n </select>\n\n <label>${i18next.t('label.name')}</label>\n <input type=\"text\" name=\"${isProviderGoogle ? '' : 'name'}\" ?hidden=${isProviderGoogle} />\n <select name=\"${isProviderGoogle ? 'name' : ''}\" ?hidden=${!isProviderGoogle}>\n <option value=\"\"> </option>\n ${isProviderGoogle && this.googleFonts.map(f => html` <option value=${f}>${f}</option> `)}\n </select>\n\n <label ?hidden=${this.provider != 'custom'}>${i18next.t('label.uri')}</label>\n <input\n ?hidden=${this.provider != 'custom'}\n ?disabled=${isFileAttached}\n .value=${isFileAttached ? this.files![0].name : ''}\n type=\"text\"\n name=\"uri\"\n />\n <!-- display when attachment module is imported -->\n <label ?hidden=${this.provider != 'custom'}>${i18next.t('label.file')}</label>\n <ox-file-selector\n class=\"${this.provider != 'custom' ? 'hidden' : ''}\"\n name=\"file\"\n label=\"${i18next.t('label.select file')}\"\n accept=\".ttf,.otf,.woff,.woff2,.eot,.svg,.svgz\"\n multiple\n @file-change=${(e: CustomEvent) => {\n this.files = Array.from(e.detail.files)\n }}\n ></ox-file-selector>\n <!------------------------------------------------>\n\n <label for=\"checkbox-active\" @click=${(e: Event) => e.stopPropagation()}>\n ${i18next.t('label.active')}\n </label>\n <input id=\"checkbox-active\" type=\"checkbox\" name=\"active\" checked />\n </div>\n <div></div>\n <input type=\"submit\" value=${i18next.t('button.create')} />\n </form>\n </div>\n `\n }\n\n onClickFlip(e: Event) {\n const target = e.target as HTMLElement\n const currentTarget = e.currentTarget as HTMLElement\n\n if (!['INPUT', 'SELECT', 'OPTION'].find(tagName => tagName === target.tagName)) {\n if (currentTarget.hasAttribute('front')) this.reset() // 입력 폼으로 뒤집기 전에 한 번 리셋\n this.classList.toggle('flipped')\n }\n }\n\n async onClickSubmit(e: Event) {\n e.preventDefault()\n e.stopPropagation()\n\n var form = e.target as HTMLFormElement\n\n var detail = {} as any\n\n detail.name = (form.elements.namedItem('name') as HTMLInputElement).value\n detail.provider = (form.elements.namedItem('provider') as HTMLInputElement).value\n detail.active = (form.elements.namedItem('active') as HTMLInputElement).checked\n\n if (this.provider === 'custom') {\n detail.uri = (form.elements.namedItem('uri') as HTMLInputElement).value\n if (this.files && this.files.length > 0) {\n detail.files = this.files\n }\n }\n\n this.dispatchEvent(new CustomEvent('create-font', { detail }))\n }\n\n reset() {\n var form = this.renderRoot.querySelector('form')\n if (form) {\n form.reset()\n }\n\n this.files = []\n this.classList.remove('flipped')\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"font-creation-card.js","sourceRoot":"","sources":["../../src/font-creation-card.ts"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA5D;;QAkIuB;;;;mBAAmB,QAAQ;WAAA;QAC5B;;;;mBAA6B,EAAE;WAAA;QAC/B;;;;;WAAkB;QAE7C;;;;mBAAuD;gBACrD,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;gBACtC,sBAAsB;gBACtB,4CAA4C;gBAC5C,EAAE,KA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AC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;YAC3B,CAAC;QACH,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,KAAK;QACH,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,EAAE,CAAA;QACd,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAClC,CAAC;;AA7PM;;;;WAAS;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6HF;KACF;EA/HY,CA+HZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA4B;AAC5B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAgC;AAC/B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAmB;AApIlC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+P5B","sourcesContent":["import './ox-file-selector.js'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('font-creation-card')\nexport class FontCreationCard extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n position: relative;\n\n padding: 0;\n margin: 0;\n height: 100%;\n\n -webkit-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 0.5s ease-in-out;\n transition: all 0.5s ease-in-out;\n }\n\n :host(.flipped) {\n -webkit-transform: var(--card-list-flip-transform);\n transform: var(--card-list-flip-transform);\n }\n\n [front],\n [back] {\n position: absolute;\n\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n border: var(--card-list-create-border);\n\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface);\n\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n }\n\n [front] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n text-align: center;\n font-size: 0.8em;\n text-transform: capitalize;\n }\n\n [front] md-icon {\n --md-icon-size: 42px;\n font-size: 3.5em;\n color: var(--md-sys-color-primary);\n }\n\n [back] {\n -webkit-transform: var(--card-list-flip-transform);\n transform: var(--card-list-flip-transform);\n box-sizing: border-box;\n display: grid;\n }\n\n [back] form {\n padding: var(--card-list-create-form-padding);\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto 1fr auto;\n justify-content: center;\n align-items: center;\n }\n\n [back] form .props {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-row-gap: 7px;\n justify-content: center;\n align-items: center;\n }\n\n [back] form .props label {\n grid-column: span 4;\n font: var(--card-list-create-label-font);\n color: var(--card-list-create-label-color, var(--md-sys-color-secondary));\n }\n\n input,\n select,\n ox-file-selector {\n background-color: var(--card-list-create-input-background-color, var(--md-sys-color-surface-variant));\n color: var(--card-list-create-input-color, var(--md-sys-color-on-surface));\n }\n\n [back] form .props input,\n [back] form .props select {\n grid-column: span 6;\n border: var(--card-list-create-input-border);\n border-radius: var(--card-list-create-input-border-radius);\n font: var(--card-list-create-input-font);\n width: -moz-available;\n }\n\n ox-file-selector {\n grid-column: span 6;\n font: var(--card-list-create-input-font);\n border: none;\n box-sizing: border-box;\n padding: 0;\n }\n\n [back] input[type='submit'] {\n font: var(--button-font);\n border-radius: var(--button-radius);\n border: var(--button-border);\n grid-column: span 10;\n grid-row: auto / -1;\n }\n\n .hidden {\n display: none !important;\n }\n `\n ]\n\n @property({ type: String }) provider: string = 'google'\n @property({ type: Array }) googleFonts: Array<string> = []\n @property({ type: Array }) files?: Array<any>\n\n providers: Array<{ value: string; display: string }> = [\n { value: 'google', display: 'Google' },\n // TODO 구글 외 폰트 서비스 구현\n // { value: 'typekit', display: 'Typekit' },\n { value: 'custom', display: 'Custom' }\n ]\n\n render() {\n let isProviderGoogle = this.provider == 'google' && this.googleFonts.length > 0\n let isFileAttached = this.files && this.files.length > 0 ? true : false\n\n return html`\n <div @click=${(e: Event) => this.onClickFlip(e)} front><md-icon>add_circle_outline</md-icon>create font</div>\n\n <div @click=${(e: Event) => this.onClickFlip(e)} back>\n <form @submit=${(e: Event) => this.onClickSubmit(e)}>\n <div class=\"props\">\n <label>${i18next.t('label.provider')}</label>\n <select\n name=\"provider\"\n @change=${(e: Event) => {\n this.provider = (e.target as HTMLInputElement).value\n if (this.provider === 'google') {\n fetch(`/all-google-fonts`).then(async response => {\n if (response.ok) this.googleFonts = await response.json()\n else {\n console.warn(\n `(${response.url}) ${response.status} ${response.statusText}. Could not load Google fonts.`\n )\n }\n })\n }\n }}\n >\n ${this.providers.map(\n p => html` <option value=${p.value} ?selected=${this.provider == p.value}>${p.display}</option> `\n )}\n </select>\n\n <label>${i18next.t('label.name')}</label>\n <input type=\"text\" name=\"${isProviderGoogle ? '' : 'name'}\" ?hidden=${isProviderGoogle} />\n <select name=\"${isProviderGoogle ? 'name' : ''}\" ?hidden=${!isProviderGoogle}>\n <option value=\"\"> </option>\n ${isProviderGoogle && this.googleFonts.map(f => html` <option value=${f}>${f}</option> `)}\n </select>\n\n <label ?hidden=${this.provider != 'custom'}>${i18next.t('label.uri')}</label>\n <input\n ?hidden=${this.provider != 'custom'}\n ?disabled=${isFileAttached}\n .value=${isFileAttached ? this.files![0].name : ''}\n type=\"text\"\n name=\"uri\"\n />\n <!-- display when attachment module is imported -->\n <label ?hidden=${this.provider != 'custom'}>${i18next.t('label.file')}</label>\n <ox-file-selector\n class=\"${this.provider != 'custom' ? 'hidden' : ''}\"\n name=\"file\"\n label=\"${i18next.t('label.select file')}\"\n accept=\".ttf,.otf,.woff,.woff2,.eot,.svg,.svgz\"\n multiple\n @file-change=${(e: CustomEvent) => {\n this.files = Array.from(e.detail.files)\n }}\n ></ox-file-selector>\n <!------------------------------------------------>\n\n <label for=\"checkbox-active\" @click=${(e: Event) => e.stopPropagation()}>\n ${i18next.t('label.active')}\n </label>\n <input id=\"checkbox-active\" type=\"checkbox\" name=\"active\" checked />\n </div>\n <div></div>\n <input type=\"submit\" value=${i18next.t('button.create')} />\n </form>\n </div>\n `\n }\n\n onClickFlip(e: Event) {\n const target = e.target as HTMLElement\n const currentTarget = e.currentTarget as HTMLElement\n\n if (!['INPUT', 'SELECT', 'OPTION'].find(tagName => tagName === target.tagName)) {\n if (currentTarget.hasAttribute('front')) this.reset() // 입력 폼으로 뒤집기 전에 한 번 리셋\n this.classList.toggle('flipped')\n }\n }\n\n async onClickSubmit(e: Event) {\n e.preventDefault()\n e.stopPropagation()\n\n var form = e.target as HTMLFormElement\n\n var detail = {} as any\n\n detail.name = (form.elements.namedItem('name') as HTMLInputElement).value\n detail.provider = (form.elements.namedItem('provider') as HTMLInputElement).value\n detail.active = (form.elements.namedItem('active') as HTMLInputElement).checked\n\n if (this.provider === 'custom') {\n detail.uri = (form.elements.namedItem('uri') as HTMLInputElement).value\n if (this.files && this.files.length > 0) {\n detail.files = this.files\n }\n }\n\n this.dispatchEvent(new CustomEvent('create-font', { detail }))\n }\n\n reset() {\n var form = this.renderRoot.querySelector('form')\n if (form) {\n form.reset()\n }\n\n this.files = []\n this.classList.remove('flipped')\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import '@operato/input/ox-select.js';
|
|
3
3
|
import '@operato/popup/ox-popup-list.js';
|
|
4
|
-
import './font-creation-card';
|
|
4
|
+
import './font-creation-card.js';
|
|
5
5
|
import { LitElement, PropertyValues } from 'lit';
|
|
6
6
|
declare const FontSelector_base: (new (...args: any[]) => LitElement) & (new (...args: any[]) => {
|
|
7
7
|
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
3
|
import '@operato/input/ox-select.js';
|
|
4
4
|
import '@operato/popup/ox-popup-list.js';
|
|
5
|
-
import './font-creation-card';
|
|
5
|
+
import './font-creation-card.js';
|
|
6
6
|
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
8
8
|
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
@@ -10,15 +10,53 @@ import { i18next, localize } from '@operato/i18n';
|
|
|
10
10
|
import { pulltorefresh } from '@operato/pull-to-refresh';
|
|
11
11
|
import { store } from '@operato/shell';
|
|
12
12
|
import { ScrollbarStyles, CommonHeaderStyles } from '@operato/styles';
|
|
13
|
-
import { createFont, deleteFont, updateFont } from './font-graphql-client';
|
|
14
|
-
import { actionUpdateFontList } from './redux-font-actions';
|
|
13
|
+
import { createFont, deleteFont, updateFont } from './font-graphql-client.js';
|
|
14
|
+
import { actionUpdateFontList } from './redux-font-actions.js';
|
|
15
15
|
let FontSelector = class FontSelector extends localize(i18next)(connect(store)(LitElement)) {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
this
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
Object.defineProperty(this, "fonts", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: []
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "creatable", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: false
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "provider", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: ''
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(this, "main", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: void 0
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(this, "header", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: void 0
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(this, "creationCard", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: void 0
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(this, "showGotoTop", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: false
|
|
59
|
+
});
|
|
22
60
|
}
|
|
23
61
|
render() {
|
|
24
62
|
var fonts = this.fonts || [];
|
|
@@ -140,10 +178,14 @@ let FontSelector = class FontSelector extends localize(i18next)(connect(store)(L
|
|
|
140
178
|
}));
|
|
141
179
|
}
|
|
142
180
|
};
|
|
143
|
-
FontSelector
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
181
|
+
Object.defineProperty(FontSelector, "styles", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
configurable: true,
|
|
184
|
+
writable: true,
|
|
185
|
+
value: [
|
|
186
|
+
ScrollbarStyles,
|
|
187
|
+
CommonHeaderStyles,
|
|
188
|
+
css `
|
|
147
189
|
:host {
|
|
148
190
|
display: flex;
|
|
149
191
|
flex-direction: column;
|
|
@@ -239,7 +281,8 @@ FontSelector.styles = [
|
|
|
239
281
|
text-indent: 7px;
|
|
240
282
|
}
|
|
241
283
|
`
|
|
242
|
-
]
|
|
284
|
+
]
|
|
285
|
+
});
|
|
243
286
|
__decorate([
|
|
244
287
|
property({ type: Array })
|
|
245
288
|
], FontSelector.prototype, "fonts", void 0);
|