@doenet/v06-to-v07 0.7.21-dev.349 → 0.7.21-dev.350

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.
@@ -39657,6 +39657,146 @@ function contrastAccessibilityDiagnosticsForStyleDefinitions(styleDefinitions) {
39657
39657
  }
39658
39658
  return diagnostics;
39659
39659
  }
39660
+ const defaultPalette = {
39661
+ name: "default",
39662
+ description: "The standard Doenet styles: blue, red, brown, purple, black, and gray.",
39663
+ styles: {
39664
+ 1: { ...DEFAULT_STYLE_VALUES },
39665
+ 2: {
39666
+ lineColor: "#D4042D",
39667
+ lineColorDarkMode: "#F1466A",
39668
+ lineOpacity: 0.7,
39669
+ lineWidth: 2,
39670
+ lineWidthWord: "",
39671
+ lineStyle: "solid",
39672
+ lineStyleWord: "",
39673
+ markerColor: "#D4042D",
39674
+ markerColorDarkMode: "#F1466A",
39675
+ markerOpacity: 0.7,
39676
+ markerStyle: "square",
39677
+ markerStyleWord: "square",
39678
+ markerSize: 5,
39679
+ fillColor: "#D4042D",
39680
+ fillColorDarkMode: "#F1466A",
39681
+ fillOpacity: 0.3,
39682
+ textColor: "#D4042D",
39683
+ textColorDarkMode: "#FF7A7A",
39684
+ highContrastColor: "#D4042D",
39685
+ highContrastColorDarkMode: "#FF7A7A"
39686
+ },
39687
+ 3: {
39688
+ lineColor: "#a6510c",
39689
+ lineColorDarkMode: "#F19143",
39690
+ lineOpacity: 0.7,
39691
+ lineWidth: 3,
39692
+ lineWidthWord: "",
39693
+ lineStyle: "solid",
39694
+ lineStyleWord: "",
39695
+ markerColor: "#a6510c",
39696
+ markerColorDarkMode: "#F19143",
39697
+ markerOpacity: 0.7,
39698
+ markerStyle: "triangle",
39699
+ markerStyleWord: "triangle",
39700
+ markerSize: 5,
39701
+ fillColor: "#a6510c",
39702
+ fillColorDarkMode: "#F19143",
39703
+ fillOpacity: 0.3,
39704
+ textColor: "#BE5A0E",
39705
+ textColorDarkMode: "#FFA94D",
39706
+ highContrastColor: "#BE5A0E",
39707
+ highContrastColorDarkMode: "#FFA94D"
39708
+ },
39709
+ 4: {
39710
+ lineColor: "#644CD6",
39711
+ lineColorDarkMode: "#9F8FE8",
39712
+ lineOpacity: 0.7,
39713
+ lineWidth: 2,
39714
+ lineWidthWord: "",
39715
+ lineStyle: "solid",
39716
+ lineStyleWord: "",
39717
+ markerColor: "#644CD6",
39718
+ markerColorDarkMode: "#9F8FE8",
39719
+ markerOpacity: 0.7,
39720
+ markerStyle: "diamond",
39721
+ markerStyleWord: "diamond",
39722
+ markerSize: 5,
39723
+ fillColor: "#644CD6",
39724
+ fillColorDarkMode: "#9F8FE8",
39725
+ fillOpacity: 0.3,
39726
+ textColor: "#644CD6",
39727
+ textColorDarkMode: "#B0A4EE",
39728
+ highContrastColor: "#644CD6",
39729
+ highContrastColorDarkMode: "#B0A4EE"
39730
+ },
39731
+ 5: {
39732
+ lineColor: "black",
39733
+ lineColorDarkMode: "white",
39734
+ lineOpacity: 1,
39735
+ lineWidth: 1,
39736
+ lineWidthWord: "thin",
39737
+ lineStyle: "solid",
39738
+ lineStyleWord: "",
39739
+ markerColor: "black",
39740
+ markerColorDarkMode: "white",
39741
+ markerOpacity: 1,
39742
+ markerStyle: "circle",
39743
+ markerStyleWord: "point",
39744
+ markerSize: 5,
39745
+ fillColor: "black",
39746
+ fillColorDarkMode: "white",
39747
+ fillOpacity: 0.7,
39748
+ textColor: "black",
39749
+ textColorDarkMode: "white",
39750
+ highContrastColor: "black",
39751
+ highContrastColorDarkMode: "white"
39752
+ },
39753
+ 6: {
39754
+ lineColor: "#636363",
39755
+ lineColorDarkMode: "#CCCCCC",
39756
+ lineOpacity: 0.7,
39757
+ lineWidth: 1,
39758
+ lineWidthWord: "thin",
39759
+ lineStyle: "dotted",
39760
+ lineStyleWord: "dotted",
39761
+ markerColor: "#636363",
39762
+ markerColorDarkMode: "#CCCCCC",
39763
+ markerOpacity: 0.7,
39764
+ markerStyle: "circle",
39765
+ markerStyleWord: "point",
39766
+ markerSize: 5,
39767
+ fillColor: "#636363",
39768
+ fillColorDarkMode: "#CCCCCC",
39769
+ fillOpacity: 0.3,
39770
+ textColor: "#757575",
39771
+ textColorDarkMode: "#B0B0B0",
39772
+ highContrastColor: "#757575",
39773
+ highContrastColorDarkMode: "#B0B0B0"
39774
+ }
39775
+ }
39776
+ };
39777
+ function deepFreezePalette(palette) {
39778
+ for (const styleDef of Object.values(palette.styles)) {
39779
+ for (const value of Object.values(styleDef)) {
39780
+ if (typeof value === "object" && value !== null) {
39781
+ Object.freeze(value);
39782
+ }
39783
+ }
39784
+ Object.freeze(styleDef);
39785
+ }
39786
+ Object.freeze(palette.styles);
39787
+ return Object.freeze(palette);
39788
+ }
39789
+ const STYLE_PALETTES = Object.assign(
39790
+ /* @__PURE__ */ Object.create(null),
39791
+ {
39792
+ [defaultPalette.name]: deepFreezePalette(defaultPalette)
39793
+ }
39794
+ );
39795
+ Object.freeze(STYLE_PALETTES);
39796
+ const DEFAULT_PALETTE_NAME = defaultPalette.name;
39797
+ Object.freeze(
39798
+ Object.keys(STYLE_PALETTES)
39799
+ );
39660
39800
  let styleAttributes$1 = {
39661
39801
  lineColor: {
39662
39802
  componentType: "text",
@@ -39977,12 +40117,6 @@ function addMissingColorWordsToStyleDefinition(styleDef) {
39977
40117
  }
39978
40118
  return styleDef;
39979
40119
  }
39980
- function addMissingColorWordsToStyleDefinitions(styleDefinitions) {
39981
- for (const styleDef of Object.values(styleDefinitions)) {
39982
- addMissingColorWordsToStyleDefinition(styleDef);
39983
- }
39984
- return styleDefinitions;
39985
- }
39986
40120
  function cloneDefaultStyleWithMissingColorWords() {
39987
40121
  return addMissingColorWordsToStyleDefinition(
39988
40122
  normalizeStyleDefinitionValues(Object.assign({}, defaultStyle))
@@ -40101,122 +40235,20 @@ function deriveMissingStyleWords(styleDef) {
40101
40235
  }
40102
40236
  }
40103
40237
  }
40238
+ function expandStylePalette(palette) {
40239
+ const styleDefinitions = normalizeStyleDefinitionsValues(palette.styles);
40240
+ for (const styleDef of Object.values(styleDefinitions)) {
40241
+ addMissingChildStyleColorFields(styleDef);
40242
+ deriveMissingStyleWords(styleDef);
40243
+ }
40244
+ return styleDefinitions;
40245
+ }
40246
+ function returnPaletteStyleDefinitions(paletteName) {
40247
+ const palette = STYLE_PALETTES[paletteName] ?? STYLE_PALETTES[DEFAULT_PALETTE_NAME];
40248
+ return expandStylePalette(palette);
40249
+ }
40104
40250
  function returnDefaultStyleDefinitions() {
40105
- return addMissingColorWordsToStyleDefinitions(
40106
- normalizeStyleDefinitionsValues({
40107
- 1: { ...DEFAULT_STYLE_VALUES },
40108
- 2: {
40109
- lineColor: "#D4042D",
40110
- lineColorDarkMode: "#F1466A",
40111
- lineOpacity: 0.7,
40112
- lineWidth: 2,
40113
- lineWidthWord: "",
40114
- lineStyle: "solid",
40115
- lineStyleWord: "",
40116
- markerColor: "#D4042D",
40117
- markerColorDarkMode: "#F1466A",
40118
- markerOpacity: 0.7,
40119
- markerStyle: "square",
40120
- markerStyleWord: "square",
40121
- markerSize: 5,
40122
- fillColor: "#D4042D",
40123
- fillColorDarkMode: "#F1466A",
40124
- fillOpacity: 0.3,
40125
- textColor: "#D4042D",
40126
- textColorDarkMode: "#FF7A7A",
40127
- highContrastColor: "#D4042D",
40128
- highContrastColorDarkMode: "#FF7A7A"
40129
- },
40130
- 3: {
40131
- lineColor: "#a6510c",
40132
- lineColorDarkMode: "#F19143",
40133
- lineOpacity: 0.7,
40134
- lineWidth: 3,
40135
- lineWidthWord: "",
40136
- lineStyle: "solid",
40137
- lineStyleWord: "",
40138
- markerColor: "#a6510c",
40139
- markerColorDarkMode: "#F19143",
40140
- markerOpacity: 0.7,
40141
- markerStyle: "triangle",
40142
- markerStyleWord: "triangle",
40143
- markerSize: 5,
40144
- fillColor: "#a6510c",
40145
- fillColorDarkMode: "#F19143",
40146
- fillOpacity: 0.3,
40147
- textColor: "#BE5A0E",
40148
- textColorDarkMode: "#FFA94D",
40149
- highContrastColor: "#BE5A0E",
40150
- highContrastColorDarkMode: "#FFA94D"
40151
- },
40152
- 4: {
40153
- lineColor: "#644CD6",
40154
- lineColorDarkMode: "#9F8FE8",
40155
- lineOpacity: 0.7,
40156
- lineWidth: 2,
40157
- lineWidthWord: "",
40158
- lineStyle: "solid",
40159
- lineStyleWord: "",
40160
- markerColor: "#644CD6",
40161
- markerColorDarkMode: "#9F8FE8",
40162
- markerOpacity: 0.7,
40163
- markerStyle: "diamond",
40164
- markerStyleWord: "diamond",
40165
- markerSize: 5,
40166
- fillColor: "#644CD6",
40167
- fillColorDarkMode: "#9F8FE8",
40168
- fillOpacity: 0.3,
40169
- textColor: "#644CD6",
40170
- textColorDarkMode: "#B0A4EE",
40171
- highContrastColor: "#644CD6",
40172
- highContrastColorDarkMode: "#B0A4EE"
40173
- },
40174
- 5: {
40175
- lineColor: "black",
40176
- lineColorDarkMode: "white",
40177
- lineOpacity: 1,
40178
- lineWidth: 1,
40179
- lineWidthWord: "thin",
40180
- lineStyle: "solid",
40181
- lineStyleWord: "",
40182
- markerColor: "black",
40183
- markerColorDarkMode: "white",
40184
- markerOpacity: 1,
40185
- markerStyle: "circle",
40186
- markerStyleWord: "point",
40187
- markerSize: 5,
40188
- fillColor: "black",
40189
- fillColorDarkMode: "white",
40190
- fillOpacity: 0.7,
40191
- textColor: "black",
40192
- textColorDarkMode: "white",
40193
- highContrastColor: "black",
40194
- highContrastColorDarkMode: "white"
40195
- },
40196
- 6: {
40197
- lineColor: "#636363",
40198
- lineColorDarkMode: "#CCCCCC",
40199
- lineOpacity: 0.7,
40200
- lineWidth: 1,
40201
- lineWidthWord: "thin",
40202
- lineStyle: "dotted",
40203
- lineStyleWord: "dotted",
40204
- markerColor: "#636363",
40205
- markerColorDarkMode: "#CCCCCC",
40206
- markerOpacity: 0.7,
40207
- markerStyle: "circle",
40208
- markerStyleWord: "point",
40209
- markerSize: 5,
40210
- fillColor: "#636363",
40211
- fillColorDarkMode: "#CCCCCC",
40212
- fillOpacity: 0.3,
40213
- textColor: "#757575",
40214
- textColorDarkMode: "#B0B0B0",
40215
- highContrastColor: "#757575",
40216
- highContrastColorDarkMode: "#B0B0B0"
40217
- }
40218
- })
40219
- );
40251
+ return returnPaletteStyleDefinitions(DEFAULT_PALETTE_NAME);
40220
40252
  }
40221
40253
  function returnStyleDefinitionStateVariables() {
40222
40254
  let stateVariableDefinitions = {};
@@ -40963,7 +40995,7 @@ async function cidFromArrayBuffer(data) {
40963
40995
  await crypto.subtle.digest("SHA-256", new Uint8Array());
40964
40996
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
40965
40997
  } catch (e22) {
40966
- const sha256 = (await import("./sha256-C0vj3HDn-2ZVsF5sB-of0rpByP.js").then((n2) => n2.s)).default;
40998
+ const sha256 = (await import("./sha256-BkqdbTk5-DJqpGJ6G-CltE9V4o.js").then((n2) => n2.s)).default;
40967
40999
  digest = (data2) => sha256(data2, {
40968
41000
  asBytes: true
40969
41001
  });
@@ -230505,4 +230537,4 @@ export {
230505
230537
  getDefaultExportFromCjs as g,
230506
230538
  updateSyntaxFromV06toV07 as u
230507
230539
  };
230508
- //# sourceMappingURL=index-BYsyeLZj.js.map
230540
+ //# sourceMappingURL=index-Cli_70GV.js.map