Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(schema): improve titles, connect values & remove duplications #10

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
17061cc
refactor(schema): unify all 'nm' props with /helpers/name
Aidosmf Nov 24, 2021
97242be
refactor(schema): unify all 'mn' under /helpers/match-name
Aidosmf Nov 24, 2021
ecfe50e
refactor(schena): remove 'position' title duplicates
Aidosmf Nov 25, 2021
941fcfc
refactor(schena): make all 'width' titles unique
Aidosmf Nov 25, 2021
59995b2
refactor(schena): make 'height' titles unique
Aidosmf Nov 25, 2021
bc1c47b
refactor(schema): make all 'type' title unique
Aidosmf Nov 27, 2021
a508973
refactor(schema): improve Value title for each group
Aidosmf Nov 27, 2021
f923fab
refactor(schema): combine three-dimensional under helpers
Aidosmf Nov 30, 2021
3197116
refactor(schema): combine all fr under helpers/framerate
Aidosmf Nov 30, 2021
263a4c5
refactor(schema): make 'motion blur' title unique
Aidosmf Nov 30, 2021
367e1aa
refactor(schema/animated-properties): mv prop 'a' into /animated
Aidosmf Dec 1, 2021
040b4ad
refactor(schema): make unique InPoint titles
Aidosmf Dec 1, 2021
1bfbe66
refactor(schema): combine all 'ix' under /helpers/property-index
Aidosmf Dec 1, 2021
0840801
refactor(schema/constants): make 'normal' title unique
Aidosmf Dec 1, 2021
786f10d
refactor(schema): make 'opacity' title unique
Aidosmf Dec 1, 2021
0ebae73
refactor(schema/animated-properties): mv prop 'x' into /expression
Aidosmf Dec 1, 2021
de384fd
refactor(schema): make 'color' title unique
Aidosmf Dec 1, 2021
094ed33
refactor(schema): make 'lighten' title unique
Aidosmf Dec 1, 2021
86757d6
refactor(schema): make 'darken' title unique
Aidosmf Dec 1, 2021
55a8f7e
refactor(schema): make 'difference' title unique
Aidosmf Dec 1, 2021
bb704e6
refactor(schema): make 'blend-mode' titles unique
Aidosmf Dec 1, 2021
632f4e2
refactor(schema): make 'fill' titles unique
Aidosmf Dec 1, 2021
994ce29
refactor(schema): make 'path' titles unique
Aidosmf Dec 1, 2021
2d7bd52
refactor(schema): make 'group' titles unique
Aidosmf Dec 1, 2021
7ac5dce
refactor(schema): make 'pucker bloat' titles unique
Aidosmf Dec 1, 2021
ec3ca26
refactor(schema/shape-element): add 'const' prefix to titles
Aidosmf Dec 1, 2021
9a72368
refactor(schema): make 'transform' titles unique
Aidosmf Dec 1, 2021
cf5639b
refactor(schema): make 'shape' titles unique
Aidosmf Dec 1, 2021
6cca0f9
refactor(schema): make 'out point' titles unique
Aidosmf Dec 1, 2021
90b63a2
refactor(schema): make 'hidden' titles unique
Aidosmf Dec 1, 2021
b60ab29
refactor(schema): make 'index' titles unique
Aidosmf Dec 1, 2021
6c9aba0
refactor(schema): make 'size' titles unique
Aidosmf Dec 1, 2021
f301d32
refactor(schema): remove duplicate props from 'lj'
Aidosmf Dec 1, 2021
9956aad
refactor(schema): make 'scale' titles unique
Aidosmf Dec 1, 2021
0aba5a0
refactor(schena/text-shape): 'Text Shape' prefix for titles
Aidosmf Dec 1, 2021
db93b0e
refactor(schena/line-cap): 'line cap' prefix for titles
Aidosmf Dec 1, 2021
abf3680
refactor(schema): improve line-join titles and lj ref
Aidosmf Dec 1, 2021
50eb45e
refactor(schema/layer): add 'type' suffix to LayerType child titles
Aidosmf Dec 2, 2021
a066eb0
refactor(text-data-keyframe): improve titles
Aidosmf Dec 2, 2021
2fc78a8
refactor(helpers/marker): improve titles
Aidosmf Dec 2, 2021
19fd976
refactor(aniamted-properties/keyframe): improve titles
Aidosmf Dec 2, 2021
0b13a8b
refactor(schema): make 'start time' titles unique
Aidosmf Dec 2, 2021
86c6403
refactor(schema/text): improve titles for font, document & character
Aidosmf Dec 2, 2021
45bca87
refactor(schema): make 'shape' related titles unique
Aidosmf Dec 2, 2021
60b1e54
refactor(schema): improve 'mask' related props and titles names
Aidosmf Dec 2, 2021
bf67904
fix(animated-properties/position): 'property-index' duplication
Aidosmf Dec 2, 2021
a139a05
refactor(schema/shape-element): use proper prefix for Type props
Aidosmf Dec 2, 2021
97118c4
refactor(schema/text-justify): improve titles
Aidosmf Dec 2, 2021
4084bc3
refactor(schema/text-grouping): improve titles
Aidosmf Dec 2, 2021
049e266
refactor(schema/text-based): improve titles
Aidosmf Dec 2, 2021
eff8359
refactor(schema/text-path-origin): improve titles
Aidosmf Dec 2, 2021
c1127b1
refactor(schema/text-caps): improve titles
Aidosmf Dec 2, 2021
db8a706
refactor(schema/blend-mode): improve titles
Aidosmf Dec 2, 2021
174e8ea
refactor(schema/composite): improve titles
Aidosmf Dec 2, 2021
b02e671
refactor(schema/fill-rule): improve titles
Aidosmf Dec 2, 2021
7295c1f
refactor(schema/matte-mode): improve titles
Aidosmf Dec 2, 2021
905e6e9
refactor(schema/shape-direction): improve titles
Aidosmf Dec 2, 2021
e88947c
refactor(schema/trim-multiple-shapes): improve titles
Aidosmf Dec 2, 2021
9a5ebe4
refactor(schema/character-data): improve titles
Aidosmf Dec 2, 2021
2efbfc5
refactor(schema/text-layer): improve titles
Aidosmf Dec 2, 2021
0fe79b1
refactor(schema/text-animator-data): improve titles
Aidosmf Dec 2, 2021
afe2f2d
refactor(schema): make 'colors' titles unique
Aidosmf Dec 2, 2021
52ff01d
refactor(schema/text-more-options): improve titles
Aidosmf Dec 2, 2021
2228604
refactor(schema/animation): improve 'chars' title
Aidosmf Dec 2, 2021
b25381c
refactor(schema/audio-layer): improve titles
Aidosmf Dec 2, 2021
a6346da
refactor(schema): fix angle & custom titles
Aidosmf Dec 2, 2021
0730efb
refactor(schema/shape-element): improve titles
Aidosmf Dec 2, 2021
68843b8
refactor(schema/sound): improve titles
Aidosmf Dec 2, 2021
389fa2d
refactor(schema/audio-settings): improve titles
Aidosmf Dec 2, 2021
5d51e50
refactor(schema/layter): improve 'css class' title
Aidosmf Dec 2, 2021
062ec97
refactor(schema): connect all 'ty' const values
Aidosmf Dec 3, 2021
0d2b5ae
docs(controbuting): add a note about title prop
Aidosmf Dec 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -13,6 +13,10 @@ It can be merged into a single file using
If you need to make changes to the schema, edit the individual files then
run the merge script to get the final one.

