@lvl99dotcom/paintcanvas 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -15
- package/dist/lib/brushes/StrokeEngine/index.d.ts +2 -2
- package/dist/lib/brushes/StrokeEngine/index.js +26 -28
- package/dist/lib/brushes/presets/round/index.d.ts +1 -1
- package/dist/lib/brushes/presets/round/index.js +12 -7
- package/dist/lib/brushes/presets/square/index.d.ts +1 -1
- package/dist/lib/brushes/presets/square/index.js +7 -3
- package/dist/lib/brushes/shapeImage/index.d.ts +7 -3
- package/dist/lib/brushes/shapeImage/index.js +15 -9
- package/dist/lib/brushes/shapes/index.d.ts +18 -0
- package/dist/lib/brushes/shapes/index.js +86 -0
- package/dist/lib/classes/BrushSettings/index.d.ts +53 -2
- package/dist/lib/classes/BrushSettings/index.js +85 -14
- package/dist/lib/classes/KeyboardShortcuts/index.d.ts +47 -7
- package/dist/lib/classes/KeyboardShortcuts/index.js +145 -20
- package/dist/lib/classes/PaintCanvas/index.d.ts +123 -27
- package/dist/lib/classes/PaintCanvas/index.js +208 -41
- package/dist/lib/classes/PaintCanvas/tool.d.ts +15 -0
- package/dist/lib/classes/PaintCanvas/tool.js +18 -0
- package/dist/lib/classes/Palette/index.d.ts +58 -0
- package/dist/lib/classes/Palette/index.js +92 -0
- package/dist/lib/classes/SettingsAutosave/index.d.ts +53 -0
- package/dist/lib/classes/SettingsAutosave/index.js +98 -0
- package/dist/lib/classes/ShortcutSettings/index.d.ts +63 -0
- package/dist/lib/classes/ShortcutSettings/index.js +110 -0
- package/dist/lib/classes/UiSettings/index.d.ts +68 -0
- package/dist/lib/classes/UiSettings/index.js +82 -0
- package/dist/lib/palette/index.d.ts +49 -0
- package/dist/lib/palette/index.js +82 -0
- package/dist/lib/palette/schema.d.ts +45 -0
- package/dist/lib/palette/schema.js +41 -0
- package/dist/lib/rendering/cursors/index.d.ts +2 -0
- package/dist/lib/rendering/cursors/index.js +3 -1
- package/dist/lib/rendering/sample/index.js +3 -2
- package/dist/lib/settings/index.d.ts +63 -0
- package/dist/lib/settings/index.js +93 -0
- package/dist/lib/settings/schema.d.ts +168 -0
- package/dist/lib/settings/schema.js +116 -0
- package/dist/lib/storage/index.d.ts +36 -5
- package/dist/lib/storage/index.js +87 -29
- package/dist/lib/utils/colour/index.d.ts +72 -0
- package/dist/lib/utils/colour/index.js +154 -0
- package/dist/lib/utils/shortcuts/index.d.ts +174 -11
- package/dist/lib/utils/shortcuts/index.js +391 -145
- package/dist/lib/validation/validators.generated.d.ts +5 -0
- package/dist/lib/validation/validators.generated.js +1040 -1
- package/dist/locales/en-GB.js +96 -3
- package/dist/locales/en-US.js +96 -3
- package/dist/locales/fr.js +96 -3
- package/dist/locales/ja.js +96 -3
- package/dist/locales/ko.js +96 -3
- package/dist/locales/zh-Hans.js +96 -3
- package/dist/locales/zh-Hant.js +96 -3
- package/dist/package.js +1 -1
- package/dist/testing/recordingCanvas.js +2 -1
- package/dist/ui/base/index.d.ts +2 -2
- package/dist/ui/dismiss/index.d.ts +21 -0
- package/dist/ui/dismiss/index.js +27 -0
- package/dist/ui/drag/index.d.ts +51 -0
- package/dist/ui/drag/index.js +81 -0
- package/dist/ui/elements/PaintCanvas/index.d.ts +57 -50
- package/dist/ui/elements/PaintCanvas/index.js +141 -174
- package/dist/ui/elements/PaintCanvas/style.js +1 -1
- package/dist/ui/elements/PcAppSettings/index.d.ts +59 -0
- package/dist/ui/elements/PcAppSettings/index.js +222 -0
- package/dist/ui/elements/PcBrushConfig/index.d.ts +9 -2
- package/dist/ui/elements/PcBrushConfig/index.js +47 -7
- package/dist/ui/elements/PcBrushConfig/style.js +1 -1
- package/dist/ui/elements/PcBrushSize/index.d.ts +53 -0
- package/dist/ui/elements/PcBrushSize/index.js +66 -0
- package/dist/ui/elements/PcBrushTest/index.d.ts +26 -0
- package/dist/ui/elements/PcBrushTest/index.js +73 -5
- package/dist/ui/elements/PcBrushTest/style.js +1 -1
- package/dist/ui/elements/PcCanvas/index.d.ts +22 -2
- package/dist/ui/elements/PcCanvas/index.js +60 -15
- package/dist/ui/elements/PcCanvasMap/style.js +1 -1
- package/dist/ui/elements/PcClipboardTools/index.d.ts +48 -0
- package/dist/ui/elements/PcClipboardTools/index.js +118 -0
- package/dist/ui/elements/PcColourPair/index.d.ts +43 -0
- package/dist/ui/elements/PcColourPair/index.js +125 -0
- package/dist/ui/elements/PcContextMenu/index.d.ts +71 -34
- package/dist/ui/elements/PcContextMenu/index.js +128 -97
- package/dist/ui/elements/PcInputSettings/index.d.ts +13 -0
- package/dist/ui/elements/PcInputSettings/index.js +16 -1
- package/dist/ui/elements/PcLayerItem/index.d.ts +13 -34
- package/dist/ui/elements/PcLayerItem/index.js +39 -91
- package/dist/ui/elements/PcLayerItem/style.js +1 -1
- package/dist/ui/elements/PcMenu/index.d.ts +138 -0
- package/dist/ui/elements/PcMenu/index.js +296 -0
- package/dist/ui/elements/PcNumberSlider/index.d.ts +137 -0
- package/dist/ui/elements/PcNumberSlider/index.js +247 -0
- package/dist/ui/elements/PcPane/index.d.ts +120 -0
- package/dist/ui/elements/PcPane/index.js +394 -0
- package/dist/ui/elements/PcPanel/index.d.ts +26 -8
- package/dist/ui/elements/PcPanel/index.js +76 -8
- package/dist/ui/elements/{PcBrushMenu → PcPanelBrushes}/index.d.ts +22 -21
- package/dist/ui/elements/{PcBrushMenu → PcPanelBrushes}/index.js +24 -57
- package/dist/ui/elements/PcPanelBrushes/style.js +3 -0
- package/dist/ui/elements/PcPanelColours/index.d.ts +171 -0
- package/dist/ui/elements/PcPanelColours/index.js +650 -0
- package/dist/ui/elements/PcPanelColours/style.js +3 -0
- package/dist/ui/elements/{PcLayersMenu → PcPanelLayers}/index.d.ts +17 -4
- package/dist/ui/elements/{PcLayersMenu → PcPanelLayers}/index.js +17 -10
- package/dist/ui/elements/PcPanelLayers/style.js +3 -0
- package/dist/ui/elements/PcPopover/index.d.ts +39 -1
- package/dist/ui/elements/PcPopover/index.js +72 -4
- package/dist/ui/elements/PcShortcutSettings/index.d.ts +69 -0
- package/dist/ui/elements/PcShortcutSettings/index.js +273 -0
- package/dist/ui/elements/PcThemePicker/index.d.ts +17 -15
- package/dist/ui/elements/PcThemePicker/index.js +22 -21
- package/dist/ui/elements/PcToolSettings/index.d.ts +48 -9
- package/dist/ui/elements/PcToolSettings/index.js +384 -319
- package/dist/ui/elements/PcToolSettings/style.js +1 -1
- package/dist/ui/elements/PcToolbar/index.d.ts +62 -12
- package/dist/ui/elements/PcToolbar/index.js +119 -57
- package/dist/ui/elements/PcToolbar/style.js +1 -1
- package/dist/ui/icons/images/icon-brush@2x.js +3 -0
- package/dist/ui/icons/images/icon-circle-mask@2x.js +3 -0
- package/dist/ui/icons/images/icon-clipboard@2x.js +3 -0
- package/dist/ui/icons/images/icon-cog@2x.js +3 -0
- package/dist/ui/icons/images/icon-cursor@2x.js +3 -0
- package/dist/ui/icons/images/icon-diagonal-tlbr-size@2x.js +3 -0
- package/dist/ui/icons/images/icon-diagonal-trbl-size@2x.js +3 -0
- package/dist/ui/icons/images/icon-eraser@2x.js +3 -0
- package/dist/ui/icons/images/icon-eyedropper@2x.js +3 -0
- package/dist/ui/icons/images/icon-flip-horizontal@2x.js +3 -0
- package/dist/ui/icons/images/icon-flip-vertical@2x.js +3 -0
- package/dist/ui/icons/images/icon-focus-pen@2x.js +3 -0
- package/dist/ui/icons/images/icon-freehand-mask@2x.js +3 -0
- package/dist/ui/icons/images/icon-hidden@2x.js +3 -0
- package/dist/ui/icons/images/icon-horizontal-size@2x.js +3 -0
- package/dist/ui/icons/images/icon-layers@2x.js +3 -0
- package/dist/ui/icons/images/icon-linked@2x.js +3 -0
- package/dist/ui/icons/images/icon-locked@2x.js +3 -0
- package/dist/ui/icons/images/icon-moon@2x.js +3 -0
- package/dist/ui/icons/images/icon-pan@2x.js +3 -0
- package/dist/ui/icons/images/icon-polygon-mask@2x.js +3 -0
- package/dist/ui/icons/images/icon-pressure@2x.js +3 -0
- package/dist/ui/icons/images/icon-randomise@2x.js +3 -0
- package/dist/ui/icons/images/icon-rectangle-mask@2x.js +3 -0
- package/dist/ui/icons/images/icon-redo@2x.js +3 -0
- package/dist/ui/icons/images/icon-rotate-90-left@2x.js +3 -0
- package/dist/ui/icons/images/icon-rotate-90-right@2x.js +3 -0
- package/dist/ui/icons/images/icon-rotate@2x.js +3 -0
- package/dist/ui/icons/images/icon-smoothing-bezier-cubic@2x.js +3 -0
- package/dist/ui/icons/images/icon-smoothing-bezier-quad@2x.js +3 -0
- package/dist/ui/icons/images/icon-smoothing-linear@2x.js +3 -0
- package/dist/ui/icons/images/icon-star@2x.js +3 -0
- package/dist/ui/icons/images/icon-sun@2x.js +3 -0
- package/dist/ui/icons/images/icon-tilt@2x.js +3 -0
- package/dist/ui/icons/images/icon-undo@2x.js +3 -0
- package/dist/ui/icons/images/icon-unlinked@2x.js +3 -0
- package/dist/ui/icons/images/icon-unlocked@2x.js +3 -0
- package/dist/ui/icons/images/icon-vertical-size@2x.js +3 -0
- package/dist/ui/icons/images/icon-visible@2x.js +3 -0
- package/dist/ui/icons/images/icon-zoom-in@2x.js +3 -0
- package/dist/ui/icons/images/icon-zoom-out@2x.js +3 -0
- package/dist/ui/icons/images/icon-zoom@2x.js +3 -0
- package/dist/ui/icons/index.d.ts +1 -1
- package/dist/ui/icons/index.js +84 -72
- package/dist/ui/index.d.ts +13 -2
- package/dist/ui/index.js +16 -4
- package/dist/ui/layout/index.d.ts +9 -1
- package/dist/ui/layout/index.js +11 -2
- package/dist/ui/tokens/index.d.ts +5 -4
- package/dist/ui/tokens/index.js +15 -8
- package/locales/en-GB.json +96 -3
- package/locales/en-US.json +96 -3
- package/locales/fr.json +96 -3
- package/locales/ja.json +96 -3
- package/locales/ko.json +96 -3
- package/locales/zh-Hans.json +96 -3
- package/locales/zh-Hant.json +96 -3
- package/package.json +11 -4
- package/dist/ui/elements/PcBrushMenu/style.js +0 -3
- package/dist/ui/elements/PcLayersMenu/style.js +0 -3
- package/dist/ui/icons/images/brush.js +0 -3
- package/dist/ui/icons/images/circle-mask.js +0 -3
- package/dist/ui/icons/images/clipboard.js +0 -3
- package/dist/ui/icons/images/cursor.js +0 -3
- package/dist/ui/icons/images/eraser.js +0 -3
- package/dist/ui/icons/images/eyedropper.js +0 -3
- package/dist/ui/icons/images/flip-horizontal.js +0 -3
- package/dist/ui/icons/images/flip-vertical.js +0 -3
- package/dist/ui/icons/images/focus-pen.js +0 -3
- package/dist/ui/icons/images/freehand-mask.js +0 -3
- package/dist/ui/icons/images/hidden.js +0 -3
- package/dist/ui/icons/images/layers.js +0 -3
- package/dist/ui/icons/images/linked.js +0 -3
- package/dist/ui/icons/images/locked.js +0 -3
- package/dist/ui/icons/images/moon.js +0 -3
- package/dist/ui/icons/images/pan.js +0 -3
- package/dist/ui/icons/images/polygon-mask.js +0 -3
- package/dist/ui/icons/images/pressure.js +0 -3
- package/dist/ui/icons/images/randomise.js +0 -3
- package/dist/ui/icons/images/rectangle-mask.js +0 -3
- package/dist/ui/icons/images/redo.js +0 -3
- package/dist/ui/icons/images/rotate-90-left.js +0 -3
- package/dist/ui/icons/images/rotate-90-right.js +0 -3
- package/dist/ui/icons/images/smoothing-bezier-cubic.js +0 -3
- package/dist/ui/icons/images/smoothing-bezier-quad.js +0 -3
- package/dist/ui/icons/images/smoothing-linear.js +0 -3
- package/dist/ui/icons/images/star.js +0 -3
- package/dist/ui/icons/images/sun.js +0 -3
- package/dist/ui/icons/images/tilt.js +0 -3
- package/dist/ui/icons/images/undo.js +0 -3
- package/dist/ui/icons/images/unlinked.js +0 -3
- package/dist/ui/icons/images/unlocked.js +0 -3
- package/dist/ui/icons/images/visible.js +0 -3
- package/dist/ui/icons/images/zoom-in.js +0 -3
- package/dist/ui/icons/images/zoom-out.js +0 -3
- package/dist/ui/icons/images/zoom.js +0 -3
|
@@ -19823,4 +19823,1043 @@ function validate15(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
19823
19823
|
validate15.errors = vErrors;
|
|
19824
19824
|
return true;
|
|
19825
19825
|
}
|
|
19826
|
-
|
|
19826
|
+
var validatePaletteFile = validate16;
|
|
19827
|
+
function validate16(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
19828
|
+
let vErrors = null;
|
|
19829
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
19830
|
+
let missing0;
|
|
19831
|
+
if (data.format === void 0 && (missing0 = "format") || data.version === void 0 && (missing0 = "version") || data.colours === void 0 && (missing0 = "colours")) {
|
|
19832
|
+
validate16.errors = [{
|
|
19833
|
+
instancePath,
|
|
19834
|
+
schemaPath: "#/required",
|
|
19835
|
+
keyword: "required",
|
|
19836
|
+
params: { missingProperty: missing0 },
|
|
19837
|
+
message: "must have required property '" + missing0 + "'"
|
|
19838
|
+
}];
|
|
19839
|
+
return false;
|
|
19840
|
+
} else {
|
|
19841
|
+
for (const key0 in data) if (!(key0 === "format" || key0 === "version" || key0 === "colours")) {
|
|
19842
|
+
validate16.errors = [{
|
|
19843
|
+
instancePath,
|
|
19844
|
+
schemaPath: "#/additionalProperties",
|
|
19845
|
+
keyword: "additionalProperties",
|
|
19846
|
+
params: { additionalProperty: key0 },
|
|
19847
|
+
message: "must NOT have additional properties"
|
|
19848
|
+
}];
|
|
19849
|
+
return false;
|
|
19850
|
+
}
|
|
19851
|
+
if (data.format !== void 0) {
|
|
19852
|
+
let data0 = data.format;
|
|
19853
|
+
if (typeof data0 === "string") {
|
|
19854
|
+
if (data0.length > 100) {
|
|
19855
|
+
validate16.errors = [{
|
|
19856
|
+
instancePath: instancePath + "/format",
|
|
19857
|
+
schemaPath: "#/properties/format/maxLength",
|
|
19858
|
+
keyword: "maxLength",
|
|
19859
|
+
params: { limit: 100 },
|
|
19860
|
+
message: "must NOT have more than 100 characters"
|
|
19861
|
+
}];
|
|
19862
|
+
return false;
|
|
19863
|
+
} else if (data0.length < 1) {
|
|
19864
|
+
validate16.errors = [{
|
|
19865
|
+
instancePath: instancePath + "/format",
|
|
19866
|
+
schemaPath: "#/properties/format/minLength",
|
|
19867
|
+
keyword: "minLength",
|
|
19868
|
+
params: { limit: 1 },
|
|
19869
|
+
message: "must NOT have fewer than 1 characters"
|
|
19870
|
+
}];
|
|
19871
|
+
return false;
|
|
19872
|
+
}
|
|
19873
|
+
} else {
|
|
19874
|
+
validate16.errors = [{
|
|
19875
|
+
instancePath: instancePath + "/format",
|
|
19876
|
+
schemaPath: "#/properties/format/type",
|
|
19877
|
+
keyword: "type",
|
|
19878
|
+
params: { type: "string" },
|
|
19879
|
+
message: "must be string"
|
|
19880
|
+
}];
|
|
19881
|
+
return false;
|
|
19882
|
+
}
|
|
19883
|
+
var valid0 = true;
|
|
19884
|
+
} else var valid0 = true;
|
|
19885
|
+
if (valid0) {
|
|
19886
|
+
if (data.version !== void 0) {
|
|
19887
|
+
if (1 !== data.version) {
|
|
19888
|
+
validate16.errors = [{
|
|
19889
|
+
instancePath: instancePath + "/version",
|
|
19890
|
+
schemaPath: "#/properties/version/const",
|
|
19891
|
+
keyword: "const",
|
|
19892
|
+
params: { allowedValue: 1 },
|
|
19893
|
+
message: "must be equal to constant"
|
|
19894
|
+
}];
|
|
19895
|
+
return false;
|
|
19896
|
+
}
|
|
19897
|
+
var valid0 = true;
|
|
19898
|
+
} else var valid0 = true;
|
|
19899
|
+
if (valid0) {
|
|
19900
|
+
if (data.colours !== void 0) {
|
|
19901
|
+
let data2 = data.colours;
|
|
19902
|
+
if (Array.isArray(data2)) {
|
|
19903
|
+
if (data2.length > 1e3) {
|
|
19904
|
+
validate16.errors = [{
|
|
19905
|
+
instancePath: instancePath + "/colours",
|
|
19906
|
+
schemaPath: "#/properties/colours/maxItems",
|
|
19907
|
+
keyword: "maxItems",
|
|
19908
|
+
params: { limit: 1e3 },
|
|
19909
|
+
message: "must NOT have more than 1000 items"
|
|
19910
|
+
}];
|
|
19911
|
+
return false;
|
|
19912
|
+
} else {
|
|
19913
|
+
const len0 = data2.length;
|
|
19914
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
19915
|
+
let data3 = data2[i0];
|
|
19916
|
+
if (typeof data3 === "string") {
|
|
19917
|
+
if (!pattern7.test(data3)) {
|
|
19918
|
+
validate16.errors = [{
|
|
19919
|
+
instancePath: instancePath + "/colours/" + i0,
|
|
19920
|
+
schemaPath: "#/properties/colours/items/pattern",
|
|
19921
|
+
keyword: "pattern",
|
|
19922
|
+
params: { pattern: "^#[0-9a-fA-F]{6}$" },
|
|
19923
|
+
message: "must match pattern \"^#[0-9a-fA-F]{6}$\""
|
|
19924
|
+
}];
|
|
19925
|
+
return false;
|
|
19926
|
+
}
|
|
19927
|
+
} else {
|
|
19928
|
+
validate16.errors = [{
|
|
19929
|
+
instancePath: instancePath + "/colours/" + i0,
|
|
19930
|
+
schemaPath: "#/properties/colours/items/type",
|
|
19931
|
+
keyword: "type",
|
|
19932
|
+
params: { type: "string" },
|
|
19933
|
+
message: "must be string"
|
|
19934
|
+
}];
|
|
19935
|
+
return false;
|
|
19936
|
+
}
|
|
19937
|
+
}
|
|
19938
|
+
}
|
|
19939
|
+
} else {
|
|
19940
|
+
validate16.errors = [{
|
|
19941
|
+
instancePath: instancePath + "/colours",
|
|
19942
|
+
schemaPath: "#/properties/colours/type",
|
|
19943
|
+
keyword: "type",
|
|
19944
|
+
params: { type: "array" },
|
|
19945
|
+
message: "must be array"
|
|
19946
|
+
}];
|
|
19947
|
+
return false;
|
|
19948
|
+
}
|
|
19949
|
+
var valid0 = true;
|
|
19950
|
+
} else var valid0 = true;
|
|
19951
|
+
}
|
|
19952
|
+
}
|
|
19953
|
+
}
|
|
19954
|
+
} else {
|
|
19955
|
+
validate16.errors = [{
|
|
19956
|
+
instancePath,
|
|
19957
|
+
schemaPath: "#/type",
|
|
19958
|
+
keyword: "type",
|
|
19959
|
+
params: { type: "object" },
|
|
19960
|
+
message: "must be object"
|
|
19961
|
+
}];
|
|
19962
|
+
return false;
|
|
19963
|
+
}
|
|
19964
|
+
validate16.errors = vErrors;
|
|
19965
|
+
return true;
|
|
19966
|
+
}
|
|
19967
|
+
var validateSettings = validate17;
|
|
19968
|
+
var schema20 = {
|
|
19969
|
+
"$id": "paintcanvas/settings",
|
|
19970
|
+
"type": "object",
|
|
19971
|
+
"additionalProperties": false,
|
|
19972
|
+
"properties": {
|
|
19973
|
+
"input": {
|
|
19974
|
+
"type": "object",
|
|
19975
|
+
"additionalProperties": false,
|
|
19976
|
+
"properties": {
|
|
19977
|
+
"scrollPan": { "type": "boolean" },
|
|
19978
|
+
"pinchZoom": { "type": "boolean" },
|
|
19979
|
+
"modifierScrollZoom": { "type": "boolean" },
|
|
19980
|
+
"focusPen": { "type": "boolean" },
|
|
19981
|
+
"gestures": {
|
|
19982
|
+
"type": "object",
|
|
19983
|
+
"maxProperties": 20,
|
|
19984
|
+
"additionalProperties": {
|
|
19985
|
+
"type": "string",
|
|
19986
|
+
"maxLength": 50
|
|
19987
|
+
}
|
|
19988
|
+
}
|
|
19989
|
+
}
|
|
19990
|
+
},
|
|
19991
|
+
"shortcuts": {
|
|
19992
|
+
"type": "object",
|
|
19993
|
+
"maxProperties": 200,
|
|
19994
|
+
"propertyNames": { "maxLength": 64 },
|
|
19995
|
+
"additionalProperties": { "anyOf": [{ "type": "null" }, { "$ref": "key-combo" }] }
|
|
19996
|
+
},
|
|
19997
|
+
"palette": {
|
|
19998
|
+
"type": "array",
|
|
19999
|
+
"maxItems": 1e3,
|
|
20000
|
+
"items": {
|
|
20001
|
+
"type": "string",
|
|
20002
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
20003
|
+
}
|
|
20004
|
+
},
|
|
20005
|
+
"colours": {
|
|
20006
|
+
"type": "object",
|
|
20007
|
+
"additionalProperties": false,
|
|
20008
|
+
"required": ["foreground", "background"],
|
|
20009
|
+
"properties": {
|
|
20010
|
+
"foreground": {
|
|
20011
|
+
"type": "string",
|
|
20012
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
20013
|
+
},
|
|
20014
|
+
"background": {
|
|
20015
|
+
"type": "string",
|
|
20016
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
20017
|
+
}
|
|
20018
|
+
}
|
|
20019
|
+
},
|
|
20020
|
+
"ui": {
|
|
20021
|
+
"type": "object",
|
|
20022
|
+
"additionalProperties": false,
|
|
20023
|
+
"properties": {
|
|
20024
|
+
"theme": { "enum": [
|
|
20025
|
+
"light",
|
|
20026
|
+
"dark",
|
|
20027
|
+
"system"
|
|
20028
|
+
] },
|
|
20029
|
+
"locale": {
|
|
20030
|
+
"type": "string",
|
|
20031
|
+
"minLength": 1,
|
|
20032
|
+
"maxLength": 35,
|
|
20033
|
+
"pattern": "^[A-Za-z0-9-]+$"
|
|
20034
|
+
}
|
|
20035
|
+
}
|
|
20036
|
+
}
|
|
20037
|
+
}
|
|
20038
|
+
};
|
|
20039
|
+
var pattern16 = /* @__PURE__ */ new RegExp("^[A-Za-z0-9-]+$", "u");
|
|
20040
|
+
function validate17(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
20041
|
+
let vErrors = null;
|
|
20042
|
+
let errors = 0;
|
|
20043
|
+
if (errors === 0) {
|
|
20044
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
20045
|
+
const _errs1 = errors;
|
|
20046
|
+
for (const key0 in data) if (!(key0 === "input" || key0 === "shortcuts" || key0 === "palette" || key0 === "colours" || key0 === "ui")) {
|
|
20047
|
+
validate17.errors = [{
|
|
20048
|
+
instancePath,
|
|
20049
|
+
schemaPath: "#/additionalProperties",
|
|
20050
|
+
keyword: "additionalProperties",
|
|
20051
|
+
params: { additionalProperty: key0 },
|
|
20052
|
+
message: "must NOT have additional properties"
|
|
20053
|
+
}];
|
|
20054
|
+
return false;
|
|
20055
|
+
}
|
|
20056
|
+
if (_errs1 === errors) {
|
|
20057
|
+
if (data.input !== void 0) {
|
|
20058
|
+
let data0 = data.input;
|
|
20059
|
+
const _errs2 = errors;
|
|
20060
|
+
if (errors === _errs2) {
|
|
20061
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
20062
|
+
const _errs4 = errors;
|
|
20063
|
+
for (const key1 in data0) if (!(key1 === "scrollPan" || key1 === "pinchZoom" || key1 === "modifierScrollZoom" || key1 === "focusPen" || key1 === "gestures")) {
|
|
20064
|
+
validate17.errors = [{
|
|
20065
|
+
instancePath: instancePath + "/input",
|
|
20066
|
+
schemaPath: "#/properties/input/additionalProperties",
|
|
20067
|
+
keyword: "additionalProperties",
|
|
20068
|
+
params: { additionalProperty: key1 },
|
|
20069
|
+
message: "must NOT have additional properties"
|
|
20070
|
+
}];
|
|
20071
|
+
return false;
|
|
20072
|
+
}
|
|
20073
|
+
if (_errs4 === errors) {
|
|
20074
|
+
if (data0.scrollPan !== void 0) {
|
|
20075
|
+
const _errs5 = errors;
|
|
20076
|
+
if (typeof data0.scrollPan !== "boolean") {
|
|
20077
|
+
validate17.errors = [{
|
|
20078
|
+
instancePath: instancePath + "/input/scrollPan",
|
|
20079
|
+
schemaPath: "#/properties/input/properties/scrollPan/type",
|
|
20080
|
+
keyword: "type",
|
|
20081
|
+
params: { type: "boolean" },
|
|
20082
|
+
message: "must be boolean"
|
|
20083
|
+
}];
|
|
20084
|
+
return false;
|
|
20085
|
+
}
|
|
20086
|
+
var valid1 = _errs5 === errors;
|
|
20087
|
+
} else var valid1 = true;
|
|
20088
|
+
if (valid1) {
|
|
20089
|
+
if (data0.pinchZoom !== void 0) {
|
|
20090
|
+
const _errs7 = errors;
|
|
20091
|
+
if (typeof data0.pinchZoom !== "boolean") {
|
|
20092
|
+
validate17.errors = [{
|
|
20093
|
+
instancePath: instancePath + "/input/pinchZoom",
|
|
20094
|
+
schemaPath: "#/properties/input/properties/pinchZoom/type",
|
|
20095
|
+
keyword: "type",
|
|
20096
|
+
params: { type: "boolean" },
|
|
20097
|
+
message: "must be boolean"
|
|
20098
|
+
}];
|
|
20099
|
+
return false;
|
|
20100
|
+
}
|
|
20101
|
+
var valid1 = _errs7 === errors;
|
|
20102
|
+
} else var valid1 = true;
|
|
20103
|
+
if (valid1) {
|
|
20104
|
+
if (data0.modifierScrollZoom !== void 0) {
|
|
20105
|
+
const _errs9 = errors;
|
|
20106
|
+
if (typeof data0.modifierScrollZoom !== "boolean") {
|
|
20107
|
+
validate17.errors = [{
|
|
20108
|
+
instancePath: instancePath + "/input/modifierScrollZoom",
|
|
20109
|
+
schemaPath: "#/properties/input/properties/modifierScrollZoom/type",
|
|
20110
|
+
keyword: "type",
|
|
20111
|
+
params: { type: "boolean" },
|
|
20112
|
+
message: "must be boolean"
|
|
20113
|
+
}];
|
|
20114
|
+
return false;
|
|
20115
|
+
}
|
|
20116
|
+
var valid1 = _errs9 === errors;
|
|
20117
|
+
} else var valid1 = true;
|
|
20118
|
+
if (valid1) {
|
|
20119
|
+
if (data0.focusPen !== void 0) {
|
|
20120
|
+
const _errs11 = errors;
|
|
20121
|
+
if (typeof data0.focusPen !== "boolean") {
|
|
20122
|
+
validate17.errors = [{
|
|
20123
|
+
instancePath: instancePath + "/input/focusPen",
|
|
20124
|
+
schemaPath: "#/properties/input/properties/focusPen/type",
|
|
20125
|
+
keyword: "type",
|
|
20126
|
+
params: { type: "boolean" },
|
|
20127
|
+
message: "must be boolean"
|
|
20128
|
+
}];
|
|
20129
|
+
return false;
|
|
20130
|
+
}
|
|
20131
|
+
var valid1 = _errs11 === errors;
|
|
20132
|
+
} else var valid1 = true;
|
|
20133
|
+
if (valid1) {
|
|
20134
|
+
if (data0.gestures !== void 0) {
|
|
20135
|
+
let data5 = data0.gestures;
|
|
20136
|
+
const _errs13 = errors;
|
|
20137
|
+
if (errors === _errs13) {
|
|
20138
|
+
if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
|
|
20139
|
+
if (Object.keys(data5).length > 20) {
|
|
20140
|
+
validate17.errors = [{
|
|
20141
|
+
instancePath: instancePath + "/input/gestures",
|
|
20142
|
+
schemaPath: "#/properties/input/properties/gestures/maxProperties",
|
|
20143
|
+
keyword: "maxProperties",
|
|
20144
|
+
params: { limit: 20 },
|
|
20145
|
+
message: "must NOT have more than 20 properties"
|
|
20146
|
+
}];
|
|
20147
|
+
return false;
|
|
20148
|
+
} else for (const key2 in data5) {
|
|
20149
|
+
let data6 = data5[key2];
|
|
20150
|
+
const _errs16 = errors;
|
|
20151
|
+
if (errors === _errs16) {
|
|
20152
|
+
if (typeof data6 === "string") {
|
|
20153
|
+
if (data6.length > 50) {
|
|
20154
|
+
validate17.errors = [{
|
|
20155
|
+
instancePath: instancePath + "/input/gestures/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20156
|
+
schemaPath: "#/properties/input/properties/gestures/additionalProperties/maxLength",
|
|
20157
|
+
keyword: "maxLength",
|
|
20158
|
+
params: { limit: 50 },
|
|
20159
|
+
message: "must NOT have more than 50 characters"
|
|
20160
|
+
}];
|
|
20161
|
+
return false;
|
|
20162
|
+
}
|
|
20163
|
+
} else {
|
|
20164
|
+
validate17.errors = [{
|
|
20165
|
+
instancePath: instancePath + "/input/gestures/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20166
|
+
schemaPath: "#/properties/input/properties/gestures/additionalProperties/type",
|
|
20167
|
+
keyword: "type",
|
|
20168
|
+
params: { type: "string" },
|
|
20169
|
+
message: "must be string"
|
|
20170
|
+
}];
|
|
20171
|
+
return false;
|
|
20172
|
+
}
|
|
20173
|
+
}
|
|
20174
|
+
if (!(_errs16 === errors)) break;
|
|
20175
|
+
}
|
|
20176
|
+
} else {
|
|
20177
|
+
validate17.errors = [{
|
|
20178
|
+
instancePath: instancePath + "/input/gestures",
|
|
20179
|
+
schemaPath: "#/properties/input/properties/gestures/type",
|
|
20180
|
+
keyword: "type",
|
|
20181
|
+
params: { type: "object" },
|
|
20182
|
+
message: "must be object"
|
|
20183
|
+
}];
|
|
20184
|
+
return false;
|
|
20185
|
+
}
|
|
20186
|
+
}
|
|
20187
|
+
var valid1 = _errs13 === errors;
|
|
20188
|
+
} else var valid1 = true;
|
|
20189
|
+
}
|
|
20190
|
+
}
|
|
20191
|
+
}
|
|
20192
|
+
}
|
|
20193
|
+
}
|
|
20194
|
+
} else {
|
|
20195
|
+
validate17.errors = [{
|
|
20196
|
+
instancePath: instancePath + "/input",
|
|
20197
|
+
schemaPath: "#/properties/input/type",
|
|
20198
|
+
keyword: "type",
|
|
20199
|
+
params: { type: "object" },
|
|
20200
|
+
message: "must be object"
|
|
20201
|
+
}];
|
|
20202
|
+
return false;
|
|
20203
|
+
}
|
|
20204
|
+
}
|
|
20205
|
+
var valid0 = _errs2 === errors;
|
|
20206
|
+
} else var valid0 = true;
|
|
20207
|
+
if (valid0) {
|
|
20208
|
+
if (data.shortcuts !== void 0) {
|
|
20209
|
+
let data7 = data.shortcuts;
|
|
20210
|
+
const _errs18 = errors;
|
|
20211
|
+
if (errors === _errs18) {
|
|
20212
|
+
if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
|
|
20213
|
+
if (Object.keys(data7).length > 200) {
|
|
20214
|
+
validate17.errors = [{
|
|
20215
|
+
instancePath: instancePath + "/shortcuts",
|
|
20216
|
+
schemaPath: "#/properties/shortcuts/maxProperties",
|
|
20217
|
+
keyword: "maxProperties",
|
|
20218
|
+
params: { limit: 200 },
|
|
20219
|
+
message: "must NOT have more than 200 properties"
|
|
20220
|
+
}];
|
|
20221
|
+
return false;
|
|
20222
|
+
} else {
|
|
20223
|
+
for (const key3 in data7) {
|
|
20224
|
+
const _errs20 = errors;
|
|
20225
|
+
if (typeof key3 === "string") {
|
|
20226
|
+
if (key3.length > 64) {
|
|
20227
|
+
const err0 = {
|
|
20228
|
+
instancePath: instancePath + "/shortcuts",
|
|
20229
|
+
schemaPath: "#/properties/shortcuts/propertyNames/maxLength",
|
|
20230
|
+
keyword: "maxLength",
|
|
20231
|
+
params: { limit: 64 },
|
|
20232
|
+
message: "must NOT have more than 64 characters",
|
|
20233
|
+
propertyName: key3
|
|
20234
|
+
};
|
|
20235
|
+
if (vErrors === null) vErrors = [err0];
|
|
20236
|
+
else vErrors.push(err0);
|
|
20237
|
+
errors++;
|
|
20238
|
+
}
|
|
20239
|
+
}
|
|
20240
|
+
var valid3 = _errs20 === errors;
|
|
20241
|
+
if (!valid3) {
|
|
20242
|
+
const err1 = {
|
|
20243
|
+
instancePath: instancePath + "/shortcuts",
|
|
20244
|
+
schemaPath: "#/properties/shortcuts/propertyNames",
|
|
20245
|
+
keyword: "propertyNames",
|
|
20246
|
+
params: { propertyName: key3 },
|
|
20247
|
+
message: "property name must be valid"
|
|
20248
|
+
};
|
|
20249
|
+
if (vErrors === null) vErrors = [err1];
|
|
20250
|
+
else vErrors.push(err1);
|
|
20251
|
+
errors++;
|
|
20252
|
+
validate17.errors = vErrors;
|
|
20253
|
+
return false;
|
|
20254
|
+
}
|
|
20255
|
+
}
|
|
20256
|
+
if (valid3) for (const key4 in data7) {
|
|
20257
|
+
let data8 = data7[key4];
|
|
20258
|
+
const _errs22 = errors;
|
|
20259
|
+
const _errs23 = errors;
|
|
20260
|
+
let valid5 = false;
|
|
20261
|
+
const _errs24 = errors;
|
|
20262
|
+
if (data8 !== null) {
|
|
20263
|
+
const err2 = {
|
|
20264
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20265
|
+
schemaPath: "#/properties/shortcuts/additionalProperties/anyOf/0/type",
|
|
20266
|
+
keyword: "type",
|
|
20267
|
+
params: { type: "null" },
|
|
20268
|
+
message: "must be null"
|
|
20269
|
+
};
|
|
20270
|
+
if (vErrors === null) vErrors = [err2];
|
|
20271
|
+
else vErrors.push(err2);
|
|
20272
|
+
errors++;
|
|
20273
|
+
}
|
|
20274
|
+
var _valid0 = _errs24 === errors;
|
|
20275
|
+
valid5 = valid5 || _valid0;
|
|
20276
|
+
if (!valid5) {
|
|
20277
|
+
const _errs26 = errors;
|
|
20278
|
+
if (errors === errors) {
|
|
20279
|
+
if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
|
|
20280
|
+
let missing0;
|
|
20281
|
+
if (data8.key === void 0 && (missing0 = "key")) {
|
|
20282
|
+
const err3 = {
|
|
20283
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20284
|
+
schemaPath: "key-combo/required",
|
|
20285
|
+
keyword: "required",
|
|
20286
|
+
params: { missingProperty: missing0 },
|
|
20287
|
+
message: "must have required property '" + missing0 + "'"
|
|
20288
|
+
};
|
|
20289
|
+
if (vErrors === null) vErrors = [err3];
|
|
20290
|
+
else vErrors.push(err3);
|
|
20291
|
+
errors++;
|
|
20292
|
+
} else {
|
|
20293
|
+
const _errs29 = errors;
|
|
20294
|
+
for (const key5 in data8) if (!(key5 === "key" || key5 === "cmd" || key5 === "ctrl" || key5 === "shift" || key5 === "alt")) {
|
|
20295
|
+
const err4 = {
|
|
20296
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20297
|
+
schemaPath: "key-combo/additionalProperties",
|
|
20298
|
+
keyword: "additionalProperties",
|
|
20299
|
+
params: { additionalProperty: key5 },
|
|
20300
|
+
message: "must NOT have additional properties"
|
|
20301
|
+
};
|
|
20302
|
+
if (vErrors === null) vErrors = [err4];
|
|
20303
|
+
else vErrors.push(err4);
|
|
20304
|
+
errors++;
|
|
20305
|
+
break;
|
|
20306
|
+
}
|
|
20307
|
+
if (_errs29 === errors) {
|
|
20308
|
+
if (data8.key !== void 0) {
|
|
20309
|
+
let data9 = data8.key;
|
|
20310
|
+
const _errs30 = errors;
|
|
20311
|
+
if (errors === _errs30) {
|
|
20312
|
+
if (typeof data9 === "string") {
|
|
20313
|
+
if (data9.length > 32) {
|
|
20314
|
+
const err5 = {
|
|
20315
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/key",
|
|
20316
|
+
schemaPath: "key-combo/properties/key/maxLength",
|
|
20317
|
+
keyword: "maxLength",
|
|
20318
|
+
params: { limit: 32 },
|
|
20319
|
+
message: "must NOT have more than 32 characters"
|
|
20320
|
+
};
|
|
20321
|
+
if (vErrors === null) vErrors = [err5];
|
|
20322
|
+
else vErrors.push(err5);
|
|
20323
|
+
errors++;
|
|
20324
|
+
} else if (data9.length < 1) {
|
|
20325
|
+
const err6 = {
|
|
20326
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/key",
|
|
20327
|
+
schemaPath: "key-combo/properties/key/minLength",
|
|
20328
|
+
keyword: "minLength",
|
|
20329
|
+
params: { limit: 1 },
|
|
20330
|
+
message: "must NOT have fewer than 1 characters"
|
|
20331
|
+
};
|
|
20332
|
+
if (vErrors === null) vErrors = [err6];
|
|
20333
|
+
else vErrors.push(err6);
|
|
20334
|
+
errors++;
|
|
20335
|
+
}
|
|
20336
|
+
} else {
|
|
20337
|
+
const err7 = {
|
|
20338
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/key",
|
|
20339
|
+
schemaPath: "key-combo/properties/key/type",
|
|
20340
|
+
keyword: "type",
|
|
20341
|
+
params: { type: "string" },
|
|
20342
|
+
message: "must be string"
|
|
20343
|
+
};
|
|
20344
|
+
if (vErrors === null) vErrors = [err7];
|
|
20345
|
+
else vErrors.push(err7);
|
|
20346
|
+
errors++;
|
|
20347
|
+
}
|
|
20348
|
+
}
|
|
20349
|
+
var valid7 = _errs30 === errors;
|
|
20350
|
+
} else var valid7 = true;
|
|
20351
|
+
if (valid7) {
|
|
20352
|
+
if (data8.cmd !== void 0) {
|
|
20353
|
+
const _errs32 = errors;
|
|
20354
|
+
if (typeof data8.cmd !== "boolean") {
|
|
20355
|
+
const err8 = {
|
|
20356
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/cmd",
|
|
20357
|
+
schemaPath: "key-combo/properties/cmd/type",
|
|
20358
|
+
keyword: "type",
|
|
20359
|
+
params: { type: "boolean" },
|
|
20360
|
+
message: "must be boolean"
|
|
20361
|
+
};
|
|
20362
|
+
if (vErrors === null) vErrors = [err8];
|
|
20363
|
+
else vErrors.push(err8);
|
|
20364
|
+
errors++;
|
|
20365
|
+
}
|
|
20366
|
+
var valid7 = _errs32 === errors;
|
|
20367
|
+
} else var valid7 = true;
|
|
20368
|
+
if (valid7) {
|
|
20369
|
+
if (data8.ctrl !== void 0) {
|
|
20370
|
+
const _errs34 = errors;
|
|
20371
|
+
if (typeof data8.ctrl !== "boolean") {
|
|
20372
|
+
const err9 = {
|
|
20373
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/ctrl",
|
|
20374
|
+
schemaPath: "key-combo/properties/ctrl/type",
|
|
20375
|
+
keyword: "type",
|
|
20376
|
+
params: { type: "boolean" },
|
|
20377
|
+
message: "must be boolean"
|
|
20378
|
+
};
|
|
20379
|
+
if (vErrors === null) vErrors = [err9];
|
|
20380
|
+
else vErrors.push(err9);
|
|
20381
|
+
errors++;
|
|
20382
|
+
}
|
|
20383
|
+
var valid7 = _errs34 === errors;
|
|
20384
|
+
} else var valid7 = true;
|
|
20385
|
+
if (valid7) {
|
|
20386
|
+
if (data8.shift !== void 0) {
|
|
20387
|
+
const _errs36 = errors;
|
|
20388
|
+
if (typeof data8.shift !== "boolean") {
|
|
20389
|
+
const err10 = {
|
|
20390
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/shift",
|
|
20391
|
+
schemaPath: "key-combo/properties/shift/type",
|
|
20392
|
+
keyword: "type",
|
|
20393
|
+
params: { type: "boolean" },
|
|
20394
|
+
message: "must be boolean"
|
|
20395
|
+
};
|
|
20396
|
+
if (vErrors === null) vErrors = [err10];
|
|
20397
|
+
else vErrors.push(err10);
|
|
20398
|
+
errors++;
|
|
20399
|
+
}
|
|
20400
|
+
var valid7 = _errs36 === errors;
|
|
20401
|
+
} else var valid7 = true;
|
|
20402
|
+
if (valid7) {
|
|
20403
|
+
if (data8.alt !== void 0) {
|
|
20404
|
+
const _errs38 = errors;
|
|
20405
|
+
if (typeof data8.alt !== "boolean") {
|
|
20406
|
+
const err11 = {
|
|
20407
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/alt",
|
|
20408
|
+
schemaPath: "key-combo/properties/alt/type",
|
|
20409
|
+
keyword: "type",
|
|
20410
|
+
params: { type: "boolean" },
|
|
20411
|
+
message: "must be boolean"
|
|
20412
|
+
};
|
|
20413
|
+
if (vErrors === null) vErrors = [err11];
|
|
20414
|
+
else vErrors.push(err11);
|
|
20415
|
+
errors++;
|
|
20416
|
+
}
|
|
20417
|
+
var valid7 = _errs38 === errors;
|
|
20418
|
+
} else var valid7 = true;
|
|
20419
|
+
}
|
|
20420
|
+
}
|
|
20421
|
+
}
|
|
20422
|
+
}
|
|
20423
|
+
}
|
|
20424
|
+
}
|
|
20425
|
+
} else {
|
|
20426
|
+
const err12 = {
|
|
20427
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20428
|
+
schemaPath: "key-combo/type",
|
|
20429
|
+
keyword: "type",
|
|
20430
|
+
params: { type: "object" },
|
|
20431
|
+
message: "must be object"
|
|
20432
|
+
};
|
|
20433
|
+
if (vErrors === null) vErrors = [err12];
|
|
20434
|
+
else vErrors.push(err12);
|
|
20435
|
+
errors++;
|
|
20436
|
+
}
|
|
20437
|
+
}
|
|
20438
|
+
var _valid0 = _errs26 === errors;
|
|
20439
|
+
valid5 = valid5 || _valid0;
|
|
20440
|
+
}
|
|
20441
|
+
if (!valid5) {
|
|
20442
|
+
const err13 = {
|
|
20443
|
+
instancePath: instancePath + "/shortcuts/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),
|
|
20444
|
+
schemaPath: "#/properties/shortcuts/additionalProperties/anyOf",
|
|
20445
|
+
keyword: "anyOf",
|
|
20446
|
+
params: {},
|
|
20447
|
+
message: "must match a schema in anyOf"
|
|
20448
|
+
};
|
|
20449
|
+
if (vErrors === null) vErrors = [err13];
|
|
20450
|
+
else vErrors.push(err13);
|
|
20451
|
+
errors++;
|
|
20452
|
+
validate17.errors = vErrors;
|
|
20453
|
+
return false;
|
|
20454
|
+
} else {
|
|
20455
|
+
errors = _errs23;
|
|
20456
|
+
if (vErrors !== null) {
|
|
20457
|
+
if (_errs23) vErrors.length = _errs23;
|
|
20458
|
+
else vErrors = null;
|
|
20459
|
+
}
|
|
20460
|
+
}
|
|
20461
|
+
if (!(_errs22 === errors)) break;
|
|
20462
|
+
}
|
|
20463
|
+
}
|
|
20464
|
+
} else {
|
|
20465
|
+
validate17.errors = [{
|
|
20466
|
+
instancePath: instancePath + "/shortcuts",
|
|
20467
|
+
schemaPath: "#/properties/shortcuts/type",
|
|
20468
|
+
keyword: "type",
|
|
20469
|
+
params: { type: "object" },
|
|
20470
|
+
message: "must be object"
|
|
20471
|
+
}];
|
|
20472
|
+
return false;
|
|
20473
|
+
}
|
|
20474
|
+
}
|
|
20475
|
+
var valid0 = _errs18 === errors;
|
|
20476
|
+
} else var valid0 = true;
|
|
20477
|
+
if (valid0) {
|
|
20478
|
+
if (data.palette !== void 0) {
|
|
20479
|
+
let data14 = data.palette;
|
|
20480
|
+
const _errs40 = errors;
|
|
20481
|
+
if (errors === _errs40) {
|
|
20482
|
+
if (Array.isArray(data14)) {
|
|
20483
|
+
if (data14.length > 1e3) {
|
|
20484
|
+
validate17.errors = [{
|
|
20485
|
+
instancePath: instancePath + "/palette",
|
|
20486
|
+
schemaPath: "#/properties/palette/maxItems",
|
|
20487
|
+
keyword: "maxItems",
|
|
20488
|
+
params: { limit: 1e3 },
|
|
20489
|
+
message: "must NOT have more than 1000 items"
|
|
20490
|
+
}];
|
|
20491
|
+
return false;
|
|
20492
|
+
} else {
|
|
20493
|
+
const len0 = data14.length;
|
|
20494
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
20495
|
+
let data15 = data14[i0];
|
|
20496
|
+
const _errs42 = errors;
|
|
20497
|
+
if (errors === _errs42) {
|
|
20498
|
+
if (typeof data15 === "string") {
|
|
20499
|
+
if (!pattern7.test(data15)) {
|
|
20500
|
+
validate17.errors = [{
|
|
20501
|
+
instancePath: instancePath + "/palette/" + i0,
|
|
20502
|
+
schemaPath: "#/properties/palette/items/pattern",
|
|
20503
|
+
keyword: "pattern",
|
|
20504
|
+
params: { pattern: "^#[0-9a-fA-F]{6}$" },
|
|
20505
|
+
message: "must match pattern \"^#[0-9a-fA-F]{6}$\""
|
|
20506
|
+
}];
|
|
20507
|
+
return false;
|
|
20508
|
+
}
|
|
20509
|
+
} else {
|
|
20510
|
+
validate17.errors = [{
|
|
20511
|
+
instancePath: instancePath + "/palette/" + i0,
|
|
20512
|
+
schemaPath: "#/properties/palette/items/type",
|
|
20513
|
+
keyword: "type",
|
|
20514
|
+
params: { type: "string" },
|
|
20515
|
+
message: "must be string"
|
|
20516
|
+
}];
|
|
20517
|
+
return false;
|
|
20518
|
+
}
|
|
20519
|
+
}
|
|
20520
|
+
if (!(_errs42 === errors)) break;
|
|
20521
|
+
}
|
|
20522
|
+
}
|
|
20523
|
+
} else {
|
|
20524
|
+
validate17.errors = [{
|
|
20525
|
+
instancePath: instancePath + "/palette",
|
|
20526
|
+
schemaPath: "#/properties/palette/type",
|
|
20527
|
+
keyword: "type",
|
|
20528
|
+
params: { type: "array" },
|
|
20529
|
+
message: "must be array"
|
|
20530
|
+
}];
|
|
20531
|
+
return false;
|
|
20532
|
+
}
|
|
20533
|
+
}
|
|
20534
|
+
var valid0 = _errs40 === errors;
|
|
20535
|
+
} else var valid0 = true;
|
|
20536
|
+
if (valid0) {
|
|
20537
|
+
if (data.colours !== void 0) {
|
|
20538
|
+
let data16 = data.colours;
|
|
20539
|
+
const _errs44 = errors;
|
|
20540
|
+
if (errors === _errs44) {
|
|
20541
|
+
if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
|
|
20542
|
+
let missing1;
|
|
20543
|
+
if (data16.foreground === void 0 && (missing1 = "foreground") || data16.background === void 0 && (missing1 = "background")) {
|
|
20544
|
+
validate17.errors = [{
|
|
20545
|
+
instancePath: instancePath + "/colours",
|
|
20546
|
+
schemaPath: "#/properties/colours/required",
|
|
20547
|
+
keyword: "required",
|
|
20548
|
+
params: { missingProperty: missing1 },
|
|
20549
|
+
message: "must have required property '" + missing1 + "'"
|
|
20550
|
+
}];
|
|
20551
|
+
return false;
|
|
20552
|
+
} else {
|
|
20553
|
+
const _errs46 = errors;
|
|
20554
|
+
for (const key6 in data16) if (!(key6 === "foreground" || key6 === "background")) {
|
|
20555
|
+
validate17.errors = [{
|
|
20556
|
+
instancePath: instancePath + "/colours",
|
|
20557
|
+
schemaPath: "#/properties/colours/additionalProperties",
|
|
20558
|
+
keyword: "additionalProperties",
|
|
20559
|
+
params: { additionalProperty: key6 },
|
|
20560
|
+
message: "must NOT have additional properties"
|
|
20561
|
+
}];
|
|
20562
|
+
return false;
|
|
20563
|
+
}
|
|
20564
|
+
if (_errs46 === errors) {
|
|
20565
|
+
if (data16.foreground !== void 0) {
|
|
20566
|
+
let data17 = data16.foreground;
|
|
20567
|
+
const _errs47 = errors;
|
|
20568
|
+
if (errors === _errs47) {
|
|
20569
|
+
if (typeof data17 === "string") {
|
|
20570
|
+
if (!pattern7.test(data17)) {
|
|
20571
|
+
validate17.errors = [{
|
|
20572
|
+
instancePath: instancePath + "/colours/foreground",
|
|
20573
|
+
schemaPath: "#/properties/colours/properties/foreground/pattern",
|
|
20574
|
+
keyword: "pattern",
|
|
20575
|
+
params: { pattern: "^#[0-9a-fA-F]{6}$" },
|
|
20576
|
+
message: "must match pattern \"^#[0-9a-fA-F]{6}$\""
|
|
20577
|
+
}];
|
|
20578
|
+
return false;
|
|
20579
|
+
}
|
|
20580
|
+
} else {
|
|
20581
|
+
validate17.errors = [{
|
|
20582
|
+
instancePath: instancePath + "/colours/foreground",
|
|
20583
|
+
schemaPath: "#/properties/colours/properties/foreground/type",
|
|
20584
|
+
keyword: "type",
|
|
20585
|
+
params: { type: "string" },
|
|
20586
|
+
message: "must be string"
|
|
20587
|
+
}];
|
|
20588
|
+
return false;
|
|
20589
|
+
}
|
|
20590
|
+
}
|
|
20591
|
+
var valid9 = _errs47 === errors;
|
|
20592
|
+
} else var valid9 = true;
|
|
20593
|
+
if (valid9) {
|
|
20594
|
+
if (data16.background !== void 0) {
|
|
20595
|
+
let data18 = data16.background;
|
|
20596
|
+
const _errs49 = errors;
|
|
20597
|
+
if (errors === _errs49) {
|
|
20598
|
+
if (typeof data18 === "string") {
|
|
20599
|
+
if (!pattern7.test(data18)) {
|
|
20600
|
+
validate17.errors = [{
|
|
20601
|
+
instancePath: instancePath + "/colours/background",
|
|
20602
|
+
schemaPath: "#/properties/colours/properties/background/pattern",
|
|
20603
|
+
keyword: "pattern",
|
|
20604
|
+
params: { pattern: "^#[0-9a-fA-F]{6}$" },
|
|
20605
|
+
message: "must match pattern \"^#[0-9a-fA-F]{6}$\""
|
|
20606
|
+
}];
|
|
20607
|
+
return false;
|
|
20608
|
+
}
|
|
20609
|
+
} else {
|
|
20610
|
+
validate17.errors = [{
|
|
20611
|
+
instancePath: instancePath + "/colours/background",
|
|
20612
|
+
schemaPath: "#/properties/colours/properties/background/type",
|
|
20613
|
+
keyword: "type",
|
|
20614
|
+
params: { type: "string" },
|
|
20615
|
+
message: "must be string"
|
|
20616
|
+
}];
|
|
20617
|
+
return false;
|
|
20618
|
+
}
|
|
20619
|
+
}
|
|
20620
|
+
var valid9 = _errs49 === errors;
|
|
20621
|
+
} else var valid9 = true;
|
|
20622
|
+
}
|
|
20623
|
+
}
|
|
20624
|
+
}
|
|
20625
|
+
} else {
|
|
20626
|
+
validate17.errors = [{
|
|
20627
|
+
instancePath: instancePath + "/colours",
|
|
20628
|
+
schemaPath: "#/properties/colours/type",
|
|
20629
|
+
keyword: "type",
|
|
20630
|
+
params: { type: "object" },
|
|
20631
|
+
message: "must be object"
|
|
20632
|
+
}];
|
|
20633
|
+
return false;
|
|
20634
|
+
}
|
|
20635
|
+
}
|
|
20636
|
+
var valid0 = _errs44 === errors;
|
|
20637
|
+
} else var valid0 = true;
|
|
20638
|
+
if (valid0) {
|
|
20639
|
+
if (data.ui !== void 0) {
|
|
20640
|
+
let data19 = data.ui;
|
|
20641
|
+
const _errs51 = errors;
|
|
20642
|
+
if (errors === _errs51) {
|
|
20643
|
+
if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
|
|
20644
|
+
const _errs53 = errors;
|
|
20645
|
+
for (const key7 in data19) if (!(key7 === "theme" || key7 === "locale")) {
|
|
20646
|
+
validate17.errors = [{
|
|
20647
|
+
instancePath: instancePath + "/ui",
|
|
20648
|
+
schemaPath: "#/properties/ui/additionalProperties",
|
|
20649
|
+
keyword: "additionalProperties",
|
|
20650
|
+
params: { additionalProperty: key7 },
|
|
20651
|
+
message: "must NOT have additional properties"
|
|
20652
|
+
}];
|
|
20653
|
+
return false;
|
|
20654
|
+
}
|
|
20655
|
+
if (_errs53 === errors) {
|
|
20656
|
+
if (data19.theme !== void 0) {
|
|
20657
|
+
let data20 = data19.theme;
|
|
20658
|
+
const _errs54 = errors;
|
|
20659
|
+
if (!(data20 === "light" || data20 === "dark" || data20 === "system")) {
|
|
20660
|
+
validate17.errors = [{
|
|
20661
|
+
instancePath: instancePath + "/ui/theme",
|
|
20662
|
+
schemaPath: "#/properties/ui/properties/theme/enum",
|
|
20663
|
+
keyword: "enum",
|
|
20664
|
+
params: { allowedValues: schema20.properties.ui.properties.theme.enum },
|
|
20665
|
+
message: "must be equal to one of the allowed values"
|
|
20666
|
+
}];
|
|
20667
|
+
return false;
|
|
20668
|
+
}
|
|
20669
|
+
var valid10 = _errs54 === errors;
|
|
20670
|
+
} else var valid10 = true;
|
|
20671
|
+
if (valid10) {
|
|
20672
|
+
if (data19.locale !== void 0) {
|
|
20673
|
+
let data21 = data19.locale;
|
|
20674
|
+
const _errs55 = errors;
|
|
20675
|
+
if (errors === _errs55) {
|
|
20676
|
+
if (typeof data21 === "string") {
|
|
20677
|
+
if (data21.length > 35) {
|
|
20678
|
+
validate17.errors = [{
|
|
20679
|
+
instancePath: instancePath + "/ui/locale",
|
|
20680
|
+
schemaPath: "#/properties/ui/properties/locale/maxLength",
|
|
20681
|
+
keyword: "maxLength",
|
|
20682
|
+
params: { limit: 35 },
|
|
20683
|
+
message: "must NOT have more than 35 characters"
|
|
20684
|
+
}];
|
|
20685
|
+
return false;
|
|
20686
|
+
} else if (data21.length < 1) {
|
|
20687
|
+
validate17.errors = [{
|
|
20688
|
+
instancePath: instancePath + "/ui/locale",
|
|
20689
|
+
schemaPath: "#/properties/ui/properties/locale/minLength",
|
|
20690
|
+
keyword: "minLength",
|
|
20691
|
+
params: { limit: 1 },
|
|
20692
|
+
message: "must NOT have fewer than 1 characters"
|
|
20693
|
+
}];
|
|
20694
|
+
return false;
|
|
20695
|
+
} else if (!pattern16.test(data21)) {
|
|
20696
|
+
validate17.errors = [{
|
|
20697
|
+
instancePath: instancePath + "/ui/locale",
|
|
20698
|
+
schemaPath: "#/properties/ui/properties/locale/pattern",
|
|
20699
|
+
keyword: "pattern",
|
|
20700
|
+
params: { pattern: "^[A-Za-z0-9-]+$" },
|
|
20701
|
+
message: "must match pattern \"^[A-Za-z0-9-]+$\""
|
|
20702
|
+
}];
|
|
20703
|
+
return false;
|
|
20704
|
+
}
|
|
20705
|
+
} else {
|
|
20706
|
+
validate17.errors = [{
|
|
20707
|
+
instancePath: instancePath + "/ui/locale",
|
|
20708
|
+
schemaPath: "#/properties/ui/properties/locale/type",
|
|
20709
|
+
keyword: "type",
|
|
20710
|
+
params: { type: "string" },
|
|
20711
|
+
message: "must be string"
|
|
20712
|
+
}];
|
|
20713
|
+
return false;
|
|
20714
|
+
}
|
|
20715
|
+
}
|
|
20716
|
+
var valid10 = _errs55 === errors;
|
|
20717
|
+
} else var valid10 = true;
|
|
20718
|
+
}
|
|
20719
|
+
}
|
|
20720
|
+
} else {
|
|
20721
|
+
validate17.errors = [{
|
|
20722
|
+
instancePath: instancePath + "/ui",
|
|
20723
|
+
schemaPath: "#/properties/ui/type",
|
|
20724
|
+
keyword: "type",
|
|
20725
|
+
params: { type: "object" },
|
|
20726
|
+
message: "must be object"
|
|
20727
|
+
}];
|
|
20728
|
+
return false;
|
|
20729
|
+
}
|
|
20730
|
+
}
|
|
20731
|
+
var valid0 = _errs51 === errors;
|
|
20732
|
+
} else var valid0 = true;
|
|
20733
|
+
}
|
|
20734
|
+
}
|
|
20735
|
+
}
|
|
20736
|
+
}
|
|
20737
|
+
}
|
|
20738
|
+
} else {
|
|
20739
|
+
validate17.errors = [{
|
|
20740
|
+
instancePath,
|
|
20741
|
+
schemaPath: "#/type",
|
|
20742
|
+
keyword: "type",
|
|
20743
|
+
params: { type: "object" },
|
|
20744
|
+
message: "must be object"
|
|
20745
|
+
}];
|
|
20746
|
+
return false;
|
|
20747
|
+
}
|
|
20748
|
+
}
|
|
20749
|
+
validate17.errors = vErrors;
|
|
20750
|
+
return errors === 0;
|
|
20751
|
+
}
|
|
20752
|
+
var validateSettingsFile = validate18;
|
|
20753
|
+
function validate18(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
20754
|
+
let vErrors = null;
|
|
20755
|
+
let errors = 0;
|
|
20756
|
+
if (errors === 0) {
|
|
20757
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
20758
|
+
let missing0;
|
|
20759
|
+
if (data.format === void 0 && (missing0 = "format") || data.version === void 0 && (missing0 = "version") || data.settings === void 0 && (missing0 = "settings")) {
|
|
20760
|
+
validate18.errors = [{
|
|
20761
|
+
instancePath,
|
|
20762
|
+
schemaPath: "#/required",
|
|
20763
|
+
keyword: "required",
|
|
20764
|
+
params: { missingProperty: missing0 },
|
|
20765
|
+
message: "must have required property '" + missing0 + "'"
|
|
20766
|
+
}];
|
|
20767
|
+
return false;
|
|
20768
|
+
} else {
|
|
20769
|
+
const _errs1 = errors;
|
|
20770
|
+
for (const key0 in data) if (!(key0 === "format" || key0 === "version" || key0 === "settings")) {
|
|
20771
|
+
validate18.errors = [{
|
|
20772
|
+
instancePath,
|
|
20773
|
+
schemaPath: "#/additionalProperties",
|
|
20774
|
+
keyword: "additionalProperties",
|
|
20775
|
+
params: { additionalProperty: key0 },
|
|
20776
|
+
message: "must NOT have additional properties"
|
|
20777
|
+
}];
|
|
20778
|
+
return false;
|
|
20779
|
+
}
|
|
20780
|
+
if (_errs1 === errors) {
|
|
20781
|
+
if (data.format !== void 0) {
|
|
20782
|
+
let data0 = data.format;
|
|
20783
|
+
const _errs2 = errors;
|
|
20784
|
+
if (errors === _errs2) {
|
|
20785
|
+
if (typeof data0 === "string") {
|
|
20786
|
+
if (data0.length > 100) {
|
|
20787
|
+
validate18.errors = [{
|
|
20788
|
+
instancePath: instancePath + "/format",
|
|
20789
|
+
schemaPath: "#/properties/format/maxLength",
|
|
20790
|
+
keyword: "maxLength",
|
|
20791
|
+
params: { limit: 100 },
|
|
20792
|
+
message: "must NOT have more than 100 characters"
|
|
20793
|
+
}];
|
|
20794
|
+
return false;
|
|
20795
|
+
} else if (data0.length < 1) {
|
|
20796
|
+
validate18.errors = [{
|
|
20797
|
+
instancePath: instancePath + "/format",
|
|
20798
|
+
schemaPath: "#/properties/format/minLength",
|
|
20799
|
+
keyword: "minLength",
|
|
20800
|
+
params: { limit: 1 },
|
|
20801
|
+
message: "must NOT have fewer than 1 characters"
|
|
20802
|
+
}];
|
|
20803
|
+
return false;
|
|
20804
|
+
}
|
|
20805
|
+
} else {
|
|
20806
|
+
validate18.errors = [{
|
|
20807
|
+
instancePath: instancePath + "/format",
|
|
20808
|
+
schemaPath: "#/properties/format/type",
|
|
20809
|
+
keyword: "type",
|
|
20810
|
+
params: { type: "string" },
|
|
20811
|
+
message: "must be string"
|
|
20812
|
+
}];
|
|
20813
|
+
return false;
|
|
20814
|
+
}
|
|
20815
|
+
}
|
|
20816
|
+
var valid0 = _errs2 === errors;
|
|
20817
|
+
} else var valid0 = true;
|
|
20818
|
+
if (valid0) {
|
|
20819
|
+
if (data.version !== void 0) {
|
|
20820
|
+
const _errs4 = errors;
|
|
20821
|
+
if (1 !== data.version) {
|
|
20822
|
+
validate18.errors = [{
|
|
20823
|
+
instancePath: instancePath + "/version",
|
|
20824
|
+
schemaPath: "#/properties/version/const",
|
|
20825
|
+
keyword: "const",
|
|
20826
|
+
params: { allowedValue: 1 },
|
|
20827
|
+
message: "must be equal to constant"
|
|
20828
|
+
}];
|
|
20829
|
+
return false;
|
|
20830
|
+
}
|
|
20831
|
+
var valid0 = _errs4 === errors;
|
|
20832
|
+
} else var valid0 = true;
|
|
20833
|
+
if (valid0) {
|
|
20834
|
+
if (data.settings !== void 0) {
|
|
20835
|
+
const _errs5 = errors;
|
|
20836
|
+
if (!validate17(data.settings, {
|
|
20837
|
+
instancePath: instancePath + "/settings",
|
|
20838
|
+
parentData: data,
|
|
20839
|
+
parentDataProperty: "settings",
|
|
20840
|
+
rootData
|
|
20841
|
+
})) {
|
|
20842
|
+
vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);
|
|
20843
|
+
errors = vErrors.length;
|
|
20844
|
+
}
|
|
20845
|
+
var valid0 = _errs5 === errors;
|
|
20846
|
+
} else var valid0 = true;
|
|
20847
|
+
}
|
|
20848
|
+
}
|
|
20849
|
+
}
|
|
20850
|
+
}
|
|
20851
|
+
} else {
|
|
20852
|
+
validate18.errors = [{
|
|
20853
|
+
instancePath,
|
|
20854
|
+
schemaPath: "#/type",
|
|
20855
|
+
keyword: "type",
|
|
20856
|
+
params: { type: "object" },
|
|
20857
|
+
message: "must be object"
|
|
20858
|
+
}];
|
|
20859
|
+
return false;
|
|
20860
|
+
}
|
|
20861
|
+
}
|
|
20862
|
+
validate18.errors = vErrors;
|
|
20863
|
+
return errors === 0;
|
|
20864
|
+
}
|
|
20865
|
+
export { validateBrushPreset, validateBrushPresetFile, validateDocument, validateHistoryMessage, validatePaletteFile, validatePatchMessage, validateSettings, validateSettingsFile, validateStrokeMessage };
|