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.
@@ -24,6 +24,13 @@ var __export = (target, all) => {
24
24
  set: (newValue) => all[name] = () => newValue
25
25
  });
26
26
  };
27
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
28
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
29
+ }) : x)(function(x) {
30
+ if (typeof require !== "undefined")
31
+ return require.apply(this, arguments);
32
+ throw Error('Dynamic require of "' + x + '" is not supported');
33
+ });
27
34
 
28
35
  // node_modules/direction/index.js
29
36
  var require_direction = __commonJS((exports, module) => {
@@ -2085,115 +2092,6 @@ var require_escape_html = __commonJS((exports, module) => {
2085
2092
  }
2086
2093
  });
2087
2094
 
2088
- // node_modules/canvas/lib/parse-font.js
2089
- var require_parse_font = __commonJS((exports, module) => {
2090
- var weights = "bold|bolder|lighter|[1-9]00";
2091
- var styles2 = "italic|oblique";
2092
- var variants = "small-caps";
2093
- var stretches = "ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded";
2094
- var units = "px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q";
2095
- var string5 = `'([^']+)'|"([^"]+)"|[\\w\\s-]+`;
2096
- var weightRe = new RegExp(`(${weights}) +`, "i");
2097
- var styleRe = new RegExp(`(${styles2}) +`, "i");
2098
- var variantRe = new RegExp(`(${variants}) +`, "i");
2099
- var stretchRe = new RegExp(`(${stretches}) +`, "i");
2100
- var sizeFamilyRe = new RegExp(`([\\d\\.]+)(${units}) *((?:${string5})( *, *(?:${string5}))*)`);
2101
- var cache2 = {};
2102
- var defaultHeight = 16;
2103
- module.exports = (str) => {
2104
- if (cache2[str])
2105
- return cache2[str];
2106
- const sizeFamily = sizeFamilyRe.exec(str);
2107
- if (!sizeFamily)
2108
- return;
2109
- const font = {
2110
- weight: "normal",
2111
- style: "normal",
2112
- stretch: "normal",
2113
- variant: "normal",
2114
- size: parseFloat(sizeFamily[1]),
2115
- unit: sizeFamily[2],
2116
- family: sizeFamily[3].replace(/["']/g, "").replace(/ *, */g, ",")
2117
- };
2118
- let weight, style2, variant, stretch;
2119
- const substr = str.substring(0, sizeFamily.index);
2120
- if (weight = weightRe.exec(substr))
2121
- font.weight = weight[1];
2122
- if (style2 = styleRe.exec(substr))
2123
- font.style = style2[1];
2124
- if (variant = variantRe.exec(substr))
2125
- font.variant = variant[1];
2126
- if (stretch = stretchRe.exec(substr))
2127
- font.stretch = stretch[1];
2128
- switch (font.unit) {
2129
- case "pt":
2130
- font.size /= 0.75;
2131
- break;
2132
- case "pc":
2133
- font.size *= 16;
2134
- break;
2135
- case "in":
2136
- font.size *= 96;
2137
- break;
2138
- case "cm":
2139
- font.size *= 96 / 2.54;
2140
- break;
2141
- case "mm":
2142
- font.size *= 96 / 25.4;
2143
- break;
2144
- case "%":
2145
- break;
2146
- case "em":
2147
- case "rem":
2148
- font.size *= defaultHeight / 0.75;
2149
- break;
2150
- case "q":
2151
- font.size *= 96 / 25.4 / 4;
2152
- break;
2153
- }
2154
- return cache2[str] = font;
2155
- };
2156
- });
2157
-
2158
- // node_modules/canvas/browser.js
2159
- var require_browser2 = __commonJS((exports) => {
2160
- var parseFont = require_parse_font();
2161
- exports.parseFont = parseFont;
2162
- exports.createCanvas = function(width2, height3) {
2163
- return Object.assign(document.createElement("canvas"), { width: width2, height: height3 });
2164
- };
2165
- exports.createImageData = function(array, width2, height3) {
2166
- switch (arguments.length) {
2167
- case 0:
2168
- return new ImageData;
2169
- case 1:
2170
- return new ImageData(array);
2171
- case 2:
2172
- return new ImageData(array, width2);
2173
- default:
2174
- return new ImageData(array, width2, height3);
2175
- }
2176
- };
2177
- exports.loadImage = function(src, options) {
2178
- return new Promise(function(resolve2, reject) {
2179
- const image2 = Object.assign(document.createElement("img"), options);
2180
- function cleanup() {
2181
- image2.onload = null;
2182
- image2.onerror = null;
2183
- }
2184
- image2.onload = function() {
2185
- cleanup();
2186
- resolve2(image2);
2187
- };
2188
- image2.onerror = function() {
2189
- cleanup();
2190
- reject(new Error('Failed to load the image "' + src + '"'));
2191
- };
2192
- image2.src = src;
2193
- });
2194
- };
2195
- });
2196
-
2197
2095
  // src/BoardCommand.ts
2198
2096
  class BoardCommand {
2199
2097
  board;
@@ -60903,7 +60801,7 @@ function getMeasureCtx() {
60903
60801
  }
60904
60802
  return measureCtx;
60905
60803
  } else {
60906
- const { Canvas } = require_browser2();
60804
+ const { Canvas } = __require("canvas");
60907
60805
  const canvas = new Canvas(1, 1);
60908
60806
  const context = canvas.getContext("2d");
60909
60807
  return context;