Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 729ae4d

Browse files
feat: clean more grammarly attributes (#1528)
Signed-off-by: peterpeterparker <[email protected]>
1 parent db12f6b commit 729ae4d

File tree

10 files changed

+119
-45
lines changed

10 files changed

+119
-45
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Providers: New
66

77
- offline: v0.0.6 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/providers/offline/CHANGELOG.md))
8-
- sync: v0.0.21 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/providers/offline/CHANGELOG.md))
8+
- sync: v0.0.22 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/providers/offline/CHANGELOG.md))
99

1010
### Providers
1111

@@ -30,7 +30,7 @@
3030
### Others
3131

3232
- deck-utils: v7.0.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/utils/deck/CHANGELOG.md))
33-
- editor: v7.9.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/utils/editor/CHANGELOG.md))
33+
- editor: v7.9.1 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/utils/editor/CHANGELOG.md))
3434
- styles: v1.4.2 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/utils/styles/CHANGELOG.md))
3535

3636
<a name="6.0.0"></a>

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/sync/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.0.22 (2022-04-14)
2+
3+
### Features
4+
5+
- clean more grammarly attributes
6+
17
# 0.0.20 - 0.0.21 (2022-04-03)
28

39
### Features

providers/sync/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deckdeckgo/sync",
3-
"version": "0.0.21",
3+
"version": "0.0.22",
44
"author": "David Dal Busco",
55
"description": "Sync data and auth providers for DeckDeckGo editors.",
66
"license": "AGPL-3.0-or-later",
@@ -24,7 +24,7 @@
2424
"README.md"
2525
],
2626
"dependencies": {
27-
"@deckdeckgo/editor": "^7.9.0",
27+
"@deckdeckgo/editor": "^7.9.1",
2828
"@deckdeckgo/offline": "^0.0.6",
2929
"nanoid": "^3.3.1"
3030
},

