0.3.46 • Published 9 months ago

@gyldendal/kobber-scene v0.3.46

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Kobber scene

Components for rendering scene objects from Gyldendal's CMS.

See Scene.stories.tsx for examples.

Can be imported as web components or react components:

@gyldendal/kobber-scene/web-components @gyldendal/kobber-scene/react

CMS data

Enums that match data from CMS are defined in types.ts

Calculate padding

Pass CMS-data and other variables through the calculatePadding-function and pass it to kobber-scene-boundary to apply css paddings.

import { calculatePadding } from '@gyldendal/kobber-scene/web-components';

const padding = calculatePadding({
  cmsWhiteSpace: sceneFromCms.sceneWhitespace,
  cmsHorizontalAlignment: sceneFromCms.sceneHorizontalAlignments
});
<kobber-scene>
  <kobber-scene-boundary padding=${JSON.stringify(padding)}>
    ...
  </kobber-scene-boundary>
</kobber-scene>

Optional presentation logic

The following rules are applied to thousands of scenes in Skolestudio:

  • The sections sc-feature-header and sc-card-carousel are displayed in full width
  • sc-feature-header affects the wrapping row's bottom padding
  • Dynamic contents are displayed in full width and full height if there is no other content in the scene
  • Dynamic contents are displayed in full width if there is no other content in the row

To apply the same rules, pass scene.rows through groupRowsByPresentation and render each rowGroup as in Skolestudio.

0.3.46

9 months ago

0.3.45

10 months ago

0.3.31

11 months ago

0.3.30

11 months ago

0.3.39

11 months ago

0.3.17

1 year ago

0.3.38

11 months ago

0.3.16

1 year ago

0.3.37

11 months ago

0.3.15

1 year ago

0.3.36

11 months ago

0.3.14

1 year ago

0.3.35

11 months ago

0.3.13

1 year ago

0.3.34

11 months ago

0.3.33

11 months ago

0.3.32

11 months ago

0.3.29

12 months ago

0.3.42

10 months ago

0.3.20

1 year ago

0.3.41

10 months ago

0.3.40

10 months ago

0.3.28

12 months ago

0.3.27

12 months ago

0.3.26

12 months ago

0.3.25

12 months ago

0.3.24

12 months ago

0.3.23

12 months ago

0.3.44

10 months ago

0.3.22

12 months ago

0.3.43

10 months ago

0.3.21

12 months ago

0.3.19

1 year ago

0.3.18

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago