microboard-temp 0.1.13 → 0.1.15

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.
@@ -2097,115 +2097,6 @@ var require_escape_html = __commonJS((exports2, module2) => {
2097
2097
  }
2098
2098
  });
2099
2099
 
2100
- // node_modules/canvas/lib/parse-font.js
2101
- var require_parse_font = __commonJS((exports2, module2) => {
2102
- var weights = "bold|bolder|lighter|[1-9]00";
2103
- var styles2 = "italic|oblique";
2104
- var variants = "small-caps";
2105
- var stretches = "ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded";
2106
- var units = "px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q";
2107
- var string5 = `'([^']+)'|"([^"]+)"|[\\w\\s-]+`;
2108
- var weightRe = new RegExp(`(${weights}) +`, "i");
2109
- var styleRe = new RegExp(`(${styles2}) +`, "i");
2110
- var variantRe = new RegExp(`(${variants}) +`, "i");
2111
- var stretchRe = new RegExp(`(${stretches}) +`, "i");
2112
- var sizeFamilyRe = new RegExp(`([\\d\\.]+)(${units}) *((?:${string5})( *, *(?:${string5}))*)`);
2113
- var cache2 = {};
2114
- var defaultHeight = 16;
2115
- module2.exports = (str) => {
2116
- if (cache2[str])
2117
- return cache2[str];
2118
- const sizeFamily = sizeFamilyRe.exec(str);
2119
- if (!sizeFamily)
2120
- return;
2121
- const font = {
2122
- weight: "normal",
2123
- style: "normal",
2124
- stretch: "normal",
2125
- variant: "normal",
2126
- size: parseFloat(sizeFamily[1]),
2127
- unit: sizeFamily[2],
2128
- family: sizeFamily[3].replace(/["']/g, "").replace(/ *, */g, ",")
2129
- };
2130
- let weight, style2, variant, stretch;
2131
- const substr = str.substring(0, sizeFamily.index);
2132
- if (weight = weightRe.exec(substr))
2133
- font.weight = weight[1];
2134
- if (style2 = styleRe.exec(substr))
2135
- font.style = style2[1];
2136
- if (variant = variantRe.exec(substr))
2137
- font.variant = variant[1];
2138
- if (stretch = stretchRe.exec(substr))
2139
- font.stretch = stretch[1];
2140
- switch (font.unit) {
2141
- case "pt":
2142
- font.size /= 0.75;
2143
- break;
2144
- case "pc":
2145
- font.size *= 16;
2146
- break;
2147
- case "in":
2148
- font.size *= 96;
2149
- break;
2150
- case "cm":
2151
- font.size *= 96 / 2.54;
2152
- break;
2153
- case "mm":
2154
- font.size *= 96 / 25.4;
2155
- break;
2156
- case "%":
2157
- break;
2158
- case "em":
2159
- case "rem":
2160
- font.size *= defaultHeight / 0.75;
2161
- break;
2162
- case "q":
2163
- font.size *= 96 / 25.4 / 4;
2164
- break;
2165
- }
2166
- return cache2[str] = font;
2167
- };
2168
- });
2169
-
2170
- // node_modules/canvas/browser.js
2171
- var require_browser2 = __commonJS((exports2) => {
2172
- var parseFont = require_parse_font();
2173
- exports2.parseFont = parseFont;
2174
- exports2.createCanvas = function(width2, height3) {
2175
- return Object.assign(document.createElement("canvas"), { width: width2, height: height3 });
2176
- };
2177
- exports2.createImageData = function(array, width2, height3) {
2178
- switch (arguments.length) {
2179
- case 0:
2180
- return new ImageData;
2181
- case 1:
2182
- return new ImageData(array);
2183
- case 2:
2184
- return new ImageData(array, width2);
2185
- default:
2186
- return new ImageData(array, width2, height3);
2187
- }
2188
- };
2189
- exports2.loadImage = function(src, options) {
2190
- return new Promise(function(resolve2, reject) {
2191
- const image2 = Object.assign(document.createElement("img"), options);
2192
- function cleanup() {
2193
- image2.onload = null;
2194
- image2.onerror = null;
2195
- }
2196
- image2.onload = function() {
2197
- cleanup();
2198
- resolve2(image2);
2199
- };
2200
- image2.onerror = function() {
2201
- cleanup();
2202
- reject(new Error('Failed to load the image "' + src + '"'));
2203
- };
2204
- image2.src = src;
2205
- });
2206
- };
2207
- });
2208
-
2209
2100
  // src/browser.ts
2210
2101
  var exports_browser = {};
2211
2102
  __export(exports_browser, {
@@ -61062,7 +60953,7 @@ function getMeasureCtx() {
61062
60953
  }
61063
60954
  return measureCtx;
61064
60955
  } else {
61065
- const { Canvas } = require_browser2();
60956
+ const { Canvas } = require("canvas");
61066
60957
  const canvas = new Canvas(1, 1);
61067
60958
  const context = canvas.getContext("2d");
61068
60959
  return context;