providers/sync/src/types/jszip.d.ts

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ interface JSZipSupport {
1515

1616
type Compression = 'STORE' | 'DEFLATE';
1717

18+
/**
19+
* Depends on the compression type. With `STORE` (no compression), these options are ignored. With
20+
* `DEFLATE`, you can give the compression level between 1 (best speed) and 9 (best compression).
21+
*/
22+
interface CompressionOptions {
23+
level: number;
24+
}
25+
1826
interface Metadata {
1927
percent: number;
2028
currentFile: string;
@@ -56,7 +64,7 @@ interface OutputByType {
5664
// compressedContent: string|ArrayBuffer|Uint8Array|Buffer;
5765
// }
5866

59-
type InputFileFormat = InputByType[keyof InputByType];
67+
type InputFileFormat = InputByType[keyof InputByType] | Promise<InputByType[keyof InputByType]>;
6068

6169
declare namespace JSZip {
6270
type InputType = keyof InputByType;
@@ -101,7 +109,14 @@ declare namespace JSZip {
101109
* The last modification date, defaults to the current date.
102110
*/
103111
date?: Date;
104-
compression?: string;
112+
/**
113+
* Sets per file compression. The `compressionOptions` parameter depends on the compression type.
114+
*/
115+
compression?: Compression;
116+
/**
117+
* Sets per file compression level for `DEFLATE` compression.
118+
*/
119+
compressionOptions?: null | CompressionOptions;
105120
comment?: string;
106121
/** Set to `true` if (and only if) the input is a "binary string" and has already been prepared with a `0xFF` mask. */
107122
optimizedBinaryString?: boolean;
@@ -124,10 +139,14 @@ declare namespace JSZip {
124139
}
125140

126141
interface JSZipGeneratorOptions<T extends OutputType = OutputType> {
142+
/**
143+
* Sets compression option for all entries that have not specified their own `compression` option
144+
*/
127145
compression?: Compression;
128-
compressionOptions?: null | {
129-
level: number;
130-
};
146+
/**
147+
* Sets compression level for `DEFLATE` compression.
148+
*/
149+
compressionOptions?: null | CompressionOptions;
131150
type?: T;
132151
comment?: string;
133152
/**
@@ -150,6 +169,46 @@ declare namespace JSZip {
150169
createFolders?: boolean;
151170
decodeFileName?: (bytes: string[] | Uint8Array | Buffer) => string;
152171
}
172+
173+
interface JSZipMetadata {
174+
percent: number;
175+
currentFile: string;
176+
}
177+
178+
type DataEventCallback<T> = (dataChunk: T, metadata: JSZipMetadata) => void
179+
type EndEventCallback = () => void
180+
type ErrorEventCallback = (error: Error) => void
181+
182+
interface JSZipStreamHelper<T> {
183+
/**
184+
* Register a listener on an event
185+
*/
186+
on(event: 'data', callback: DataEventCallback<T>): this;
187+
on(event: 'end', callback: EndEventCallback): this;
188+
on(event: 'error', callback: ErrorEventCallback): this;
189+
190+
/**
191+
* Read the whole stream and call a callback with the complete content
192+
*
193+
* @param updateCallback The function called every time the stream updates
194+
* @return A Promise of the full content
195+
*/
196+
accumulate(updateCallback?: (metadata: JSZipMetadata) => void): Promise<T>;
197+
198+
/**
199+
* Resume the stream if the stream is paused. Once resumed, the stream starts sending data events again
200+
*
201+
* @return The current StreamHelper object, for chaining
202+
*/
203+
resume(): this;
204+
205+
/**
206+
* Pause the stream if the stream is running. Once paused, the stream stops sending data events
207+
*
208+
* @return The current StreamHelper object, for chaining
209+
*/
210+
pause(): this;
211+
}
153212
}
154213

155214
interface JSZip {
@@ -239,6 +298,14 @@ interface JSZip {
239298
*/
240299
generateNodeStream(options?: JSZip.JSZipGeneratorOptions<'nodebuffer'>, onUpdate?: OnUpdateCallback): NodeJS.ReadableStream;
241300

301+
/**
302+
* Generates the complete zip file with the internal stream implementation
303+
*
304+
* @param options Optional options for the generator
305+
* @return a StreamHelper
306+
*/
307+
generateInternalStream<T extends JSZip.OutputType>(options?: JSZip.JSZipGeneratorOptions<T>): JSZip.JSZipStreamHelper<OutputByType[T]>;
308+
242309
/**
243310
* Deserialize zip file asynchronously
244311
*
@@ -251,15 +318,7 @@ interface JSZip {
251318
/**
252319
* Create JSZip instance
253320
*/
254-
255-
/**
256-
* Create JSZip instance
257-
* If no parameters given an empty zip archive will be created
258-
*
259-
* @param data Serialized zip archive
260-
* @param options Description of the serialized zip archive
261-
*/
262-
new (data?: InputFileFormat, options?: JSZip.JSZipLoadOptions): this;
321+
new(): this;
263322

264323
(): JSZip;
265324

studio/package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

studio/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@deckdeckgo/core": "^10.0.1",
2828
"@deckdeckgo/deck-utils": "^7.0.0",
2929
"@deckdeckgo/drag-resize-rotate": "^2.2.1",
30-
"@deckdeckgo/editor": "^7.8.1",
30+
"@deckdeckgo/editor": "^7.9.1",
3131
"@deckdeckgo/elements": "^1.0.0",
3232
"@deckdeckgo/highlight-code": "^4.1.0",
3333
"@deckdeckgo/laser-pointer": "^1.1.0",
@@ -52,7 +52,7 @@
5252
"@deckdeckgo/social-img": "^1.1.0",
5353
"@deckdeckgo/studio": "^0.0.15",
5454
"@deckdeckgo/styles": "^1.4.2",
55-
"@deckdeckgo/sync": "^0.0.21",
55+
"@deckdeckgo/sync": "^0.0.22",
5656
"@deckdeckgo/utils": "^5.1.0",
5757
"@deckdeckgo/word-cloud": "^1.2.0",
5858
"@ionic/core": "^5.9.1",

utils/editor/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 7.9.1 (2022-04-14)
2+
3+
### Features
4+
5+
- clean some more grammarly attributes
6+
17
# 7.9.0 (2022-04-02)
28

39
### Features

utils/editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deckdeckgo/editor",
3-
"version": "7.9.0",
3+
"version": "7.9.1",
44
"author": "David Dal Busco",
55
"description": "Types for the DeckDeckGo editor",
66
"license": "AGPL-3.0-or-later",

utils/editor/src/utils/node.utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export const dirtyAttributes: string[] = [
88
'custom-loader',
99
'class',
1010
'placeholder',
11-
'data-gramm'
11+
'data-gramm',
12+
'data-gramm_id',
13+
'data-gramm_editor',
14+
'data-gr-id'
1215
];
1316

1417
export const cleanNode = ({node, deep = true}: {node: Node; deep?: boolean}): Node | null => {

0 commit comments

Comments
 (0)