@rdlabo/ionic-angular-photo-editor 21.7.0 → 22.0.0-1
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/README.md +57 -23
- package/css/ios26-header-button-color-scheme.css +114 -0
- package/docs/editor.md +65 -18
- package/docs/photo-file.md +90 -18
- package/docs/theme.md +21 -3
- package/docs/viewer.md +58 -23
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs +12 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs +301 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs +30 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs +193 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs +126 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs +32 -500
- package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs.map +1 -1
- package/package.json +49 -10
- package/types/rdlabo-ionic-angular-photo-editor-editor-tui.d.ts +6 -0
- package/types/rdlabo-ionic-angular-photo-editor-editor.d.ts +52 -0
- package/types/rdlabo-ionic-angular-photo-editor-file-capacitor.d.ts +6 -0
- package/types/rdlabo-ionic-angular-photo-editor-file.d.ts +13 -0
- package/types/rdlabo-ionic-angular-photo-editor-viewer.d.ts +32 -0
- package/types/rdlabo-ionic-angular-photo-editor.d.ts +144 -95
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, input, computed, viewChild, ElementRef, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import * as i1 from '@ionic/angular';
|
|
7
|
+
import { IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange, ModalController } from '@ionic/angular';
|
|
8
|
+
import { PHOTO_EDITOR_CONFIG } from '@rdlabo/ionic-angular-photo-editor';
|
|
9
|
+
import { addIcons } from 'ionicons';
|
|
10
|
+
import { checkmarkOutline, refreshOutline, squareOutline, tabletLandscapeOutline, expandOutline, sunnyOutline, colorFilterOutline, cropOutline, send, closeOutline } from 'ionicons/icons';
|
|
11
|
+
|
|
12
|
+
const filterPreset = (dictionary) => [
|
|
13
|
+
{ name: dictionary.original, type: 'Default', option: null },
|
|
14
|
+
{ name: dictionary.sepia, type: 'Sepia', option: null },
|
|
15
|
+
{ name: dictionary.vintage, type: 'vintage', option: null },
|
|
16
|
+
{ name: dictionary.blur, type: 'Blur', option: { blur: 0.1 } },
|
|
17
|
+
{ name: dictionary.grayscale, type: 'Grayscale', option: null },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange];
|
|
21
|
+
|
|
22
|
+
const dictionaryForEditor = () => ({
|
|
23
|
+
save: '保存',
|
|
24
|
+
close: '閉じる',
|
|
25
|
+
back: '戻る',
|
|
26
|
+
apply: '適用',
|
|
27
|
+
crop: '切り抜き・回転',
|
|
28
|
+
rotate: '回転',
|
|
29
|
+
cropCover: '画像に合わせる',
|
|
30
|
+
crop16x9: '16対9',
|
|
31
|
+
cropSquare: '正方形',
|
|
32
|
+
cropFree: '自由',
|
|
33
|
+
filter: 'フィルター',
|
|
34
|
+
brightness: '明るさ',
|
|
35
|
+
original: 'オリジナル',
|
|
36
|
+
invert: '反転',
|
|
37
|
+
sepia: 'セピア',
|
|
38
|
+
vintage: 'ヴィンテージ',
|
|
39
|
+
blur: 'ぼかし',
|
|
40
|
+
grayscale: 'グレースケール',
|
|
41
|
+
sharpen: '輪郭',
|
|
42
|
+
emboss: 'エンボス',
|
|
43
|
+
});
|
|
44
|
+
const initializeEditorIcons = () => {
|
|
45
|
+
addIcons({
|
|
46
|
+
closeOutline,
|
|
47
|
+
send,
|
|
48
|
+
cropOutline,
|
|
49
|
+
colorFilterOutline,
|
|
50
|
+
sunnyOutline,
|
|
51
|
+
expandOutline,
|
|
52
|
+
tabletLandscapeOutline,
|
|
53
|
+
squareOutline,
|
|
54
|
+
refreshOutline,
|
|
55
|
+
checkmarkOutline,
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Ionic modal page for cropping, rotating, filtering, and saving a photo. */
|
|
60
|
+
class PhotoEditorPage {
|
|
61
|
+
#config;
|
|
62
|
+
constructor() {
|
|
63
|
+
this.modalCtrl = inject(ModalController);
|
|
64
|
+
this.#config = inject(PHOTO_EDITOR_CONFIG);
|
|
65
|
+
this.requireSquare = input(false, { ...(ngDevMode ? { debugName: "requireSquare" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
66
|
+
this.labels = input(undefined, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
68
|
+
this.toolbarColorScheme = input.required(/* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "toolbarColorScheme" }] : /* istanbul ignore next */ []));
|
|
70
|
+
this.value = input.required(/* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
72
|
+
this.dictionary = computed(() => ({ ...dictionaryForEditor(), ...this.labels() }), /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "dictionary" }] : /* istanbul ignore next */ []));
|
|
74
|
+
this.editorRef = viewChild.required('imageEditor', /* @ts-ignore */
|
|
75
|
+
...(ngDevMode ? [{ debugName: "editorRef" }] : /* istanbul ignore next */ []));
|
|
76
|
+
this.ionContent = viewChild.required(IonContent, { ...(ngDevMode ? { debugName: "ionContent" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
77
|
+
this.filters = signal([], /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
|
|
79
|
+
this.footerMenu = signal('menu', /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "footerMenu" }] : /* istanbul ignore next */ []));
|
|
81
|
+
this.currentCrop = signal('cover', /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "currentCrop" }] : /* istanbul ignore next */ []));
|
|
83
|
+
this.currentRotate = signal(0, /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "currentRotate" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.photoCrop = signal({
|
|
86
|
+
width: 0,
|
|
87
|
+
height: 0,
|
|
88
|
+
}, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "photoCrop" }] : /* istanbul ignore next */ []));
|
|
90
|
+
this.isCropped = signal(false, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "isCropped" }] : /* istanbul ignore next */ []));
|
|
92
|
+
this.adoptFilter = signal(undefined, /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "adoptFilter" }] : /* istanbul ignore next */ []));
|
|
94
|
+
this.filterPreset = computed(() => filterPreset(this.dictionary()), /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "filterPreset" }] : /* istanbul ignore next */ []));
|
|
96
|
+
this.filterImageSize = 240;
|
|
97
|
+
this.initializationGeneration = 0;
|
|
98
|
+
this.footerMenuEffect = effect(() => {
|
|
99
|
+
const menu = this.footerMenu();
|
|
100
|
+
const editor = this.editorInstance;
|
|
101
|
+
if (!editor) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (menu === 'filter') {
|
|
105
|
+
void this.initializeFilterMenu();
|
|
106
|
+
}
|
|
107
|
+
else if (menu === 'crop') {
|
|
108
|
+
editor.startDrawingMode('CROPPER');
|
|
109
|
+
this.changeCrop(this.requireSquare() ? '1' : 'cover');
|
|
110
|
+
}
|
|
111
|
+
}, /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "footerMenuEffect" }] : /* istanbul ignore next */ []));
|
|
113
|
+
this.canvasContainerObserver = new MutationObserver(() => this.syncCanvasSize());
|
|
114
|
+
initializeEditorIcons();
|
|
115
|
+
}
|
|
116
|
+
ngOnDestroy() {
|
|
117
|
+
this.initializationGeneration += 1;
|
|
118
|
+
this.destroyEditor();
|
|
119
|
+
}
|
|
120
|
+
async ionViewDidEnter() {
|
|
121
|
+
const generation = ++this.initializationGeneration;
|
|
122
|
+
const editor = await this.#config.createImageEditor(this.editorRef().nativeElement, {
|
|
123
|
+
cssMaxWidth: this.ionContent().nativeElement.clientWidth - 32,
|
|
124
|
+
cssMaxHeight: this.ionContent().nativeElement.clientHeight - 32,
|
|
125
|
+
});
|
|
126
|
+
if (generation !== this.initializationGeneration) {
|
|
127
|
+
editor.destroy();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.editorInstance = editor;
|
|
131
|
+
return this.initializeEditor(editor, generation).catch((error) => {
|
|
132
|
+
if (this.editorInstance === editor) {
|
|
133
|
+
this.destroyEditor();
|
|
134
|
+
}
|
|
135
|
+
throw error;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async initializeEditor(editor, generation) {
|
|
139
|
+
const response = await fetch(this.value());
|
|
140
|
+
if (!this.isCurrentEditor(editor, generation)) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (!response.ok) {
|
|
144
|
+
throw new Error(`Unable to load photo: ${response.status}`);
|
|
145
|
+
}
|
|
146
|
+
const blob = await response.blob();
|
|
147
|
+
if (!this.isCurrentEditor(editor, generation)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
await editor.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));
|
|
151
|
+
if (!this.isCurrentEditor(editor, generation)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const editorElement = this.editorRef().nativeElement;
|
|
155
|
+
this.canvasContainer = editorElement.querySelector('.tui-image-editor-canvas-container') ?? undefined;
|
|
156
|
+
if (this.canvasContainer) {
|
|
157
|
+
this.syncCanvasSize();
|
|
158
|
+
this.canvasContainerObserver.observe(this.canvasContainer, {
|
|
159
|
+
attributes: true,
|
|
160
|
+
childList: false,
|
|
161
|
+
subtree: true,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
this.footerMenu.set(this.requireSquare() ? 'crop' : 'menu');
|
|
165
|
+
}
|
|
166
|
+
ionViewDidLeave() {
|
|
167
|
+
this.initializationGeneration += 1;
|
|
168
|
+
this.destroyEditor();
|
|
169
|
+
}
|
|
170
|
+
changeCrop(crop) {
|
|
171
|
+
const rect = crop === 'cover' ? this.photoCrop().width / this.photoCrop().height : crop === '16/9' ? 16 / 9 : 1;
|
|
172
|
+
this.editorInstance?.setCropzoneRect(crop !== 'auto' ? rect : undefined);
|
|
173
|
+
this.currentCrop.set(crop);
|
|
174
|
+
}
|
|
175
|
+
async rotate() {
|
|
176
|
+
const editor = this.requireEditor();
|
|
177
|
+
editor.stopDrawingMode();
|
|
178
|
+
await editor.rotate(90);
|
|
179
|
+
this.currentRotate.update((value) => value + 90);
|
|
180
|
+
editor.startDrawingMode('CROPPER');
|
|
181
|
+
requestAnimationFrame(() => this.changeCrop(this.currentCrop()));
|
|
182
|
+
}
|
|
183
|
+
async closeCrop(type) {
|
|
184
|
+
const editor = this.requireEditor();
|
|
185
|
+
if (this.footerMenu() === 'crop') {
|
|
186
|
+
if (type === 'cancel') {
|
|
187
|
+
await editor.rotate(this.currentRotate() * -1);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
await editor.crop(editor.getCropzoneRect());
|
|
191
|
+
this.isCropped.set(true);
|
|
192
|
+
}
|
|
193
|
+
this.currentRotate.set(0);
|
|
194
|
+
this.currentCrop.set('cover');
|
|
195
|
+
editor.stopDrawingMode();
|
|
196
|
+
}
|
|
197
|
+
else if (this.footerMenu() === 'brightness') {
|
|
198
|
+
if (type === 'cancel' && editor.hasFilter('brightness')) {
|
|
199
|
+
await editor.removeFilter('brightness');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
this.footerMenu.set('menu');
|
|
203
|
+
}
|
|
204
|
+
async changeRange(event) {
|
|
205
|
+
const editor = this.requireEditor();
|
|
206
|
+
if (editor.hasFilter('brightness')) {
|
|
207
|
+
await editor.removeFilter('brightness');
|
|
208
|
+
}
|
|
209
|
+
await editor.applyFilter('brightness', {
|
|
210
|
+
brightness: Number(event.detail.value) / 255,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
imageSave() {
|
|
214
|
+
const value = this.requireEditor().toDataURL();
|
|
215
|
+
void this.modalCtrl.dismiss({ action: 'save', value });
|
|
216
|
+
}
|
|
217
|
+
async initializeFilterMenu() {
|
|
218
|
+
const editor = this.requireEditor();
|
|
219
|
+
const filters = [];
|
|
220
|
+
const defaultInstance = await this.#config.createImageEditor(document.createElement('div'), {
|
|
221
|
+
cssMaxWidth: this.filterImageSize,
|
|
222
|
+
cssMaxHeight: (this.photoCrop().height * this.filterImageSize) / this.photoCrop().width,
|
|
223
|
+
});
|
|
224
|
+
const blob = await fetch(editor.toDataURL({
|
|
225
|
+
multiplier: this.filterImageSize / this.photoCrop().width,
|
|
226
|
+
})).then((res) => res.blob());
|
|
227
|
+
await defaultInstance.loadImageFromFile(new File([blob], 'defaultInstance.png', { type: blob.type }));
|
|
228
|
+
for (const filter of this.filterPreset()) {
|
|
229
|
+
if (filter.type !== 'Default') {
|
|
230
|
+
await defaultInstance.applyFilter(filter.type, filter.option ?? undefined);
|
|
231
|
+
}
|
|
232
|
+
filters.push({
|
|
233
|
+
name: filter.name,
|
|
234
|
+
type: filter.type,
|
|
235
|
+
option: filter.option,
|
|
236
|
+
data: defaultInstance.toDataURL(),
|
|
237
|
+
width: this.filterImageSize,
|
|
238
|
+
height: (this.photoCrop().height * this.filterImageSize) / this.photoCrop().width,
|
|
239
|
+
});
|
|
240
|
+
if (filter.type !== 'Default') {
|
|
241
|
+
await defaultInstance.removeFilter(filter.type);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
this.filters.set(filters);
|
|
245
|
+
defaultInstance.destroy();
|
|
246
|
+
}
|
|
247
|
+
async filterImage(filter) {
|
|
248
|
+
const editor = this.requireEditor();
|
|
249
|
+
if (this.adoptFilter()) {
|
|
250
|
+
await editor.removeFilter(this.adoptFilter().type);
|
|
251
|
+
}
|
|
252
|
+
if (filter.type === 'Default') {
|
|
253
|
+
this.adoptFilter.set(undefined);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
await editor.applyFilter(filter.type, filter.option ?? undefined);
|
|
257
|
+
this.adoptFilter.set(filter);
|
|
258
|
+
}
|
|
259
|
+
requireEditor() {
|
|
260
|
+
if (!this.editorInstance) {
|
|
261
|
+
throw new Error('Photo editor is not initialized.');
|
|
262
|
+
}
|
|
263
|
+
return this.editorInstance;
|
|
264
|
+
}
|
|
265
|
+
destroyEditor() {
|
|
266
|
+
this.canvasContainerObserver.disconnect();
|
|
267
|
+
this.canvasContainer = undefined;
|
|
268
|
+
this.editorInstance?.destroy();
|
|
269
|
+
this.editorInstance = undefined;
|
|
270
|
+
}
|
|
271
|
+
isCurrentEditor(editor, generation) {
|
|
272
|
+
return generation === this.initializationGeneration && editor === this.editorInstance;
|
|
273
|
+
}
|
|
274
|
+
syncCanvasSize() {
|
|
275
|
+
const container = this.canvasContainer;
|
|
276
|
+
const canvas = container?.querySelector('canvas');
|
|
277
|
+
if (!container || !canvas) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const bounds = container.parentElement ?? container;
|
|
281
|
+
const editor = this.editorRef().nativeElement;
|
|
282
|
+
editor.style.minWidth = bounds.style.maxWidth;
|
|
283
|
+
editor.style.minHeight = bounds.style.maxHeight;
|
|
284
|
+
this.photoCrop.set({ width: canvas.width, height: canvas.height });
|
|
285
|
+
}
|
|
286
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoEditorPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
287
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: PhotoEditorPage, isStandalone: true, selector: "rdlabo-photo-editor", inputs: { requireSquare: { classPropertyName: "requireSquare", publicName: "requireSquare", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, toolbarColorScheme: { classPropertyName: "toolbarColorScheme", publicName: "toolbarColorScheme", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "editorRef", first: true, predicate: ["imageEditor"], descendants: true, isSignal: true }, { propertyName: "ionContent", first: true, predicate: IonContent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ion-header\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"solid\"\n type=\"submit\"\n [disabled]=\"!['menu', 'filter'].includes(footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary().save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button type=\"button\" (click)=\"footerMenu.set('crop')\">\n <ion-text>{{ dictionary().crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('filter')\">\n <ion-text>{{ dictionary().filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('brightness')\">\n <ion-text>{{ dictionary().brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n } @if (this.footerMenu() === 'filter') {\n <aside>\n @for (item of filters(); track item) {\n <button type=\"button\" (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n } @if (this.footerMenu() === 'crop' && !requireSquare()) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button\n [attr.aria-label]=\"dictionary().cropCover\"\n (click)=\"changeCrop('cover')\"\n [color]=\"currentCrop() === 'cover' ? 'success' : undefined\"\n >\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().crop16x9\"\n (click)=\"changeCrop('16/9')\"\n [color]=\"currentCrop() === '16/9' ? 'success' : undefined\"\n >\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropSquare\"\n (click)=\"changeCrop('1')\"\n [color]=\"currentCrop() === '1' ? 'success' : undefined\"\n >\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropFree\"\n (click)=\"changeCrop('auto')\"\n [color]=\"currentCrop() === 'auto' ? 'success' : undefined\"\n >\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button [attr.aria-label]=\"dictionary().rotate\" (click)=\"rotate()\"\n ><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n </ion-buttons>\n } @if (['brightness'].includes(this.footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range\n [attr.aria-label]=\"dictionary().brightness\"\n [pin]=\"true\"\n [min]=\"-100\"\n [max]=\"100\"\n (ionChange)=\"changeRange($any($event))\"\n ></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.footerMenu.set('menu')\">{{ dictionary().back }}</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare() || isCropped()) {\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"closeCrop('cancel')\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if (footerMenu() === 'crop') { {{ dictionary().crop }} } @else if (footerMenu() === 'brightness') { {{ dictionary().brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button [attr.aria-label]=\"dictionary().apply\" (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, var(--ion-color-step-100, #2a2a2a));--editor-background-tint: var(--ion-photo-editor-background-tint, var(--ion-color-step-200, #414141));--editor-color: var(--ion-photo-editor-color, var(--ion-color-step-950, #f0f0f0));--editor-color-tint: var(--ion-photo-editor-color-tint, var(--ion-color-step-850, #dbdbdb));--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, var(--ion-color-primary, #4d8dff));--ion-color-photo-editor-primary-rgb: var(--ion-photo-editor-primary-rgb, var(--ion-color-primary-rgb, 77, 141, 255));--ion-color-photo-editor-primary-contrast: var(--ion-photo-editor-primary-contrast, var(--ion-color-primary-contrast, #000));--ion-color-photo-editor-primary-contrast-rgb: var( --ion-photo-editor-primary-contrast-rgb, var(--ion-color-primary-contrast-rgb, 0, 0, 0) );--ion-color-photo-editor-primary-shade: var(--ion-photo-editor-primary-shade, var(--ion-color-primary-shade, #447ce0));--ion-color-photo-editor-primary-tint: var(--ion-photo-editor-primary-tint, var(--ion-color-primary-tint, #5f98ff));--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-danger-rgb: var(--ion-photo-editor-danger-rgb, 242, 76, 88);--ion-color-photo-editor-danger-contrast: var(--ion-photo-editor-danger-contrast, #000);--ion-color-photo-editor-danger-contrast-rgb: var(--ion-photo-editor-danger-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-danger-shade: var(--ion-photo-editor-danger-shade, #d5434d);--ion-color-photo-editor-danger-tint: var(--ion-photo-editor-danger-tint, #f35e69);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b);--ion-color-photo-editor-success-rgb: var(--ion-photo-editor-success-rgb, 45, 213, 91);--ion-color-photo-editor-success-contrast: var(--ion-photo-editor-success-contrast, #000);--ion-color-photo-editor-success-contrast-rgb: var(--ion-photo-editor-success-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-success-shade: var(--ion-photo-editor-success-shade, #28bb50);--ion-color-photo-editor-success-tint: var(--ion-photo-editor-success-tint, #42d96b)}ion-header.photo-editor-header-buttons-light ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-light, #222428)}ion-header.photo-editor-header-buttons-dark ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-dark, #f4f5f8)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary);--ion-color-base-rgb: var(--ion-color-photo-editor-primary-rgb);--ion-color-contrast: var(--ion-color-photo-editor-primary-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-primary-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-primary-shade);--ion-color-tint: var(--ion-color-photo-editor-primary-tint)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger);--ion-color-base-rgb: var(--ion-color-photo-editor-danger-rgb);--ion-color-contrast: var(--ion-color-photo-editor-danger-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-danger-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-danger-shade);--ion-color-tint: var(--ion-color-photo-editor-danger-tint)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success);--ion-color-base-rgb: var(--ion-color-photo-editor-success-rgb);--ion-color-contrast: var(--ion-color-photo-editor-success-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-success-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-success-shade);--ion-color-tint: var(--ion-color-photo-editor-success-tint)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"], outputs: ["ionFocus", "ionBlur"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"], outputs: ["ionScrollStart", "ionScroll", "ionScrollEnd"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonRange, selector: "ion-range", inputs: ["activeBarStart", "color", "debounce", "disabled", "dualKnobs", "label", "labelPlacement", "max", "min", "mode", "name", "pin", "pinFormatter", "snaps", "step", "ticks", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
288
|
+
}
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoEditorPage, decorators: [{
|
|
290
|
+
type: Component,
|
|
291
|
+
args: [{ selector: 'rdlabo-photo-editor', imports: [CommonModule, FormsModule, ...ionComponents], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-header\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"solid\"\n type=\"submit\"\n [disabled]=\"!['menu', 'filter'].includes(footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary().save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button type=\"button\" (click)=\"footerMenu.set('crop')\">\n <ion-text>{{ dictionary().crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('filter')\">\n <ion-text>{{ dictionary().filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('brightness')\">\n <ion-text>{{ dictionary().brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n } @if (this.footerMenu() === 'filter') {\n <aside>\n @for (item of filters(); track item) {\n <button type=\"button\" (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n } @if (this.footerMenu() === 'crop' && !requireSquare()) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button\n [attr.aria-label]=\"dictionary().cropCover\"\n (click)=\"changeCrop('cover')\"\n [color]=\"currentCrop() === 'cover' ? 'success' : undefined\"\n >\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().crop16x9\"\n (click)=\"changeCrop('16/9')\"\n [color]=\"currentCrop() === '16/9' ? 'success' : undefined\"\n >\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropSquare\"\n (click)=\"changeCrop('1')\"\n [color]=\"currentCrop() === '1' ? 'success' : undefined\"\n >\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropFree\"\n (click)=\"changeCrop('auto')\"\n [color]=\"currentCrop() === 'auto' ? 'success' : undefined\"\n >\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button [attr.aria-label]=\"dictionary().rotate\" (click)=\"rotate()\"\n ><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n </ion-buttons>\n } @if (['brightness'].includes(this.footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range\n [attr.aria-label]=\"dictionary().brightness\"\n [pin]=\"true\"\n [min]=\"-100\"\n [max]=\"100\"\n (ionChange)=\"changeRange($any($event))\"\n ></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.footerMenu.set('menu')\">{{ dictionary().back }}</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare() || isCropped()) {\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"closeCrop('cancel')\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if (footerMenu() === 'crop') { {{ dictionary().crop }} } @else if (footerMenu() === 'brightness') { {{ dictionary().brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button [attr.aria-label]=\"dictionary().apply\" (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, var(--ion-color-step-100, #2a2a2a));--editor-background-tint: var(--ion-photo-editor-background-tint, var(--ion-color-step-200, #414141));--editor-color: var(--ion-photo-editor-color, var(--ion-color-step-950, #f0f0f0));--editor-color-tint: var(--ion-photo-editor-color-tint, var(--ion-color-step-850, #dbdbdb));--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, var(--ion-color-primary, #4d8dff));--ion-color-photo-editor-primary-rgb: var(--ion-photo-editor-primary-rgb, var(--ion-color-primary-rgb, 77, 141, 255));--ion-color-photo-editor-primary-contrast: var(--ion-photo-editor-primary-contrast, var(--ion-color-primary-contrast, #000));--ion-color-photo-editor-primary-contrast-rgb: var( --ion-photo-editor-primary-contrast-rgb, var(--ion-color-primary-contrast-rgb, 0, 0, 0) );--ion-color-photo-editor-primary-shade: var(--ion-photo-editor-primary-shade, var(--ion-color-primary-shade, #447ce0));--ion-color-photo-editor-primary-tint: var(--ion-photo-editor-primary-tint, var(--ion-color-primary-tint, #5f98ff));--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-danger-rgb: var(--ion-photo-editor-danger-rgb, 242, 76, 88);--ion-color-photo-editor-danger-contrast: var(--ion-photo-editor-danger-contrast, #000);--ion-color-photo-editor-danger-contrast-rgb: var(--ion-photo-editor-danger-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-danger-shade: var(--ion-photo-editor-danger-shade, #d5434d);--ion-color-photo-editor-danger-tint: var(--ion-photo-editor-danger-tint, #f35e69);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b);--ion-color-photo-editor-success-rgb: var(--ion-photo-editor-success-rgb, 45, 213, 91);--ion-color-photo-editor-success-contrast: var(--ion-photo-editor-success-contrast, #000);--ion-color-photo-editor-success-contrast-rgb: var(--ion-photo-editor-success-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-success-shade: var(--ion-photo-editor-success-shade, #28bb50);--ion-color-photo-editor-success-tint: var(--ion-photo-editor-success-tint, #42d96b)}ion-header.photo-editor-header-buttons-light ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-light, #222428)}ion-header.photo-editor-header-buttons-dark ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-dark, #f4f5f8)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary);--ion-color-base-rgb: var(--ion-color-photo-editor-primary-rgb);--ion-color-contrast: var(--ion-color-photo-editor-primary-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-primary-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-primary-shade);--ion-color-tint: var(--ion-color-photo-editor-primary-tint)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger);--ion-color-base-rgb: var(--ion-color-photo-editor-danger-rgb);--ion-color-contrast: var(--ion-color-photo-editor-danger-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-danger-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-danger-shade);--ion-color-tint: var(--ion-color-photo-editor-danger-tint)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success);--ion-color-base-rgb: var(--ion-color-photo-editor-success-rgb);--ion-color-contrast: var(--ion-color-photo-editor-success-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-success-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-success-shade);--ion-color-tint: var(--ion-color-photo-editor-success-tint)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"] }]
|
|
292
|
+
}], ctorParameters: () => [], propDecorators: { requireSquare: [{ type: i0.Input, args: [{ isSignal: true, alias: "requireSquare", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], toolbarColorScheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarColorScheme", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], editorRef: [{ type: i0.ViewChild, args: ['imageEditor', { isSignal: true }] }], ionContent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => IonContent), { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
293
|
+
|
|
294
|
+
/** Photo editing modal entry point. */
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Generated bundle index. Do not edit.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
export { PhotoEditorPage };
|
|
301
|
+
//# sourceMappingURL=rdlabo-ionic-angular-photo-editor-editor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdlabo-ionic-angular-photo-editor-editor.mjs","sources":["../../../projects/photo-editor/editor/src/lib/filter-preset.ts","../../../projects/photo-editor/editor/src/lib/ion-components.ts","../../../projects/photo-editor/editor/src/lib/internals.ts","../../../projects/photo-editor/editor/src/lib/photo-editor.page.ts","../../../projects/photo-editor/editor/src/lib/photo-editor.page.html","../../../projects/photo-editor/editor/src/public-api.ts","../../../projects/photo-editor/editor/src/rdlabo-ionic-angular-photo-editor-editor.ts"],"sourcesContent":["import { PhotoEditorLabels, PhotoFilterPreset } from '@rdlabo/ionic-angular-photo-editor';\n\nexport const filterPreset = (dictionary: PhotoEditorLabels): PhotoFilterPreset[] => [\n { name: dictionary.original, type: 'Default', option: null },\n { name: dictionary.sepia, type: 'Sepia', option: null },\n { name: dictionary.vintage, type: 'vintage', option: null },\n { name: dictionary.blur, type: 'Blur', option: { blur: 0.1 } },\n { name: dictionary.grayscale, type: 'Grayscale', option: null },\n];\n","import { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonRange, IonText, IonToolbar } from '@ionic/angular';\n\nexport const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange];\n","import { PhotoEditorLabels } from '@rdlabo/ionic-angular-photo-editor';\nimport { addIcons } from 'ionicons';\nimport {\n checkmarkOutline,\n closeOutline,\n colorFilterOutline,\n cropOutline,\n expandOutline,\n refreshOutline,\n send,\n squareOutline,\n sunnyOutline,\n tabletLandscapeOutline,\n} from 'ionicons/icons';\n\nexport const dictionaryForEditor = (): PhotoEditorLabels => ({\n save: '保存',\n close: '閉じる',\n back: '戻る',\n apply: '適用',\n crop: '切り抜き・回転',\n rotate: '回転',\n cropCover: '画像に合わせる',\n crop16x9: '16対9',\n cropSquare: '正方形',\n cropFree: '自由',\n filter: 'フィルター',\n brightness: '明るさ',\n original: 'オリジナル',\n invert: '反転',\n sepia: 'セピア',\n vintage: 'ヴィンテージ',\n blur: 'ぼかし',\n grayscale: 'グレースケール',\n sharpen: '輪郭',\n emboss: 'エンボス',\n});\n\nexport const initializeEditorIcons = (): void => {\n addIcons({\n closeOutline,\n send,\n cropOutline,\n colorFilterOutline,\n sunnyOutline,\n expandOutline,\n tabletLandscapeOutline,\n squareOutline,\n refreshOutline,\n checkmarkOutline,\n });\n};\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n signal,\n viewChild,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { IonContent, ModalController, RangeCustomEvent, ViewDidEnter, ViewDidLeave } from '@ionic/angular';\nimport {\n PHOTO_EDITOR_CONFIG,\n PhotoEditorLabels,\n PhotoEditorResult,\n PhotoFilter,\n PhotoImageEditor,\n PhotoSize,\n PhotoToolbarColorScheme,\n} from '@rdlabo/ionic-angular-photo-editor';\nimport { filterPreset } from './filter-preset';\nimport { ionComponents } from './ion-components';\nimport { dictionaryForEditor, initializeEditorIcons } from './internals';\n\n@Component({\n selector: 'rdlabo-photo-editor',\n templateUrl: './photo-editor.page.html',\n styleUrls: ['../../../src/lib/pages/core.scss', './photo-editor.page.scss'],\n imports: [CommonModule, FormsModule, ...ionComponents],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/** Ionic modal page for cropping, rotating, filtering, and saving a photo. */\nexport class PhotoEditorPage implements OnDestroy, ViewDidEnter, ViewDidLeave {\n protected readonly modalCtrl = inject(ModalController);\n readonly #config = inject(PHOTO_EDITOR_CONFIG);\n\n readonly requireSquare = input<boolean, BooleanInput>(false, {\n transform: coerceBooleanProperty,\n });\n readonly labels = input<Partial<PhotoEditorLabels> | undefined>(undefined);\n readonly toolbarColorScheme = input.required<PhotoToolbarColorScheme>();\n readonly value = input.required<string>();\n\n protected readonly dictionary = computed<PhotoEditorLabels>(() => ({ ...dictionaryForEditor(), ...this.labels() }));\n private readonly editorRef = viewChild.required<ElementRef>('imageEditor');\n private readonly ionContent = viewChild.required(IonContent, { read: ElementRef });\n\n protected readonly filters = signal<PhotoFilter[]>([]);\n protected readonly footerMenu = signal<'filter' | 'menu' | 'crop' | 'brightness'>('menu');\n protected readonly currentCrop = signal<'cover' | '16/9' | '1' | 'auto'>('cover');\n protected readonly currentRotate = signal<number>(0);\n protected readonly photoCrop = signal<PhotoSize>({\n width: 0,\n height: 0,\n });\n protected readonly isCropped = signal<boolean>(false);\n private readonly adoptFilter = signal<PhotoFilter | undefined>(undefined);\n protected readonly filterPreset = computed(() => filterPreset(this.dictionary()));\n\n private readonly filterImageSize = 240;\n private editorInstance: PhotoImageEditor | undefined;\n private initializationGeneration = 0;\n\n private readonly footerMenuEffect = effect(() => {\n const menu = this.footerMenu();\n const editor = this.editorInstance;\n if (!editor) {\n return;\n }\n if (menu === 'filter') {\n void this.initializeFilterMenu();\n } else if (menu === 'crop') {\n editor.startDrawingMode('CROPPER');\n this.changeCrop(this.requireSquare() ? '1' : 'cover');\n }\n });\n\n private canvasContainer: HTMLElement | undefined;\n private readonly canvasContainerObserver = new MutationObserver(() => this.syncCanvasSize());\n\n constructor() {\n initializeEditorIcons();\n }\n\n ngOnDestroy() {\n this.initializationGeneration += 1;\n this.destroyEditor();\n }\n\n async ionViewDidEnter() {\n const generation = ++this.initializationGeneration;\n const editor = await this.#config.createImageEditor(this.editorRef().nativeElement, {\n cssMaxWidth: this.ionContent().nativeElement.clientWidth - 32,\n cssMaxHeight: this.ionContent().nativeElement.clientHeight - 32,\n });\n if (generation !== this.initializationGeneration) {\n editor.destroy();\n return;\n }\n this.editorInstance = editor;\n return this.initializeEditor(editor, generation).catch((error: unknown) => {\n if (this.editorInstance === editor) {\n this.destroyEditor();\n }\n throw error;\n });\n }\n\n private async initializeEditor(editor: PhotoImageEditor, generation: number): Promise<void> {\n const response = await fetch(this.value());\n if (!this.isCurrentEditor(editor, generation)) {\n return;\n }\n if (!response.ok) {\n throw new Error(`Unable to load photo: ${response.status}`);\n }\n const blob = await response.blob();\n if (!this.isCurrentEditor(editor, generation)) {\n return;\n }\n await editor.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n if (!this.isCurrentEditor(editor, generation)) {\n return;\n }\n const editorElement = this.editorRef().nativeElement as HTMLElement;\n this.canvasContainer = editorElement.querySelector<HTMLElement>('.tui-image-editor-canvas-container') ?? undefined;\n if (this.canvasContainer) {\n this.syncCanvasSize();\n this.canvasContainerObserver.observe(this.canvasContainer, {\n attributes: true,\n childList: false,\n subtree: true,\n });\n }\n this.footerMenu.set(this.requireSquare() ? 'crop' : 'menu');\n }\n\n ionViewDidLeave() {\n this.initializationGeneration += 1;\n this.destroyEditor();\n }\n\n changeCrop(crop: 'cover' | '16/9' | '1' | 'auto') {\n const rect = crop === 'cover' ? this.photoCrop().width / this.photoCrop().height : crop === '16/9' ? 16 / 9 : 1;\n this.editorInstance?.setCropzoneRect(crop !== 'auto' ? rect : undefined);\n this.currentCrop.set(crop);\n }\n\n async rotate() {\n const editor = this.requireEditor();\n editor.stopDrawingMode();\n await editor.rotate(90);\n this.currentRotate.update((value) => value + 90);\n editor.startDrawingMode('CROPPER');\n requestAnimationFrame(() => this.changeCrop(this.currentCrop()));\n }\n\n async closeCrop(type: 'cancel' | 'apply') {\n const editor = this.requireEditor();\n if (this.footerMenu() === 'crop') {\n if (type === 'cancel') {\n await editor.rotate(this.currentRotate() * -1);\n } else {\n await editor.crop(editor.getCropzoneRect());\n this.isCropped.set(true);\n }\n this.currentRotate.set(0);\n this.currentCrop.set('cover');\n editor.stopDrawingMode();\n } else if (this.footerMenu() === 'brightness') {\n if (type === 'cancel' && editor.hasFilter('brightness')) {\n await editor.removeFilter('brightness');\n }\n }\n this.footerMenu.set('menu');\n }\n\n async changeRange(event: RangeCustomEvent) {\n const editor = this.requireEditor();\n if (editor.hasFilter('brightness')) {\n await editor.removeFilter('brightness');\n }\n await editor.applyFilter('brightness', {\n brightness: Number(event.detail.value) / 255,\n });\n }\n\n imageSave() {\n const value = this.requireEditor().toDataURL();\n void this.modalCtrl.dismiss({ action: 'save', value } satisfies PhotoEditorResult);\n }\n\n private async initializeFilterMenu() {\n const editor = this.requireEditor();\n const filters: PhotoFilter[] = [];\n\n const defaultInstance = await this.#config.createImageEditor(document.createElement('div'), {\n cssMaxWidth: this.filterImageSize,\n cssMaxHeight: (this.photoCrop().height * this.filterImageSize) / this.photoCrop().width,\n });\n const blob = await fetch(\n editor.toDataURL({\n multiplier: this.filterImageSize / this.photoCrop().width,\n }),\n ).then((res) => res.blob());\n await defaultInstance.loadImageFromFile(new File([blob], 'defaultInstance.png', { type: blob.type }));\n\n for (const filter of this.filterPreset()) {\n if (filter.type !== 'Default') {\n await defaultInstance.applyFilter(filter.type, filter.option ?? undefined);\n }\n filters.push({\n name: filter.name,\n type: filter.type,\n option: filter.option,\n data: defaultInstance.toDataURL(),\n width: this.filterImageSize,\n height: (this.photoCrop().height * this.filterImageSize) / this.photoCrop().width,\n });\n if (filter.type !== 'Default') {\n await defaultInstance.removeFilter(filter.type);\n }\n }\n this.filters.set(filters);\n defaultInstance.destroy();\n }\n\n async filterImage(filter: PhotoFilter) {\n const editor = this.requireEditor();\n if (this.adoptFilter()) {\n await editor.removeFilter(this.adoptFilter()!.type);\n }\n if (filter.type === 'Default') {\n this.adoptFilter.set(undefined);\n return;\n }\n await editor.applyFilter(filter.type, filter.option ?? undefined);\n this.adoptFilter.set(filter);\n }\n\n private requireEditor(): PhotoImageEditor {\n if (!this.editorInstance) {\n throw new Error('Photo editor is not initialized.');\n }\n return this.editorInstance;\n }\n\n private destroyEditor(): void {\n this.canvasContainerObserver.disconnect();\n this.canvasContainer = undefined;\n this.editorInstance?.destroy();\n this.editorInstance = undefined;\n }\n\n private isCurrentEditor(editor: PhotoImageEditor, generation: number): boolean {\n return generation === this.initializationGeneration && editor === this.editorInstance;\n }\n\n private syncCanvasSize(): void {\n const container = this.canvasContainer;\n const canvas = container?.querySelector<HTMLCanvasElement>('canvas');\n if (!container || !canvas) {\n return;\n }\n const bounds = container.parentElement ?? container;\n const editor = this.editorRef().nativeElement;\n editor.style.minWidth = bounds.style.maxWidth;\n editor.style.minHeight = bounds.style.maxHeight;\n this.photoCrop.set({ width: canvas.width, height: canvas.height });\n }\n}\n","<ion-header\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"solid\"\n type=\"submit\"\n [disabled]=\"!['menu', 'filter'].includes(footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary().save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button type=\"button\" (click)=\"footerMenu.set('crop')\">\n <ion-text>{{ dictionary().crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('filter')\">\n <ion-text>{{ dictionary().filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button type=\"button\" (click)=\"footerMenu.set('brightness')\">\n <ion-text>{{ dictionary().brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n } @if (this.footerMenu() === 'filter') {\n <aside>\n @for (item of filters(); track item) {\n <button type=\"button\" (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n } @if (this.footerMenu() === 'crop' && !requireSquare()) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button\n [attr.aria-label]=\"dictionary().cropCover\"\n (click)=\"changeCrop('cover')\"\n [color]=\"currentCrop() === 'cover' ? 'success' : undefined\"\n >\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().crop16x9\"\n (click)=\"changeCrop('16/9')\"\n [color]=\"currentCrop() === '16/9' ? 'success' : undefined\"\n >\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropSquare\"\n (click)=\"changeCrop('1')\"\n [color]=\"currentCrop() === '1' ? 'success' : undefined\"\n >\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n [attr.aria-label]=\"dictionary().cropFree\"\n (click)=\"changeCrop('auto')\"\n [color]=\"currentCrop() === 'auto' ? 'success' : undefined\"\n >\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button [attr.aria-label]=\"dictionary().rotate\" (click)=\"rotate()\"\n ><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n </ion-buttons>\n } @if (['brightness'].includes(this.footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range\n [attr.aria-label]=\"dictionary().brightness\"\n [pin]=\"true\"\n [min]=\"-100\"\n [max]=\"100\"\n (ionChange)=\"changeRange($any($event))\"\n ></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.footerMenu.set('menu')\">{{ dictionary().back }}</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare() || isCropped()) {\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"closeCrop('cancel')\"\n ><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon\n ></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if (footerMenu() === 'crop') { {{ dictionary().crop }} } @else if (footerMenu() === 'brightness') { {{ dictionary().brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button [attr.aria-label]=\"dictionary().apply\" (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n","/** Photo editing modal entry point. */\nexport * from './lib/photo-editor.page';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAEO,MAAM,YAAY,GAAG,CAAC,UAA6B,KAA0B;AAClF,IAAA,EAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;AAC5D,IAAA,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;AACvD,IAAA,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;AAC3D,IAAA,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;AAC9D,IAAA,EAAE,IAAI,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;CAChE;;ACNM,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;;ACavH,MAAM,mBAAmB,GAAG,OAA0B;AAC3D,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,UAAU,EA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CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,aAAa,wFACxB,UAAU,CAAA,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElDnF;;ACAA;;AAEG;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Loads the Capacitor Camera implementation in a bundler-resolvable lazy chunk. */
|
|
2
|
+
const loadCapacitorPhotoCamera = async () => {
|
|
3
|
+
const { Camera, CameraResultType, CameraSource } = await import('@capacitor/camera');
|
|
4
|
+
return {
|
|
5
|
+
getPhoto: async (options) => {
|
|
6
|
+
const image = await Camera.getPhoto({
|
|
7
|
+
quality: options.quality,
|
|
8
|
+
width: options.width,
|
|
9
|
+
allowEditing: false,
|
|
10
|
+
resultType: CameraResultType.DataUrl,
|
|
11
|
+
source: CameraSource.Camera,
|
|
12
|
+
presentationStyle: 'popover',
|
|
13
|
+
});
|
|
14
|
+
return { dataUrl: image.dataUrl, webPath: image.webPath };
|
|
15
|
+
},
|
|
16
|
+
pickImages: (options) => Camera.pickImages({
|
|
17
|
+
quality: options.quality,
|
|
18
|
+
width: options.width,
|
|
19
|
+
limit: options.limit,
|
|
20
|
+
presentationStyle: 'popover',
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generated bundle index. Do not edit.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export { loadCapacitorPhotoCamera };
|
|
30
|
+
//# sourceMappingURL=rdlabo-ionic-angular-photo-editor-file-capacitor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdlabo-ionic-angular-photo-editor-file-capacitor.mjs","sources":["../../../projects/photo-editor/file/capacitor/src/public-api.ts","../../../projects/photo-editor/file/capacitor/src/rdlabo-ionic-angular-photo-editor-file-capacitor.ts"],"sourcesContent":["import { PhotoCameraLoader } from '@rdlabo/ionic-angular-photo-editor';\n\n/** Loads the Capacitor Camera implementation in a bundler-resolvable lazy chunk. */\nexport const loadCapacitorPhotoCamera: PhotoCameraLoader = async () => {\n const { Camera, CameraResultType, CameraSource } = await import('@capacitor/camera');\n return {\n getPhoto: async (options) => {\n const image = await Camera.getPhoto({\n quality: options.quality,\n width: options.width,\n allowEditing: false,\n resultType: CameraResultType.DataUrl,\n source: CameraSource.Camera,\n presentationStyle: 'popover',\n });\n return { dataUrl: image.dataUrl, webPath: image.webPath };\n },\n pickImages: (options) =>\n Camera.pickImages({\n quality: options.quality,\n width: options.width,\n limit: options.limit,\n presentationStyle: 'popover',\n }),\n };\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;AACO,MAAM,wBAAwB,GAAsB,YAAW;AACpE,IAAA,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,MAAM,OAAO,mBAAmB,CAAC;IACpF,OAAO;AACL,QAAA,QAAQ,EAAE,OAAO,OAAO,KAAI;AAC1B,YAAA,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;gBAClC,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,KAAK,EAAE,OAAO,CAAC,KAAK;AACpB,gBAAA,YAAY,EAAE,KAAK;gBACnB,UAAU,EAAE,gBAAgB,CAAC,OAAO;gBACpC,MAAM,EAAE,YAAY,CAAC,MAAM;AAC3B,gBAAA,iBAAiB,EAAE,SAAS;AAC7B,aAAA,CAAC;AACF,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;QAC3D,CAAC;QACD,UAAU,EAAE,CAAC,OAAO,KAClB,MAAM,CAAC,UAAU,CAAC;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;AACpB,YAAA,iBAAiB,EAAE,SAAS;SAC7B,CAAC;KACL;AACH;;ACzBA;;AAEG;;;;"}
|