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

Commit 53c528f

Browse files
merge: code
2 parents 0ce5ad3 + 920ab98 commit 53c528f

File tree

40 files changed

+1210
-496
lines changed

40 files changed

+1210
-496
lines changed

docs/docs/components/app-components-highlight-code/app-components-highlight-code.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ To highlight your code, this component is using [Prism.js](https://prismjs.com)
1818
- [Find the next anchor](#app-components-highlight-code-find-the-next-anchor)
1919
- [Zoom into code](#app-components-highlight-code-zoom-into-code)
2020
- [Load or reload the component](#app-components-highlight-code-load-or-reload-the-component)
21+
- [Events](#app-components-highlight-code-events)
2122
- [Examples](#app-components-highlight-code-examples)
2223

2324
## Showcase
@@ -70,7 +71,8 @@ The `<deckgo-highlight-code/>` expose the following properties:
7071
| `anchorZoom` | `anchor-zoom` | The anchor identifier which will be use to find the next anchor to zoom inside your code using `findNextAnchor()` | `string` | `'// DeckDeckGoZoom'` |
7172
| `hideAnchor` | `hide-anchor` | Set this attribute to `false` in case you would like to actually display the anchor value too | `boolean` | `true` |
7273
| `language` | `language` | Define the language to be used for the syntax highlighting. The list of [supported languages](https://prismjs.com/#languages-list) is defined by [Prism.js](https://prismjs.com/#languages-list) | `string` | `'javascript'` |
73-
| `highlightLines` | `highlight-lines` | If you wish to highlight some lines of your code. The lines number should be provided as number separated with coma and group separated with space. For example: "3,5 8,9 13,13 14,17" | `string` | |
74+
| `highlightLines` | `highlight-lines` | If you wish to highlight some lines of your code. The lines number should be provided as number separated with coma and group separated with space. For example: "3,5 8,9 13,13 14,17" | `string` | |
75+
| `editable` | `editable` | In case you would like to set the code component as being editable. | `boolean` | `false` |
7476

7577
### Styling
7678

@@ -100,6 +102,8 @@ The `<deckgo-highlight-code/>` could be styled using the following CSS4 variable
100102
| --deckgo-highlight-code-token-atrule | | Highlighted code tokens atrule, attr-value, keyword |
101103
| --deckgo-highlight-code-token-function | | Highlighted code function, class-name |
102104
| --deckgo-highlight-code-token-regex | | Highlighted code tokens regex, important, variable |
105+
| --deckgo-highlight-code-empty-text | "Click to add your code" | Place holder in case the `editable` is set to `true` |
106+
| --deckgo-highlight-code-scroll | scroll | In case you would like to change the scroll property of the shadowed code block |
103107

104108
### Methods
105109

@@ -123,6 +127,18 @@ zoomCode(zoom: boolean) => Promise<void>
123127
load() => Promise<void>
124128
```
125129

130+
### Events
131+
132+
The `<deckgo-highlight-code/>` will bubble the following events:
133+
134+
#### Code did change
135+
136+
Emitted when the code was edited (see attribute `editable`). Propagate the root component itself.
137+
138+
```
139+
codeDidChange(HTMLElement);
140+
```
141+
126142
### Examples
127143

128144
You could find the examples in the [src/index.html](https://github.com/deckgo/deckdeckgo-qrcode/blob/master/src/index.html) of the project.

docs/docs/components/app-components-inline-editor/app-components-inline-editor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The `<deckgo-inline-editor/>` expose the following properties:
6565
| `stickyDesktop` | `sticky-desktop` | Use a sticky footer toolbar on desktop | `boolean` | `false` |
6666
| `stickyMobile` | `sticky-mobile` | Use a sticky footer toolbar on mobile. Note: except iOS, feel free to send a PR if you know how to handle this with the software keyboard | `boolean` | `false` |
6767
| `attachTo` | `attach-to` | Could be use to attach the inline editor event listeners (mousedown, touchstart and keydown) to a specific element instead of the document | `HTMLElement` | |
68-
| `containerAttribute` | `container-attribute` | The container where the inline editor should be use need to be identified with an attribute in order to allow the component to detect some information like the current style or color | `string` | `slot` |
68+
| `containers` | `containers` | A comma separated list of containers where the inline editor should/could be use. Used in order to allow the component to detect some information like the current style or color | `string` | `h1,h2,h3,h4,h5,h6,div` |
6969

7070
### Styling
7171

docs/src/app/pages/docs/components/app-components-highlight-code/app-components-highlight-code.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class AppComponentsHighlightCode {
4949
<li><a href="#app-components-highlight-code-load-or-reload-the-component">Load or reload the component</a></li>
5050
</ul>
5151
</li>
52+
<li><a href="#app-components-highlight-code-events">Events</a></li>
5253
<li><a href="#app-components-highlight-code-examples">Examples</a></li>
5354
</ul>
5455
</li>
@@ -126,6 +127,13 @@ export class AppComponentsHighlightCode {
126127
<td><code>string</code></td>
127128
<td></td>
128129
</tr>
130+
<tr>
131+
<td><code>editable</code></td>
132+
<td><code>editable</code></td>
133+
<td>In case you would like to set the code component as being editable.</td>
134+
<td><code>boolean</code></td>
135+
<td><code>false</code></td>
136+
</tr>
129137
</tbody></table>
130138
<h3 id="app-components-highlight-code-styling">Styling</h3>
131139
<p>The <code>&lt;deckgo-highlight-code/&gt;</code> could be styled using the following CSS4 variables:</p>
@@ -247,6 +255,16 @@ export class AppComponentsHighlightCode {
247255
<td></td>
248256
<td>Highlighted code tokens regex, important, variable</td>
249257
</tr>
258+
<tr>
259+
<td>--deckgo-highlight-code-empty-text</td>
260+
<td>&quot;Click to add your code&quot;</td>
261+
<td>Place holder in case the <code>editable</code> is set to <code>true</code></td>
262+
</tr>
263+
<tr>
264+
<td>--deckgo-highlight-code-scroll</td>
265+
<td>scroll</td>
266+
<td>In case you would like to change the scroll property of the shadowed code block</td>
267+
</tr>
250268
</tbody></table>
251269
<h3 id="app-components-highlight-code-methods">Methods</h3>
252270
<p>The <code>&lt;deckgo-highlight-code/&gt;</code> expose the following methods:</p>
@@ -259,6 +277,12 @@ export class AppComponentsHighlightCode {
259277
</deckgo-highlight-code><h4 id="app-components-highlight-code-load-or-reload-the-component">Load or reload the component</h4>
260278
<deckgo-highlight-code language="javascript">
261279
<code slot="code">load() =&gt; Promise&lt;void&gt;</code>
280+
</deckgo-highlight-code><h3 id="app-components-highlight-code-events">Events</h3>
281+
<p>The <code>&lt;deckgo-highlight-code/&gt;</code> will bubble the following events:</p>
282+
<h4 id="app-components-highlight-code-code-did-change">Code did change</h4>
283+
<p>Emitted when the code was edited (see attribute <code>editable</code>). Propagate the root component itself.</p>
284+
<deckgo-highlight-code language="javascript">
285+
<code slot="code">codeDidChange(HTMLElement);</code>
262286
</deckgo-highlight-code><h3 id="app-components-highlight-code-examples">Examples</h3>
263287
<p>You could find the examples in the <a href="https://github.com/deckgo/deckdeckgo-qrcode/blob/master/src/index.html">src/index.html</a> of the project.</p>
264288
<deckgo-highlight-code language="javascript">

docs/src/app/pages/docs/components/app-components-inline-editor/app-components-inline-editor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ export class AppComponentsInlineEditor {
112112
<td></td>
113113
</tr>
114114
<tr>
115-
<td><code>containerAttribute</code></td>
116-
<td><code>container-attribute</code></td>
117-
<td>The container where the inline editor should be use need to be identified with an attribute in order to allow the component to detect some information like the current style or color</td>
115+
<td><code>containers</code></td>
116+
<td><code>containers</code></td>
117+
<td>A comma separated list of containers where the inline editor should/could be use. Used in order to allow the component to detect some information like the current style or color</td>
118118
<td><code>string</code></td>
119-
<td><code>slot</code></td>
119+
<td><code>h1,h2,h3,h4,h5,h6,div</code></td>
120120
</tr>
121121
</tbody></table>
122122
<h3 id="app-components-inline-editor-styling">Styling</h3>

studio/docs/api.md

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)