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

Commit 4b5d7d8

Browse files
merge: from master
2 parents 164b823 + db0049c commit 4b5d7d8

File tree

80 files changed

+2963
-1228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2963
-1228
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ David
4242
### Web Components
4343

4444
- core: v1.1.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/webcomponents/core/CHANGELOG.md))
45+
- drag-resize-rotate: v1.1.3 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/webcomponents/drag-resize-rotate/CHANGELOG.md))
4546
- highlight-code: v1.1.2 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/webcomponents/highlight-code/CHANGELOG.md))
47+
- inline-editor: v1.5.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/webcomponents/inline-editor/CHANGELOG.md))
4648
- social: v2.0.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/webcomponents/social/CHANGELOG.md))
4749

4850
### Others
4951

52+
- deck-utils: v2.3.3 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/utils/deck/CHANGELOG.md))
5053
- gatsby-remark-highlight-code: v1.4.4 ([CHANGELOG](https://github.com/deckgo/gatsby-remark-highlight-code/blob/master/CHANGELOG.md))
5154
- slide-utils: v2.1.2 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/utils/slide/CHANGELOG.md))
52-
- starter kit: v2.6.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo-starter/blob/master/CHANGELOG.md))
55+
- starter kit: v2.6.2 ([CHANGELOG](https://github.com/deckgo/deckdeckgo-starter/blob/master/CHANGELOG.md))
5356

5457
<a name="1.5.0"></a>
5558

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- group `notes` in a single page
66
- add new `header` and `footer`
7+
- property `text` of `@deckdeckgo/drag-resize-rotate`
78

89
# 1.6.2 (2020-07-02)
910

docs/docs/components/app-components-drr/app-components-drr.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ The default slot is mandatory.
8383

8484
This component offers the following options which could be set using attributes:
8585

86-
| Attribute | Type | Default | Description |
87-
| --------- | ----------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------- |
88-
| unit | 'percentage', 'viewport' or 'px' | 'percentage' | The component could be use with percentage, viewport (vw/vh) or pixels (px) units. All relative to the container. |
89-
| resize | boolean | true | Allow or not the resize actions |
90-
| drag | 'x-axis', 'y-axis', 'all' or 'none' | 'all' | Allow the component to be dragged in which direction |
91-
| rotation | boolean | true | Allow or not the rotation of the element |
86+
| Attribute | Type | Default | Description |
87+
| --------- | ----------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
88+
| unit | 'percentage', 'viewport' or 'px' | 'percentage' | The component could be use with percentage, viewport (vw/vh) or pixels (px) units. All relative to the container. |
89+
| resize | boolean | true | Allow or not the resize actions |
90+
| drag | 'x-axis', 'y-axis', 'all' or 'none' | 'all' | Allow the component to be dragged in which direction |
91+
| rotation | boolean | true | Allow or not the rotation of the element |
92+
| text | boolean | false | To be used if your slotted element is to be defined as `contentEditable`. Useful for text edition. Note that if turns to `true`, the property `resize` is going to be set to `false` automatically. |
9293

9394
### Event listeners
9495

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ The `<deckgo-inline-editor/>` expose the following properties:
9696
| `list` | `list` | Actions to manipulate the selection as list enabled? | `boolean` | `true` |
9797
| `align` | `align` | Actions to manipulate the selection alignment enabled? | `boolean` | `true` |
9898
| `fontSize` | `font-size` | Actions to modify the selection font-size enabled? | `boolean` | `true` |
99+
| `backgroundColor` | `background-color` | To hide the option to select a background-color | `boolean` | `true` |
99100

100101
### Custom actions slots
101102

docs/package-lock.json

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

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"@deckdeckgo/charts": "^1.0.2",
1818
"@deckdeckgo/color": "^2.0.0",
1919
"@deckdeckgo/core": "^1.1.0",
20-
"@deckdeckgo/deck-utils": "^2.3.1",
20+
"@deckdeckgo/deck-utils": "^2.3.3",
2121
"@deckdeckgo/demo": "^1.0.4",
22-
"@deckdeckgo/drag-resize-rotate": "^1.0.2",
22+
"@deckdeckgo/drag-resize-rotate": "^1.1.3",
2323
"@deckdeckgo/highlight-code": "^1.1.2",
24-
"@deckdeckgo/inline-editor": "^1.4.0",
24+
"@deckdeckgo/inline-editor": "^1.5.0",
2525
"@deckdeckgo/lazy-img": "^1.0.1",
2626
"@deckdeckgo/math": "^1.0.1",
2727
"@deckdeckgo/qrcode": "^1.0.1",

docs/src/app/pages/docs/components/app-components-drr/app-components-drr.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ export class AppComponentsDrr {
160160
<td>true</td>
161161
<td>Allow or not the rotation of the element</td>
162162
</tr>
163+
<tr>
164+
<td>text</td>
165+
<td>boolean</td>
166+
<td>false</td>
167+
<td>
168+
To be used if your slotted element is to be defined as <code>contentEditable</code>. Useful for text edition. Note that if turns to{' '}
169+
<code>true</code>, the property <code>resize</code> is going to be set to <code>false</code> automatically.
170+
</td>
171+
</tr>
163172
</tbody>
164173
</table>
165174
<h3 id="app-components-drr-event-listeners">Event listeners</h3>

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,21 @@ export class AppComponentsInlineEditor {
362362
<code>true</code>
363363
</td>
364364
</tr>
365+
<tr>
366+
<td>
367+
<code>backgroundColor</code>
368+
</td>
369+
<td>
370+
<code>background-color</code>
371+
</td>
372+
<td>To hide the option to select a background-color</td>
373+
<td>
374+
<code>boolean</code>
375+
</td>
376+
<td>
377+
<code>true</code>
378+
</td>
379+
</tr>
365380
</tbody>
366381
</table>
367382
<h3 id="app-components-inline-editor-custom-actions-slots">Custom actions slots</h3>

infra/handler/app/Test.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ testPresDeploys = withQueueName $ withEnv $ \env -> withSQS env $ withS3 env $ d
173173
, presentationOwner = someUserId
174174
, presentationAttributes = HMS.empty
175175
, presentationBackground = Nothing
176+
, presentationHeader = Nothing
177+
, presentationFooter = Nothing
176178
, presentationDescription = ""
177179
, presentationHeadExtra = Nothing
178180
}

infra/handler/src/DeckGo/Handler.hs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ newtype PresentationBackground = PresentationBackground { unPresentationBackgrou
244244
deriving stock (Show, Eq)
245245
deriving newtype (Aeson.FromJSON, Aeson.ToJSON)
246246

247+
newtype PresentationHeader = PresentationHeader { unPresentationHeader :: T.Text }
248+
deriving stock (Show, Eq)
249+
deriving newtype (Aeson.FromJSON, Aeson.ToJSON)
250+
251+
newtype PresentationFooter = PresentationFooter { unPresentationFooter :: T.Text }
252+
deriving stock (Show, Eq)
253+
deriving newtype (Aeson.FromJSON, Aeson.ToJSON)
254+
247255
-- SLIDES
248256

249257
instance ToSchema Slide where
@@ -312,6 +320,8 @@ data PresentationInfo = PresentationInfo
312320
{ presentationName :: PresentationName
313321
, presentationOwner :: UserId
314322
, presentationBackground :: Maybe PresentationBackground
323+
, presentationHeader :: Maybe PresentationHeader
324+
, presentationFooter :: Maybe PresentationFooter
315325
, presentationAttributes :: HMS.HashMap T.Text T.Text
316326
, presentationSlides :: [Slide]
317327
, presentationDescription :: T.Text
@@ -331,6 +341,8 @@ instance FromJSONObject PresentationInfo where
331341
obj .: "name" <*>
332342
obj .: "owner_id" <*>
333343
obj .:? "background" <*>
344+
obj .:? "header" <*>
345+
obj .:? "footer" <*>
334346
obj .:? "attributes" .!= HMS.empty <*>
335347
obj .: "slides" <*>
336348
obj .: "description" <*>
@@ -1325,11 +1337,17 @@ type Tag = TagSoup.Tag T.Text
13251337
processTags :: PresentationInfo -> [Tag] -> [Tag]
13261338
processTags presentationInfo = concatMap $ \case
13271339
TagSoup.TagOpen str (HMS.fromList -> attrs)
1340+
-- If the tag is 'deckgo-deck', we add the slides and the "background",
1341+
-- "header" and "footer" divs
13281342
| str == "deckgo-deck" -> do
13291343
[ TagSoup.TagOpen str (HMS.toList (presentationAttributes presentationInfo <> attrs)) ] <>
13301344
(concatMap slideTags (presentationSlides presentationInfo)) <>
13311345
(maybe [] presentationBackgroundTags
1332-
(presentationBackground presentationInfo))
1346+
(presentationBackground presentationInfo)) <>
1347+
(maybe [] presentationHeaderTags
1348+
(presentationHeader presentationInfo)) <>
1349+
(maybe [] presentationFooterTags
1350+
(presentationFooter presentationInfo))
13331351
t -> [t]
13341352

13351353
presentationBackgroundTags :: PresentationBackground -> [Tag]
@@ -1339,6 +1357,20 @@ presentationBackgroundTags (unPresentationBackground -> bg) =
13391357
[ TagSoup.TagClose "div"
13401358
]
13411359

1360+
presentationHeaderTags :: PresentationHeader -> [Tag]
1361+
presentationHeaderTags (unPresentationHeader -> bg) =
1362+
[ TagSoup.TagOpen "div" (HMS.toList $ HMS.singleton "slot" "header")
1363+
] <> TagSoup.parseTags bg <>
1364+
[ TagSoup.TagClose "div"
1365+
]
1366+
1367+
presentationFooterTags :: PresentationFooter -> [Tag]
1368+
presentationFooterTags (unPresentationFooter -> bg) =
1369+
[ TagSoup.TagOpen "div" (HMS.toList $ HMS.singleton "slot" "footer")
1370+
] <> TagSoup.parseTags bg <>
1371+
[ TagSoup.TagClose "div"
1372+
]
1373+
13421374
slideTags :: Slide -> [Tag]
13431375
slideTags slide =
13441376
[ TagSoup.TagOpen

0 commit comments

Comments
 (0)