-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new components: Cards, Audio and Video, and update new texts for …
…Input
- Loading branch information
Showing
12 changed files
with
352 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"$id": "https://altinncdn.no/schemas/json/component/Audio.schema.v1.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"properties": { | ||
"id": { | ||
"title": "ID", | ||
"description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with <dash><number>.", | ||
"type": "string", | ||
"pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" | ||
}, | ||
"hidden": { | ||
"title": "Hidden", | ||
"description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", | ||
"default": false, | ||
"$ref": "expression.schema.v1.json#/definitions/boolean" | ||
}, | ||
"grid": { | ||
"properties": { | ||
"xs": { "$ref": "#/definitions/IGridSize" }, | ||
"sm": { "$ref": "#/definitions/IGridSize" }, | ||
"md": { "$ref": "#/definitions/IGridSize" }, | ||
"lg": { "$ref": "#/definitions/IGridSize" }, | ||
"xl": { "$ref": "#/definitions/IGridSize" }, | ||
"labelGrid": { "$ref": "#/definitions/IGridStyling" }, | ||
"innerGrid": { "$ref": "#/definitions/IGridStyling" } | ||
} | ||
}, | ||
"pageBreak": { | ||
"title": "Page break", | ||
"description": "Optionally insert page-break before/after component when rendered in PDF", | ||
"type": "object", | ||
"properties": { | ||
"breakBefore": { | ||
"title": "Page break before", | ||
"description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", | ||
"examples": ["auto", "always", "avoid"], | ||
"default": "auto", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
}, | ||
"breakAfter": { | ||
"title": "Page break after", | ||
"description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", | ||
"examples": ["auto", "always", "avoid"], | ||
"default": "auto", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"type": { "const": "Audio" }, | ||
"textResourceBindings": { | ||
"type": "object", | ||
"properties": { | ||
"altText": { | ||
"title": "Alt text", | ||
"description": "Alternative text for the audio (for screen readers).", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"audio": { | ||
"title": "IAudio", | ||
"type": "object", | ||
"properties": { "src": { "$ref": "#/definitions/AudioSrc" } }, | ||
"required": ["src"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["id", "type"], | ||
"title": "Audio component schema" | ||
} |
136 changes: 136 additions & 0 deletions
136
frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
"$id": "https://altinncdn.no/schemas/json/component/Cards.schema.v1.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"properties": { | ||
"id": { | ||
"title": "ID", | ||
"description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with <dash><number>.", | ||
"type": "string", | ||
"pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" | ||
}, | ||
"hidden": { | ||
"title": "Hidden", | ||
"description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", | ||
"default": false, | ||
"$ref": "expression.schema.v1.json#/definitions/boolean" | ||
}, | ||
"grid": { | ||
"properties": { | ||
"xs": { "$ref": "#/definitions/IGridSize" }, | ||
"sm": { "$ref": "#/definitions/IGridSize" }, | ||
"md": { "$ref": "#/definitions/IGridSize" }, | ||
"lg": { "$ref": "#/definitions/IGridSize" }, | ||
"xl": { "$ref": "#/definitions/IGridSize" }, | ||
"labelGrid": { "$ref": "#/definitions/IGridStyling" }, | ||
"innerGrid": { "$ref": "#/definitions/IGridStyling" } | ||
} | ||
}, | ||
"pageBreak": { | ||
"title": "Page break", | ||
"description": "Optionally insert page-break before/after component when rendered in PDF", | ||
"type": "object", | ||
"properties": { | ||
"breakBefore": { | ||
"title": "Page break before", | ||
"description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", | ||
"examples": ["auto", "always", "avoid"], | ||
"default": "auto", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
}, | ||
"breakAfter": { | ||
"title": "Page break after", | ||
"description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", | ||
"examples": ["auto", "always", "avoid"], | ||
"default": "auto", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"renderAsSummary": { | ||
"title": "Render as summary", | ||
"description": "Boolean value or expression indicating if the component should be rendered as a summary. Defaults to false.", | ||
"default": false, | ||
"$ref": "expression.schema.v1.json#/definitions/boolean" | ||
}, | ||
"type": { "const": "Cards" }, | ||
"textResourceBindings": { | ||
"title": "TRBSummarizable", | ||
"type": "object", | ||
"properties": { | ||
"summaryTitle": { | ||
"title": "Summary title", | ||
"description": "Title used in the summary view (overrides the default title)", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
}, | ||
"summaryAccessibleTitle": { | ||
"title": "Accessible summary title", | ||
"description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", | ||
"$ref": "expression.schema.v1.json#/definitions/string" | ||
} | ||
} | ||
}, | ||
"mediaPosition": { | ||
"title": "ImagePosition", | ||
"description": "Position of the media (image/video/audio) in each card", | ||
"default": "top", | ||
"enum": ["top", "bottom"], | ||
"type": "string" | ||
}, | ||
"minMediaHeight": { | ||
"title": "minMediaHeight", | ||
"description": "Fixed minimum height of media (if media is present)", | ||
"examples": ["100px", "100%", "100rem"], | ||
"default": "150px", | ||
"type": "string" | ||
}, | ||
"minWidth": { | ||
"title": "minWidth", | ||
"description": "Fixed minimum width of the card", | ||
"examples": ["100", "100px", "100%", "100rem"], | ||
"default": "250px", | ||
"type": "string", | ||
"pattern": "^[0-9]+(px|rem|%)?$" | ||
}, | ||
"color": { | ||
"title": "Card color", | ||
"description": "The color style for these cards", | ||
"enum": ["neutral", "subtle"], | ||
"type": "string" | ||
}, | ||
"cards": { | ||
"type": "array", | ||
"items": { | ||
"title": "CardConfigExternal", | ||
"type": "object", | ||
"properties": { | ||
"media": { | ||
"title": "Media", | ||
"description": "Media to display on the top/bottom of the card (must reference an Image, Audio or Video component", | ||
"type": "string" | ||
}, | ||
"title": { "title": "Title", "description": "Title of the card", "type": "string" }, | ||
"description": { | ||
"title": "Description/body text", | ||
"description": "Full text displayed underneath the title, above any component children", | ||
"type": "string" | ||
}, | ||
"footer": { | ||
"title": "Footer", | ||
"description": "Footer text of the card", | ||
"type": "string" | ||
}, | ||
"children": { | ||
"title": "Children", | ||
"description": "Child component IDs to show inside the card", | ||
"type": "array", | ||
"items": { "type": "string" } | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": ["id", "type", "color", "cards"], | ||
"title": "Cards component schema" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.