@silexlabs/silex 3.0.0-alpha.53 → 3.0.0-alpha.56
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/dist/client/client/assetUrl.d.ts +35 -0
- package/dist/client/client/utils.d.ts +2 -1
- package/dist/client/js/main.js +78 -78
- package/dist/client/types.d.ts +18 -16
- package/dist/plugins/client/client/assetUrl.d.ts +35 -0
- package/dist/plugins/client/client/assetUrl.js +208 -0
- package/dist/plugins/client/client/assetUrl.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/PublicationManager.js +18 -12
- package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -1
- package/dist/plugins/client/client/grapesjs/index.js +1 -1
- package/dist/plugins/client/client/grapesjs/index.js.map +1 -1
- package/dist/plugins/client/client/grapesjs/storage.js +7 -5
- package/dist/plugins/client/client/grapesjs/storage.js.map +1 -1
- package/dist/plugins/client/client/publication-transformers.js +4 -4
- package/dist/plugins/client/client/publication-transformers.js.map +1 -1
- package/dist/plugins/client/client/utils.d.ts +2 -1
- package/dist/plugins/client/client/utils.js.map +1 -1
- package/dist/plugins/client/plugins/client/11ty.js +0 -5
- package/dist/plugins/client/plugins/client/11ty.js.map +1 -1
- package/dist/plugins/client/types.d.ts +18 -16
- package/dist/plugins/client/types.js +11 -0
- package/dist/plugins/client/types.js.map +1 -1
- package/dist/plugins/server/types.d.ts +18 -16
- package/dist/plugins/server/types.js +11 -0
- package/dist/plugins/server/types.js.map +1 -1
- package/dist/server/server/api/publicationApi.js +1 -1
- package/package.json +1 -1
- package/src/ts/client/assetUrl.ts +220 -0
- package/src/ts/client/grapesjs/PublicationManager.ts +25 -19
- package/src/ts/client/grapesjs/index.ts +1 -1
- package/src/ts/client/grapesjs/storage.ts +9 -7
- package/src/ts/client/index.ts +4 -0
- package/src/ts/client/publication-transformers.test.ts +1 -1
- package/src/ts/client/publication-transformers.ts +4 -4
- package/src/ts/client/utils.ts +3 -1
- package/src/ts/plugins/client/11ty.ts +0 -6
- package/src/ts/server/api/publicationApi.ts +1 -1
- package/src/ts/server/connectors/FsStorage.ts +1 -0
- package/src/ts/types.ts +34 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"11ty.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/client/11ty.ts"],"names":[],"mappings":"AAmBA,eAAe,CAAC,MAAoB,EAAE,IAA4B,EAAE,EAAE;IACpE,MAAM,OAAO,GAAG;QACd,GAAG,IAAI;QACP,IAAI,EAAE;YACJ,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,IAAI;YACV,GAAG,IAAI,CAAC,IAAI;SACb;QACD,GAAG,EAAE;YACH,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,OAAO;YACb,GAAG,IAAI,CAAC,GAAG;SACZ;QACD,MAAM,EAAE;YACN,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,IAAI;YACV,GAAG,IAAI,CAAC,MAAM;SACf;KACF,CAAA;IAED,MAAM,CAAC,0BAA0B,CAAC;QAChC,uCAAuC;QACvC,mBAAmB;QACnB,gBAAgB;QAChB,kFAAkF;QAClF,oCAAoC;QACpC,eAAe;QACf,kHAAkH;QAClH,oEAAoE;QACpE,iBAAiB;QACjB,oFAAoF;QACpF,sCAAsC;QACtC,KAAK;QACL,gDAAgD;QAChD,IAAI;QACJ,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;YAC5B,QAAQ,IAAI,EAAE;gBACd,KAAK,MAAM;oBACT,OAAO,
|
|
1
|
+
{"version":3,"file":"11ty.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/client/11ty.ts"],"names":[],"mappings":"AAmBA,eAAe,CAAC,MAAoB,EAAE,IAA4B,EAAE,EAAE;IACpE,MAAM,OAAO,GAAG;QACd,GAAG,IAAI;QACP,IAAI,EAAE;YACJ,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,IAAI;YACV,GAAG,IAAI,CAAC,IAAI;SACb;QACD,GAAG,EAAE;YACH,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,OAAO;YACb,GAAG,IAAI,CAAC,GAAG;SACZ;QACD,MAAM,EAAE;YACN,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,IAAI;YACV,GAAG,IAAI,CAAC,MAAM;SACf;KACF,CAAA;IAED,MAAM,CAAC,0BAA0B,CAAC;QAChC,uCAAuC;QACvC,mBAAmB;QACnB,gBAAgB;QAChB,kFAAkF;QAClF,oCAAoC;QACpC,eAAe;QACf,kHAAkH;QAClH,oEAAoE;QACpE,iBAAiB;QACjB,oFAAoF;QACpF,sCAAsC;QACtC,KAAK;QACL,gDAAgD;QAChD,IAAI;QACJ,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;YAC5B,QAAQ,IAAI,EAAE;gBACd,KAAK,MAAM;oBACT,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;gBACjC,KAAK,KAAK;oBACR,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI;wBACjC,sBAAsB;yBACrB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;wBACtB,mBAAmB;yBAClB,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;oBACnC,OAAO,GAAG,CAAA;gBACZ,KAAK,OAAO;oBACV,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI;wBAC/B,sBAAsB;yBACrB,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;aAC5B;YACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAA;QAC9C,CAAC;QACD,aAAa,EAAE,CAAC,IAAoB,EAAE,EAAE;YACtC,MAAM,eAAe,GAAG,IAAiC,CAAA;YACzD,QAAQ,IAAI,CAAC,IAAI,EAAE;gBACnB,KAAK,MAAM;oBACT,OAAO;wBACL,GAAG,IAAI;wBACP,iDAAiD;wBACjD,wGAAwG;qBACzG,CAAA;gBACH,KAAK,KAAK;oBACR,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI;wBAC/B,6DAA6D;yBAC5D,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;wBAChD,wDAAwD;yBACvD,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;oBACpC,OAAO;wBACL,GAAG,IAAI;wBACP,iFAAiF;wBACjF,OAAO,EAAE,mBAAmB,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,UAAU,eAAe,CAAC,OAAO,EAAE;qBACtF,CAAA;gBACH,KAAK,OAAO;oBACV,OAAO;wBACL,GAAG,IAAI;wBACP,mDAAmD;qBACpD,CAAA;aACF;YACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACnD,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -134,8 +134,25 @@ export type ApiConnectorUserQuery = {
|
|
|
134
134
|
};
|
|
135
135
|
export type ApiConnectorUserResponse = ConnectorUser;
|
|
136
136
|
export declare const defaultWebsiteData: WebsiteData;
|
|
137
|
+
export interface Component {
|
|
138
|
+
type: string;
|
|
139
|
+
content?: string;
|
|
140
|
+
attributes: {
|
|
141
|
+
[key: string]: string;
|
|
142
|
+
};
|
|
143
|
+
components: Component[];
|
|
144
|
+
}
|
|
145
|
+
export interface Page {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
slug: string;
|
|
149
|
+
settings: WebsiteSettings;
|
|
150
|
+
frames: {
|
|
151
|
+
component: Component;
|
|
152
|
+
}[];
|
|
153
|
+
}
|
|
137
154
|
export interface WebsiteData {
|
|
138
|
-
pages:
|
|
155
|
+
pages: Page[];
|
|
139
156
|
assets: Asset[];
|
|
140
157
|
styles: Style[];
|
|
141
158
|
settings: WebsiteSettings;
|
|
@@ -161,21 +178,6 @@ export interface Font {
|
|
|
161
178
|
value: string;
|
|
162
179
|
variants: string[];
|
|
163
180
|
}
|
|
164
|
-
export interface Frame {
|
|
165
|
-
component: {
|
|
166
|
-
type: string;
|
|
167
|
-
stylable: string[];
|
|
168
|
-
};
|
|
169
|
-
components: Component[];
|
|
170
|
-
}
|
|
171
|
-
export interface Component {
|
|
172
|
-
type: string;
|
|
173
|
-
content?: string;
|
|
174
|
-
attributes: {
|
|
175
|
-
[key: string]: string;
|
|
176
|
-
};
|
|
177
|
-
conponents: Component[];
|
|
178
|
-
}
|
|
179
181
|
export declare enum Unit {
|
|
180
182
|
PX = "px"
|
|
181
183
|
}
|
|
@@ -33,6 +33,17 @@ export const defaultWebsiteData = {
|
|
|
33
33
|
//symbols: [],
|
|
34
34
|
//publication: {},
|
|
35
35
|
};
|
|
36
|
+
//export interface Frame {
|
|
37
|
+
// component: { type: string, stylable: string[] },
|
|
38
|
+
// components: Component[],
|
|
39
|
+
//}
|
|
40
|
+
//
|
|
41
|
+
//export interface Component {
|
|
42
|
+
// type: string,
|
|
43
|
+
// content?: string,
|
|
44
|
+
// attributes: { [key: string]: string },
|
|
45
|
+
// conponents: Component[],
|
|
46
|
+
//}
|
|
36
47
|
export var Unit;
|
|
37
48
|
(function (Unit) {
|
|
38
49
|
Unit["PX"] = "px";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AA+CD,KAAK;AACL,cAAc;AACd,MAAM,CAAC,MAAM,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AA+CD,KAAK;AACL,cAAc;AACd,MAAM,CAAC,MAAM,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;AAuDhB,0BAA0B;AAC1B,oDAAoD;AACpD,4BAA4B;AAC5B,GAAG;AACH,EAAE;AACF,8BAA8B;AAC9B,iBAAiB;AACjB,qBAAqB;AACrB,0CAA0C;AAC1C,4BAA4B;AAC5B,GAAG;AAEH,MAAM,CAAN,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,iBAAS,CAAA;AACX,CAAC,EAFW,IAAI,KAAJ,IAAI,QAEf;AAkCD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;AACb,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AA+CD;;GAEG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAuDD;;GAEG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB"}
|
|
@@ -134,8 +134,25 @@ export type ApiConnectorUserQuery = {
|
|
|
134
134
|
};
|
|
135
135
|
export type ApiConnectorUserResponse = ConnectorUser;
|
|
136
136
|
export declare const defaultWebsiteData: WebsiteData;
|
|
137
|
+
export interface Component {
|
|
138
|
+
type: string;
|
|
139
|
+
content?: string;
|
|
140
|
+
attributes: {
|
|
141
|
+
[key: string]: string;
|
|
142
|
+
};
|
|
143
|
+
components: Component[];
|
|
144
|
+
}
|
|
145
|
+
export interface Page {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
slug: string;
|
|
149
|
+
settings: WebsiteSettings;
|
|
150
|
+
frames: {
|
|
151
|
+
component: Component;
|
|
152
|
+
}[];
|
|
153
|
+
}
|
|
137
154
|
export interface WebsiteData {
|
|
138
|
-
pages:
|
|
155
|
+
pages: Page[];
|
|
139
156
|
assets: Asset[];
|
|
140
157
|
styles: Style[];
|
|
141
158
|
settings: WebsiteSettings;
|
|
@@ -161,21 +178,6 @@ export interface Font {
|
|
|
161
178
|
value: string;
|
|
162
179
|
variants: string[];
|
|
163
180
|
}
|
|
164
|
-
export interface Frame {
|
|
165
|
-
component: {
|
|
166
|
-
type: string;
|
|
167
|
-
stylable: string[];
|
|
168
|
-
};
|
|
169
|
-
components: Component[];
|
|
170
|
-
}
|
|
171
|
-
export interface Component {
|
|
172
|
-
type: string;
|
|
173
|
-
content?: string;
|
|
174
|
-
attributes: {
|
|
175
|
-
[key: string]: string;
|
|
176
|
-
};
|
|
177
|
-
conponents: Component[];
|
|
178
|
-
}
|
|
179
181
|
export declare enum Unit {
|
|
180
182
|
PX = "px"
|
|
181
183
|
}
|
|
@@ -37,6 +37,17 @@ exports.defaultWebsiteData = {
|
|
|
37
37
|
//symbols: [],
|
|
38
38
|
//publication: {},
|
|
39
39
|
};
|
|
40
|
+
//export interface Frame {
|
|
41
|
+
// component: { type: string, stylable: string[] },
|
|
42
|
+
// components: Component[],
|
|
43
|
+
//}
|
|
44
|
+
//
|
|
45
|
+
//export interface Component {
|
|
46
|
+
// type: string,
|
|
47
|
+
// content?: string,
|
|
48
|
+
// attributes: { [key: string]: string },
|
|
49
|
+
// conponents: Component[],
|
|
50
|
+
//}
|
|
40
51
|
var Unit;
|
|
41
52
|
(function (Unit) {
|
|
42
53
|
Unit["PX"] = "px";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAmBH,MAAa,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AALD,4BAKC;AA+CD,KAAK;AACL,cAAc;AACD,QAAA,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAmBH,MAAa,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AALD,4BAKC;AA+CD,KAAK;AACL,cAAc;AACD,QAAA,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;AAuDhB,0BAA0B;AAC1B,oDAAoD;AACpD,4BAA4B;AAC5B,GAAG;AACH,EAAE;AACF,8BAA8B;AAC9B,iBAAiB;AACjB,qBAAqB;AACrB,0CAA0C;AAC1C,4BAA4B;AAC5B,GAAG;AAEH,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,iBAAS,CAAA;AACX,CAAC,EAFW,IAAI,oBAAJ,IAAI,QAEf;AAkCD,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;AACb,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AA+CD;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAuDD;;GAEG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACjB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
@@ -74,7 +74,7 @@ function default_1(config) {
|
|
|
74
74
|
const hostingConnector = await getHostingConnector(session, config, hostingId);
|
|
75
75
|
const storage = await getStorageConnector(session, config, storageId);
|
|
76
76
|
const filesList = await Promise.all(files.map(async (file) => {
|
|
77
|
-
const prefix = constants_1.API_WEBSITE_ASSET_READ
|
|
77
|
+
const prefix = constants_1.API_WEBSITE_ASSET_READ;
|
|
78
78
|
const fileWithContent = file;
|
|
79
79
|
const fileWithSrc = file;
|
|
80
80
|
if (!fileWithContent.content && !fileWithSrc.src)
|
package/package.json
CHANGED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { API_PATH, API_WEBSITE_ASSET_READ, API_WEBSITE_PATH } from '../constants'
|
|
2
|
+
import { Asset, ClientSideFileType, Component, ConnectorId, Page, Style, WebsiteId } from '../types'
|
|
3
|
+
import { Editor, Page as GrapesPage, CssRule, ObjectStrings } from 'grapesjs'
|
|
4
|
+
import { onAll } from './utils'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Helpers to manage assets URL
|
|
8
|
+
* Assets URLs are stored on storage in their "stored version": `/assets/image.webp`
|
|
9
|
+
* But the client side uses the "display version": `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
|
|
10
|
+
* After loading the site data we convert all URLs to the client side version
|
|
11
|
+
* Before saving the site data we convert all URLs to the storage version
|
|
12
|
+
* During publicationn we convert all URLs to the storage version and back
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// Orging and path
|
|
16
|
+
const SERVER_URL = `${window.location.origin}${window.location.pathname}`
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Function to convert a path from it stored version to the displayed version
|
|
20
|
+
* Stored version is like `/assets/image.webp`
|
|
21
|
+
* Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
|
|
22
|
+
*/
|
|
23
|
+
function storedToDisplayed(path: string, websiteId: WebsiteId, storageId: ConnectorId): string {
|
|
24
|
+
// Check the path is a stored path
|
|
25
|
+
if (path.startsWith('/assets')) {
|
|
26
|
+
const url = new URL(path, SERVER_URL)
|
|
27
|
+
url.pathname = url.pathname.replace(/^\/assets/, '')
|
|
28
|
+
url.pathname = `${API_PATH}${API_WEBSITE_PATH}${API_WEBSITE_ASSET_READ}${url.pathname}`
|
|
29
|
+
url.searchParams.set('websiteId', websiteId)
|
|
30
|
+
url.searchParams.set('connectorId', storageId)
|
|
31
|
+
const result = '/' + url.toString().replace(new RegExp(`^${SERVER_URL}`), '')
|
|
32
|
+
return result
|
|
33
|
+
} else {
|
|
34
|
+
console.error('storedToDisplayed: path is not a stored path', path)
|
|
35
|
+
return path
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Function to convert a path from the one we give to grapesjs to the stored version
|
|
41
|
+
* Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
|
|
42
|
+
* Stored version is like `/assets/image.webp`
|
|
43
|
+
* @param path the path to convert
|
|
44
|
+
* @returns the converted path
|
|
45
|
+
*/
|
|
46
|
+
function displayedToStored(path: string): string {
|
|
47
|
+
// Check the path is a displayed path
|
|
48
|
+
if (path.startsWith(`${API_PATH}${API_WEBSITE_PATH}${API_WEBSITE_ASSET_READ}`)) {
|
|
49
|
+
const url = new URL(path, SERVER_URL)
|
|
50
|
+
url.pathname = url.pathname.replace(new RegExp(`^${API_PATH}${API_WEBSITE_PATH}${API_WEBSITE_ASSET_READ}`), '')
|
|
51
|
+
url.pathname = `/assets${url.pathname}`
|
|
52
|
+
url.searchParams.delete('websiteId')
|
|
53
|
+
url.searchParams.delete('connectorId')
|
|
54
|
+
const result = '/' + url.toString().replace(new RegExp(`^${SERVER_URL}`), '')
|
|
55
|
+
return result
|
|
56
|
+
} else {
|
|
57
|
+
console.error('displayedToStored: path is not a displayed path', path)
|
|
58
|
+
return path
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Publication transformer to convert the asset URL during publication
|
|
64
|
+
*/
|
|
65
|
+
export const assetsPublicationTransformer = {
|
|
66
|
+
transformPath(path: string, type: ClientSideFileType): string {
|
|
67
|
+
if(type === ClientSideFileType.ASSET) {
|
|
68
|
+
const result = displayedToStored(path)
|
|
69
|
+
return result
|
|
70
|
+
}
|
|
71
|
+
return undefined
|
|
72
|
+
},
|
|
73
|
+
transformPermalink(path: string, type: ClientSideFileType): string {
|
|
74
|
+
if(type === ClientSideFileType.ASSET) {
|
|
75
|
+
const result = displayedToStored(path)
|
|
76
|
+
return result
|
|
77
|
+
}
|
|
78
|
+
return undefined
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update asset URL to use the current storage connector and website ID
|
|
84
|
+
* Assets URLs are stored in the project data in the form `/assets/image.webp`
|
|
85
|
+
* This function adds the API path and the connectorId and websiteId like so: `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
|
|
86
|
+
*/
|
|
87
|
+
export function addTempDataToAssetUrl(assets: Asset[], websiteId: WebsiteId, storageId: ConnectorId): Asset[] {
|
|
88
|
+
return assets.map((asset: Asset) => {
|
|
89
|
+
return {
|
|
90
|
+
...asset,
|
|
91
|
+
src: storedToDisplayed(asset.src, websiteId, storageId),
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Remove the temporary data from the asset URL
|
|
98
|
+
* Remove the API path and the connectorId and websiteId like so: `/assets/image.webp`
|
|
99
|
+
*/
|
|
100
|
+
export function removeTempDataFromAssetUrl(assets: Asset[]): Asset[] {
|
|
101
|
+
return assets.map((asset: Asset) => {
|
|
102
|
+
// Return the asset with the new URL
|
|
103
|
+
return {
|
|
104
|
+
...asset,
|
|
105
|
+
src: displayedToStored(asset.src),
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Reucrsive function to update the asset URL in the components
|
|
112
|
+
*/
|
|
113
|
+
function addTempDataToComponents(component: Component, websiteId: WebsiteId, storageId: ConnectorId): Component {
|
|
114
|
+
// Update the asset URL in the component
|
|
115
|
+
const newComponent = {
|
|
116
|
+
...component,
|
|
117
|
+
attributes: {
|
|
118
|
+
...component.attributes,
|
|
119
|
+
src: component.attributes?.src ? storedToDisplayed(component.attributes.src, websiteId, storageId) : undefined,
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
// Update the asset URL in the children
|
|
123
|
+
if (newComponent.components) {
|
|
124
|
+
newComponent.components = newComponent.components.map((childComponent: Component) => {
|
|
125
|
+
return addTempDataToComponents(childComponent, websiteId, storageId)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
return newComponent
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Reucrsive function to update the asset URL in the components
|
|
133
|
+
*/
|
|
134
|
+
function removeTempDataFromComponents(component: Component): Component {
|
|
135
|
+
// Update the asset URL in the component
|
|
136
|
+
const newComponent = {
|
|
137
|
+
...component,
|
|
138
|
+
attributes: {
|
|
139
|
+
...component.attributes,
|
|
140
|
+
src: component.attributes?.src ? displayedToStored(component.attributes.src) : undefined,
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
// Update the asset URL in the children
|
|
144
|
+
if (newComponent.components) {
|
|
145
|
+
newComponent.components = newComponent.components.map((childComponent: Component) => {
|
|
146
|
+
return removeTempDataFromComponents(childComponent)
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
return newComponent
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Add temp data to pages
|
|
154
|
+
*/
|
|
155
|
+
export function addTemDataToPages(pages: Page[], websiteId: WebsiteId, storageId: ConnectorId): Page[] {
|
|
156
|
+
return pages.map((page: Page) => {
|
|
157
|
+
return {
|
|
158
|
+
...page,
|
|
159
|
+
frames: page.frames.map(frame => ({
|
|
160
|
+
...frame,
|
|
161
|
+
component: addTempDataToComponents(frame.component, websiteId, storageId),
|
|
162
|
+
}))
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Remove temp data from asset URL in the components
|
|
169
|
+
*/
|
|
170
|
+
export function removeTempDataFromPages(pages: Page[]): Page[] {
|
|
171
|
+
return pages.map((page: Page) => {
|
|
172
|
+
return {
|
|
173
|
+
...page,
|
|
174
|
+
frames: page.frames.map(frame => ({
|
|
175
|
+
...frame,
|
|
176
|
+
component: removeTempDataFromComponents(frame.component),
|
|
177
|
+
}))
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Add data to stylesheets
|
|
184
|
+
*/
|
|
185
|
+
export function addTempDataToStyles(styles: Style[], websiteId: WebsiteId, storageId: ConnectorId): Style[] {
|
|
186
|
+
const pattern = /url\((["']?)([^"']+?)\1\)/g
|
|
187
|
+
return styles.map((style: Style) => {
|
|
188
|
+
if (style.style && style.style['background-image']) {
|
|
189
|
+
const urls = [...style.style['background-image'].matchAll(pattern)].map(match => storedToDisplayed(match[2], websiteId, storageId))
|
|
190
|
+
return {
|
|
191
|
+
...style,
|
|
192
|
+
style: {
|
|
193
|
+
...style.style,
|
|
194
|
+
'background-image': urls.map(url => `url('${url}')`).join(', '),
|
|
195
|
+
},
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return style
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Remove temp data from stylesheets
|
|
204
|
+
*/
|
|
205
|
+
export function removeTempDataFromStyles(styles: Style[]): Style[] {
|
|
206
|
+
const pattern = /url\((["']?)([^"']+?)\1\)/g
|
|
207
|
+
return styles.map((style: Style) => {
|
|
208
|
+
if (style.style && style.style['background-image']) {
|
|
209
|
+
const urls = [...style.style['background-image'].matchAll(pattern)].map(match => displayedToStored(match[2]))
|
|
210
|
+
return {
|
|
211
|
+
...style,
|
|
212
|
+
style: {
|
|
213
|
+
...style.style,
|
|
214
|
+
'background-image': urls.map(url => `url('${url}')`).join(', '),
|
|
215
|
+
},
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return style
|
|
219
|
+
})
|
|
220
|
+
}
|
|
@@ -23,6 +23,7 @@ import { getUser, logout, publicationStatus, publish } from '../api'
|
|
|
23
23
|
import { API_CONNECTOR_LOGIN, API_CONNECTOR_PATH, API_PATH } from '../../constants'
|
|
24
24
|
import { ClientEvent } from '../events'
|
|
25
25
|
import { resetRenderComponents, resetRenderCssRules, transformPermalink, transformFiles, transformPath, renderComponents } from '../publication-transformers'
|
|
26
|
+
import { removeTempDataFromAssetUrl, removeTempDataFromPages, removeTempDataFromStyles } from '../assetUrl'
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* @fileoverview Publication manager for Silex
|
|
@@ -205,6 +206,13 @@ export class PublicationManager {
|
|
|
205
206
|
this.dialog && this.dialog.displayPending(this.job, this.status)
|
|
206
207
|
this.editor.trigger(ClientEvent.PUBLISH_START)
|
|
207
208
|
this.setPublicationTransformers()
|
|
209
|
+
// User and where to publish
|
|
210
|
+
const storageUser = this.editor.getModel().get('user') as ConnectorUser
|
|
211
|
+
if(!storageUser) throw new Error('User not logged in to a storage connector')
|
|
212
|
+
if(!this.settings.connector?.connectorId) throw new Error('User not logged in to a hosting connector')
|
|
213
|
+
const websiteId = this.options.websiteId
|
|
214
|
+
const storageId = storageUser.storage.connectorId
|
|
215
|
+
// Data to publish
|
|
208
216
|
const projectData = this.editor.getProjectData() as WebsiteData
|
|
209
217
|
const siteSettings = this.editor.getModel().get('settings') as WebsiteSettings
|
|
210
218
|
// Build the files structure
|
|
@@ -218,18 +226,21 @@ export class PublicationManager {
|
|
|
218
226
|
content: file.css,
|
|
219
227
|
type: ClientSideFileType.CSS,
|
|
220
228
|
} as ClientSideFile]))
|
|
221
|
-
.concat(projectData.assets
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
.concat(projectData.assets
|
|
230
|
+
.map(asset => {
|
|
231
|
+
// Remove /assets that is added by grapesjs
|
|
232
|
+
const initialPath = asset.src
|
|
233
|
+
.replace(/^\/assets/, '')
|
|
234
|
+
// Transform the file paths with the transformers
|
|
235
|
+
const path = transformPath(this.editor, initialPath, ClientSideFileType.ASSET)
|
|
236
|
+
const src = transformPermalink(this.editor, initialPath, ClientSideFileType.ASSET)
|
|
237
|
+
return {
|
|
238
|
+
...asset,
|
|
239
|
+
path,
|
|
240
|
+
src,
|
|
241
|
+
type: ClientSideFileType.ASSET, // Replaces grapesjs's 'image' type
|
|
242
|
+
} as ClientSideFile
|
|
243
|
+
}))
|
|
233
244
|
// Create the data to send to the server
|
|
234
245
|
const data: PublicationData = {
|
|
235
246
|
...projectData,
|
|
@@ -237,17 +248,14 @@ export class PublicationManager {
|
|
|
237
248
|
publication: this.settings,
|
|
238
249
|
files,
|
|
239
250
|
}
|
|
251
|
+
this.resetPublicationTransformers()
|
|
240
252
|
transformFiles(this.editor, data)
|
|
241
253
|
this.editor.trigger(ClientEvent.PUBLISH_DATA, data)
|
|
242
|
-
const storageUser = this.editor.getModel().get('user') as ConnectorUser
|
|
243
|
-
if(!storageUser) throw new Error('User not logged in to a storage connector')
|
|
244
|
-
if(!this.settings.connector?.connectorId) throw new Error('User not logged in to a hosting connector')
|
|
245
254
|
try {
|
|
246
|
-
const websiteId = this.options.websiteId
|
|
247
255
|
const [url, job] = await publish({
|
|
248
256
|
websiteId,
|
|
249
257
|
hostingId: this.settings.connector.connectorId,
|
|
250
|
-
storageId
|
|
258
|
+
storageId,
|
|
251
259
|
data: data as ApiPublicationPublishBody,
|
|
252
260
|
options: this.settings.options,
|
|
253
261
|
})
|
|
@@ -322,7 +330,6 @@ export class PublicationManager {
|
|
|
322
330
|
} catch (e) {
|
|
323
331
|
this.status = PublicationStatus.STATUS_ERROR
|
|
324
332
|
this.dialog && this.dialog.displayError(`An error occured, your site is not published. ${e.message}`, this.job, this.status)
|
|
325
|
-
this.resetPublicationTransformers()
|
|
326
333
|
this.editor.trigger(ClientEvent.PUBLISH_END, { success: false, message: e.message })
|
|
327
334
|
this.editor.trigger(ClientEvent.PUBLISH_ERROR, { success: false, message: e.message })
|
|
328
335
|
return
|
|
@@ -330,7 +337,6 @@ export class PublicationManager {
|
|
|
330
337
|
if (this.job.status === JobStatus.IN_PROGRESS) {
|
|
331
338
|
setTimeout(() => this.trackProgress(), 2000)
|
|
332
339
|
} else {
|
|
333
|
-
this.resetPublicationTransformers()
|
|
334
340
|
this.editor.trigger(ClientEvent.PUBLISH_END, { success: this.job.status === JobStatus.SUCCESS, message: this.job.message })
|
|
335
341
|
}
|
|
336
342
|
this.dialog && this.dialog.displayPending(this.job, this.status)
|
|
@@ -210,7 +210,7 @@ export function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl
|
|
|
210
210
|
},
|
|
211
211
|
[internalLinksPlugin as any]: {
|
|
212
212
|
// FIXME: warn the user about links in error
|
|
213
|
-
onError: (errors) => console.
|
|
213
|
+
onError: (errors) => console.warn('Links errors:', errors),
|
|
214
214
|
},
|
|
215
215
|
[codePlugin as any]: {
|
|
216
216
|
blockLabel: 'HTML',
|
|
@@ -15,22 +15,21 @@
|
|
|
15
15
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { ConnectorId, WebsiteId, WebsiteData, ConnectorUser, ConnectorType, ApiError } from '../../types'
|
|
18
|
+
import { ConnectorId, WebsiteId, WebsiteData, ConnectorUser, ConnectorType, ApiError, Asset, Page, Component, Style } from '../../types'
|
|
19
19
|
import { websiteLoad, websiteSave } from '../api'
|
|
20
20
|
import { cmdLogin, eventLoggedIn, eventLoggedOut, getCurrentUser, updateUser } from './LoginDialog'
|
|
21
|
+
import { addTemDataToPages, addTempDataToAssetUrl, addTempDataToStyles, removeTempDataFromAssetUrl, removeTempDataFromPages, removeTempDataFromStyles } from '../assetUrl'
|
|
21
22
|
|
|
22
|
-
async function wait(ms: number) {
|
|
23
|
-
return new Promise((resolve) => {
|
|
24
|
-
setTimeout(resolve, ms)
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
23
|
export const storagePlugin = (editor) => {
|
|
28
24
|
editor.Storage.add('connector', {
|
|
29
25
|
async load(options: { id: WebsiteId, connectorId: ConnectorId }): Promise<WebsiteData> {
|
|
30
26
|
try {
|
|
31
27
|
const user: ConnectorUser = await getCurrentUser(editor) ?? await updateUser(editor, ConnectorType.STORAGE, options.connectorId)
|
|
32
28
|
if(user) {
|
|
33
|
-
const data = await websiteLoad({websiteId: options.id, connectorId: user.storage.connectorId})
|
|
29
|
+
const data = await websiteLoad({websiteId: options.id, connectorId: user.storage.connectorId}) as WebsiteData
|
|
30
|
+
data.assets = addTempDataToAssetUrl(data.assets, options.id, user.storage.connectorId)
|
|
31
|
+
data.pages = addTemDataToPages(data.pages, options.id, user.storage.connectorId)
|
|
32
|
+
data.styles = addTempDataToStyles(data.styles, options.id, user.storage.connectorId)
|
|
34
33
|
return data
|
|
35
34
|
} else {
|
|
36
35
|
return new Promise((resolve, reject) => {
|
|
@@ -59,6 +58,9 @@ export const storagePlugin = (editor) => {
|
|
|
59
58
|
try {
|
|
60
59
|
if(await getCurrentUser(editor)) {
|
|
61
60
|
const user = await getCurrentUser(editor)
|
|
61
|
+
data.assets = removeTempDataFromAssetUrl(data.assets)
|
|
62
|
+
data.pages = removeTempDataFromPages(data.pages)
|
|
63
|
+
data.styles = removeTempDataFromStyles(data.styles)
|
|
62
64
|
await websiteSave({websiteId: options.id, connectorId: user.storage.connectorId, data})
|
|
63
65
|
} else {
|
|
64
66
|
editor.once(eventLoggedIn, () => {
|
package/src/ts/client/index.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
import { assetsPublicationTransformer } from './assetUrl'
|
|
24
25
|
import { ClientConfig } from './config'
|
|
25
26
|
import { ClientEvent } from './events'
|
|
26
27
|
import { initEditor, getEditor } from './grapesjs/index'
|
|
@@ -35,6 +36,9 @@ export async function start(options = {}) {
|
|
|
35
36
|
const config = new ClientConfig()
|
|
36
37
|
Object.assign(config, options)
|
|
37
38
|
|
|
39
|
+
// Add the publication transformers which are used to cleanup assets URLs
|
|
40
|
+
config.addPublicationTransformers(assetsPublicationTransformer)
|
|
41
|
+
|
|
38
42
|
// Config file in root folder which may be generated by the server
|
|
39
43
|
await config.addPlugin(config.clientConfigUrl, {})
|
|
40
44
|
|
|
@@ -194,9 +194,9 @@ export function transformPermalink(editor: Editor, path: string, type: ClientSid
|
|
|
194
194
|
const config = editor.getModel().get('config')
|
|
195
195
|
return config.publicationTransformers.reduce((result: string, transformer: PublicationTransformer) => {
|
|
196
196
|
try {
|
|
197
|
-
return transformer.transformPermalink ? transformer.transformPermalink(
|
|
197
|
+
return transformer.transformPermalink ? transformer.transformPermalink(result, type) ?? result : result
|
|
198
198
|
} catch (e) {
|
|
199
|
-
console.error('Publication transformer: error transforming path',
|
|
199
|
+
console.error('Publication transformer: error transforming path', result, e)
|
|
200
200
|
return result
|
|
201
201
|
}
|
|
202
202
|
}, path)
|
|
@@ -206,9 +206,9 @@ export function transformPath(editor: Editor, path: string, type: ClientSideFile
|
|
|
206
206
|
const config = editor.getModel().get('config')
|
|
207
207
|
return config.publicationTransformers.reduce((result: string, transformer: PublicationTransformer) => {
|
|
208
208
|
try {
|
|
209
|
-
return transformer.transformPath ? transformer.transformPath(
|
|
209
|
+
return transformer.transformPath ? transformer.transformPath(result, type) ?? result : result
|
|
210
210
|
} catch (e) {
|
|
211
|
-
console.error('Publication transformer: error transforming path',
|
|
211
|
+
console.error('Publication transformer: error transforming path', result, e)
|
|
212
212
|
return result
|
|
213
213
|
}
|
|
214
214
|
}, path)
|
package/src/ts/client/utils.ts
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { Component, Editor } from 'grapesjs'
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
// Browse all elements of all pages
|
|
20
|
-
export function onAll(editor, cbk) {
|
|
22
|
+
export function onAll(editor: Editor, cbk: (c: Component) => void) {
|
|
21
23
|
editor.Pages.getAll()
|
|
22
24
|
.forEach(page => {
|
|
23
25
|
page.getMainComponent()
|
|
@@ -55,19 +55,15 @@ export default (config: ClientConfig, opts: Partial<PluginOptions>) => {
|
|
|
55
55
|
transformPath: (path, type) => {
|
|
56
56
|
switch (type) {
|
|
57
57
|
case 'html':
|
|
58
|
-
console.log('Silex: transform path for 11ty', path, options.html.path + path)
|
|
59
58
|
return options.html.path + path
|
|
60
59
|
case 'css':
|
|
61
|
-
console.log('Silex: transform path for 11ty', path, options.css.path + path.replace(/\.css$/, '.css.liquid'), path.replace(/^\/css/, ''))
|
|
62
60
|
const res = options.css.path + path
|
|
63
61
|
// Remove default path
|
|
64
62
|
.replace(/^\/css/, '')
|
|
65
63
|
// Change extension
|
|
66
64
|
.replace(/\.css$/, '.css.liquid')
|
|
67
|
-
console.log({res})
|
|
68
65
|
return res
|
|
69
66
|
case 'asset':
|
|
70
|
-
console.log('Silex: transform path for 11ty', path, options.assets.path + path)
|
|
71
67
|
return options.assets.path + path
|
|
72
68
|
// Remove default path
|
|
73
69
|
.replace(/^\/assets/, '')
|
|
@@ -75,8 +71,6 @@ export default (config: ClientConfig, opts: Partial<PluginOptions>) => {
|
|
|
75
71
|
throw new Error(`Unknown file type ${type}`)
|
|
76
72
|
},
|
|
77
73
|
transformFile: (file: ClientSideFile) => {
|
|
78
|
-
console.log('Silex: transform file for 11ty', file)
|
|
79
|
-
|
|
80
74
|
const fileWithContent = file as ClientSideFileWithContent
|
|
81
75
|
switch (file.type) {
|
|
82
76
|
case 'html':
|
|
@@ -124,7 +124,7 @@ export default function (config: ServerConfig): Router {
|
|
|
124
124
|
|
|
125
125
|
// Load the content if necessary
|
|
126
126
|
const filesList: ConnectorFile[] = await Promise.all(files.map(async (file: ClientSideFile) => {
|
|
127
|
-
const prefix = API_WEBSITE_ASSET_READ
|
|
127
|
+
const prefix = API_WEBSITE_ASSET_READ
|
|
128
128
|
const fileWithContent = file as ClientSideFileWithContent
|
|
129
129
|
const fileWithSrc = file as ClientSideFileWithSrc
|
|
130
130
|
if(!fileWithContent.content && !fileWithSrc.src) throw new PublicationError('Missing content or src in file', 400)
|