Please use unique naming for `title` property because it's important for auto-generating-type tools.
For example, if you need to auto-convert JSON-Schema into Typescript (TS), the `title` naming will be
utilized for Interface and Type.

Some places in the documentation pull information from the unified schema file
so you will only see them if you merge the files.

Expand Down
24 changes: 7 additions & 17 deletions docs/schema/animated-properties/animated-property.json
Expand Up @@ -5,23 +5,13 @@
"description": "An animatable property that holds an array of numbers",
"allOf": [
{

"properties": {
"ix": {
"title": "Property Index",
"type": "integer"
},
"a": {
"title": "Animated",
"description": "Whether the property is animated",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
},
"x": {
"title": "Expression",
"type": "string"
}
}
"$ref": "#/$defs/animated-properties/animated"
},
{
"$ref": "#/$defs/helpers/property-index"
},
{
"$ref": "#/$defs/animated-properties/expression"
},
{
"if": {
Expand Down
13 changes: 13 additions & 0 deletions docs/schema/animated-properties/animated.json
@@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Animated",
"description": "Whether the property is animated",
"type": "object",
"properties": {
"a": {
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
}
},
"additionalProperties": false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't additionalProperties cause issues?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, to be safe and avoid unexpected problems let me remove them

}
11 changes: 11 additions & 0 deletions docs/schema/animated-properties/expression.json
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Expression",
"type": "object",
"properties": {
"x": {
"type": "string"
}
},
"additionalProperties": false
}
2 changes: 1 addition & 1 deletion docs/schema/animated-properties/gradient-colors.json
Expand Up @@ -6,7 +6,7 @@

"properties": {
"k": {
"title": "Colors",
"title": "Gradient Colors Multi Dimensional",
"$ref": "#/$defs/animated-properties/multi-dimensional"
},
"p": {
Expand Down
6 changes: 3 additions & 3 deletions docs/schema/animated-properties/keyframe.json
Expand Up @@ -7,17 +7,17 @@
{
"properties": {
"t": {
"title": "Time",
"title": "Keyframe Time",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree with these, it's describing the keyframe, so why repeat it in the title of the properties?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's a generic name I wanted to create a unique title.

"type": "number",
"default": 0
},
"h": {
"title": "Hold",
"title": "Keyframe Hold",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
},
"s": {
"title": "Value",
"title": "Keyframe Value",
"description": "Value at this keyframe. Note the if the property is a scalar, keyframe values are still represented as arrays",
"type": "array",
"items": {
Expand Down
20 changes: 4 additions & 16 deletions docs/schema/animated-properties/position.json
Expand Up @@ -5,22 +5,10 @@
"description": "An animatable property to represent a position in space",
"allOf": [
{
"properties": {
"ix": {
"title": "Property Index",
"type": "integer"
},
"a": {
"title": "Animated",
"description": "Whether the property is animated",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
},
"x": {
"title": "Expression",
"type": "string"
}
}
"$ref": "#/$defs/animated-properties/animated"
},
{
"$ref": "#/$defs/helpers/property-index"
},
{
"if": {
Expand Down
23 changes: 7 additions & 16 deletions docs/schema/animated-properties/shape-property.json
Expand Up @@ -5,22 +5,13 @@
"description": "An animatable property that holds a Bezier",
"allOf": [
{
"properties": {
"ix": {
"title": "Property Index",
"type": "integer"
},
"a": {
"title": "Animated",
"description": "Whether the property is animated",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
},
"x": {
"title": "Expression",
"type": "string"
}
}
"$ref": "#/$defs/animated-properties/animated"
},
{
"$ref": "#/$defs/helpers/property-index"
},
{
"$ref": "#/$defs/animated-properties/expression"
},
{
"if": {
Expand Down
2 changes: 1 addition & 1 deletion docs/schema/animated-properties/value.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Value",
"title": "Animated Property Value",
"description": "An animatable property that holds a float",
"allOf": [
{
Expand Down
30 changes: 11 additions & 19 deletions docs/schema/animation/animation.json
Expand Up @@ -7,6 +7,12 @@
{
"$ref": "#/$defs/helpers/visual-object"
},
{
"$ref": "#/$defs/helpers/three-dimensional"
},
{
"$ref": "#/$defs/helpers/framerate"
},
{
"type": "object",
"properties": {
Expand All @@ -15,41 +21,28 @@
"type": "string",
"default": "5.5.2"
},
"fr": {
"title": "Framerate",
"description": "Framerate in frames per second",
"type": "number",
"default": 60
},
"ip": {
"title": "In Point",
"title": "Animation In Point",
"description": "\"In Point\", which frame the animation starts at (usually 0)",
"type": "number",
"default": 0
},
"op": {
"title": "Out Point",
"title": "Animation Out Point",
"description": "\"Out Point\", which frame the animation stops/loops at, which makes this the duration in frames when `ip` is 0",
"type": "number",
"default": 60
},
"w": {
"title": "Width",
"description": "Width of the animation",
"title": "Animation Width",
"type": "integer",
"default": 512
},
"h": {
"title": "Height",
"description": "Height of the animation",
"title": "Animation Height",
"type": "integer",
"default": 512
},
"ddd": {
"title": "Threedimensional",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
},
"assets": {
"title": "Assets",
"type": "array",
Expand All @@ -72,7 +65,7 @@
"$ref": "#/$defs/text/font-list"
},
"chars": {
"title": "Chars",
"title": "Animation Chars Data",
"description": "Data defining text characters as lottie shapes",
"type": "array",
"items": {
Expand All @@ -93,7 +86,6 @@
}
},
"mb": {
"title": "Motion Blur",
"$ref": "#/$defs/animation/motion-blur"
}
},
Expand Down
8 changes: 3 additions & 5 deletions docs/schema/assets/image.json
Expand Up @@ -11,19 +11,17 @@
"type": "object",
"properties": {
"w": {
"title": "Width",
"description": "Width of the image",
"title": "Image Width",
"type": "number",
"default": 0
},
"h": {
"title": "Height",
"description": "Height of the image",
"title": "Image Height",
"type": "number",
"default": 0
},
"u": {
"title": "Path",
"title": "Image Path",
"description": "Path to the directory containing an image",
"type": "string",
"default": ""
Expand Down
17 changes: 4 additions & 13 deletions docs/schema/assets/precomposition.json
Expand Up @@ -11,19 +11,10 @@
"$ref": "#/$defs/animation/composition"
},
{
"type": "object",
"properties": {
"nm": {
"type": "string",
"title": "Name",
"description": "Name of the precomposition"
},
"fr": {
"title": "Framerate",
"description": "Framerate in frames per second",
"type": "number"
}
}
"$ref": "#/$defs/helpers/name"
},
{
"$ref": "#/$defs/helpers/framerate"
}
]
}
6 changes: 3 additions & 3 deletions docs/schema/assets/sound.json
Expand Up @@ -11,19 +11,19 @@
"type": "object",
"properties": {
"u": {
"title": "Path",
"title": "Sound Path",
"description": "Path to the directory containing a sound file",
"type": "string",
"default": ""
},
"p": {
"title": "File name",
"title": "Sound File name",
"description": "Sound filename or data url",
"type": "string",
"default": ""
},
"e": {
"title": "Embedded",
"title": "Sound Embedded",
"description": "Whether the sound is embedded",
"$ref": "#/$defs/helpers/int-boolean",
"default": 0
Expand Down
32 changes: 16 additions & 16 deletions docs/schema/constants/blend-mode.json
Expand Up @@ -5,67 +5,67 @@
"description": "",
"oneOf": [
{
"title": "Normal",
"title": "Blend Mode Normal",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely don't like repeating the enum name in its values to be honest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it's not ideal, but then can you suggest a name? so we could avoid the generic names which may be created in other props

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What problem would it cause if "Normal" is used elsewhere too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answered in the comment below

"const": 0
},
{
"title": "Multiply",
"title": "Blend Mode Multiply",
"const": 1
},
{
"title": "Screen",
"title": "Blend Mode Screen",
"const": 2
},
{
"title": "Overlay",
"title": "Blend Mode Overlay",
"const": 3
},
{
"title": "Darken",
"title": "Blend Mode Darken",
"const": 4
},
{
"title": "Lighten",
"title": "Blend Mode Lighten",
"const": 5
},
{
"title": "Color Dodge",
"title": "Blend Mode Color Dodge",
"const": 6
},
{
"title": "Color Burn",
"title": "Blend Mode Color Burn",
"const": 7
},
{
"title": "Hard Light",
"title": "Blend Mode Hard Light",
"const": 8
},
{
"title": "Soft Light",
"title": "Blend Mode Soft Light",
"const": 9
},
{
"title": "Difference",
"title": "Blend Mode Difference",
"const": 10
},
{
"title": "Exclusion",
"title": "Blend Mode Exclusion",
"const": 11
},
{
"title": "Hue",
"title": "Blend Mode Hue",
"const": 12
},
{
"title": "Saturation",
"title": "Blend Mode Saturation",
"const": 13
},
{
"title": "Color",
"title": "Blend Mode Color",
"const": 14
},
{
"title": "Luminosity",
"title": "Blend Mode Luminosity",
"const": 15
}
]
Expand Down