html-react-parser 6.1.1 → 6.1.2

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.
@@ -1871,16 +1871,16 @@
1871
1871
  return lib;
1872
1872
  }
1873
1873
 
1874
- var utilities$1 = {};
1874
+ var utilities = {};
1875
1875
 
1876
- var cjs$2 = {};
1876
+ var cjs$1 = {};
1877
1877
 
1878
- var cjs$1;
1879
- var hasRequiredCjs$2;
1878
+ var cjs;
1879
+ var hasRequiredCjs$1;
1880
1880
 
1881
- function requireCjs$2 () {
1882
- if (hasRequiredCjs$2) return cjs$1;
1883
- hasRequiredCjs$2 = 1;
1881
+ function requireCjs$1 () {
1882
+ if (hasRequiredCjs$1) return cjs;
1883
+ hasRequiredCjs$1 = 1;
1884
1884
 
1885
1885
  // http://www.w3.org/TR/CSS21/grammar.html
1886
1886
  // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
@@ -2140,22 +2140,22 @@
2140
2140
  return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
2141
2141
  }
2142
2142
 
2143
- cjs$1 = index;
2143
+ cjs = index;
2144
2144
 
2145
- return cjs$1;
2145
+ return cjs;
2146
2146
  }
2147
2147
 
2148
- var hasRequiredCjs$1;
2148
+ var hasRequiredCjs;
2149
2149
 
2150
- function requireCjs$1 () {
2151
- if (hasRequiredCjs$1) return cjs$2;
2152
- hasRequiredCjs$1 = 1;
2153
- var __importDefault = (cjs$2 && cjs$2.__importDefault) || function (mod) {
2150
+ function requireCjs () {
2151
+ if (hasRequiredCjs) return cjs$1;
2152
+ hasRequiredCjs = 1;
2153
+ var __importDefault = (cjs$1 && cjs$1.__importDefault) || function (mod) {
2154
2154
  return (mod && mod.__esModule) ? mod : { "default": mod };
2155
2155
  };
2156
- Object.defineProperty(cjs$2, "__esModule", { value: true });
2157
- cjs$2.default = StyleToObject;
2158
- const inline_style_parser_1 = __importDefault(requireCjs$2());
2156
+ Object.defineProperty(cjs$1, "__esModule", { value: true });
2157
+ cjs$1.default = StyleToObject;
2158
+ const inline_style_parser_1 = __importDefault(requireCjs$1());
2159
2159
  /**
2160
2160
  * Parses inline style to object.
2161
2161
  *
@@ -2193,105 +2193,92 @@
2193
2193
  return styleObject;
2194
2194
  }
2195
2195
 
2196
- return cjs$2;
2196
+ return cjs$1;
2197
2197
  }
2198
2198
 
2199
- var utilities = {};
2200
-
2201
- var hasRequiredUtilities$1;
2202
-
2203
- function requireUtilities$1 () {
2204
- if (hasRequiredUtilities$1) return utilities;
2205
- hasRequiredUtilities$1 = 1;
2206
- Object.defineProperty(utilities, "__esModule", { value: true });
2207
- utilities.camelCase = void 0;
2208
- var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
2209
- var HYPHEN_REGEX = /-([a-z])/g;
2210
- var NO_HYPHEN_REGEX = /^[^-]+$/;
2211
- var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
2212
- var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
2213
- /**
2214
- * Checks whether to skip camelCase.
2215
- */
2216
- var skipCamelCase = function (property) {
2217
- return !property ||
2218
- NO_HYPHEN_REGEX.test(property) ||
2219
- CUSTOM_PROPERTY_REGEX.test(property);
2199
+ var dist$1;
2200
+ var hasRequiredDist;
2201
+
2202
+ function requireDist () {
2203
+ if (hasRequiredDist) return dist$1;
2204
+ hasRequiredDist = 1;
2205
+ //#region \0rolldown/runtime.js
2206
+ var __create = Object.create;
2207
+ var __defProp = Object.defineProperty;
2208
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2209
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2210
+ var __getProtoOf = Object.getPrototypeOf;
2211
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2212
+ var __copyProps = (to, from, except, desc) => {
2213
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
2214
+ key = keys[i];
2215
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
2216
+ get: ((k) => from[k]).bind(null, key),
2217
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
2218
+ });
2219
+ }
2220
+ return to;
2220
2221
  };
2222
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(!mod || !mod.__esModule ? __defProp(target, "default", {
2223
+ value: mod,
2224
+ enumerable: true
2225
+ }) : target, mod));
2226
+ //#endregion
2227
+ let style_to_object = requireCjs();
2228
+ style_to_object = __toESM(style_to_object);
2229
+ //#region src/utilities.ts
2230
+ const CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
2231
+ const HYPHEN_REGEX = /-([a-z])/g;
2232
+ const NO_HYPHEN_REGEX = /^[^-]+$/;
2233
+ const VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
2234
+ const MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
2221
2235
  /**
2222
- * Replacer that capitalizes first character.
2223
- */
2224
- var capitalize = function (match, character) {
2225
- return character.toUpperCase();
2226
- };
2236
+ * Checks whether to skip camelCase.
2237
+ */
2238
+ const skipCamelCase = (property) => !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
2227
2239
  /**
2228
- * Replacer that removes beginning hyphen of vendor prefix property.
2229
- */
2230
- var trimHyphen = function (match, prefix) { return "".concat(prefix, "-"); };
2240
+ * Replacer that capitalizes first character.
2241
+ */
2242
+ const capitalize = (match, character) => character.toUpperCase();
2231
2243
  /**
2232
- * CamelCases a CSS property.
2233
- */
2234
- var camelCase = function (property, options) {
2235
- if (options === void 0) { options = {}; }
2236
- if (skipCamelCase(property)) {
2237
- return property;
2238
- }
2239
- property = property.toLowerCase();
2240
- if (options.reactCompat) {
2241
- // `-ms` vendor prefix should not be capitalized
2242
- property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
2243
- }
2244
- else {
2245
- // for non-React, remove first hyphen so vendor prefix is not capitalized
2246
- property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
2247
- }
2248
- return property.replace(HYPHEN_REGEX, capitalize);
2249
- };
2250
- utilities.camelCase = camelCase;
2251
-
2252
- return utilities;
2253
- }
2254
-
2255
- var cjs;
2256
- var hasRequiredCjs;
2257
-
2258
- function requireCjs () {
2259
- if (hasRequiredCjs) return cjs;
2260
- hasRequiredCjs = 1;
2261
- var __importDefault = (cjs && cjs.__importDefault) || function (mod) {
2262
- return (mod && mod.__esModule) ? mod : { "default": mod };
2244
+ * Replacer that removes beginning hyphen of vendor prefix property.
2245
+ */
2246
+ const trimHyphen = (match, prefix) => `${prefix}-`;
2247
+ /**
2248
+ * CamelCases a CSS property.
2249
+ */
2250
+ const camelCase = (property, options = {}) => {
2251
+ if (skipCamelCase(property)) return property;
2252
+ property = property.toLowerCase();
2253
+ if (options.reactCompat) property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
2254
+ else property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
2255
+ return property.replace(HYPHEN_REGEX, capitalize);
2263
2256
  };
2264
- var style_to_object_1 = __importDefault(requireCjs$1());
2265
- var utilities_1 = requireUtilities$1();
2257
+ //#endregion
2258
+ //#region src/index.ts
2266
2259
  /**
2267
- * Parses CSS inline style to JavaScript object (camelCased).
2268
- */
2260
+ * Parses CSS inline style to JavaScript object (camelCased).
2261
+ */
2269
2262
  function StyleToJS(style, options) {
2270
- var output = {};
2271
- if (!style || typeof style !== 'string') {
2272
- return output;
2273
- }
2274
- (0, style_to_object_1.default)(style, function (property, value) {
2275
- // skip CSS comment
2276
- if (property && value) {
2277
- output[(0, utilities_1.camelCase)(property, options)] = value;
2278
- }
2279
- });
2280
- return output;
2263
+ const output = {};
2264
+ if (!style || typeof style !== "string") return output;
2265
+ (0, style_to_object.default)(style, (property, value) => {
2266
+ if (property && value) output[camelCase(property, options)] = value;
2267
+ });
2268
+ return output;
2281
2269
  }
2282
- StyleToJS.default = StyleToJS;
2283
- cjs = StyleToJS;
2284
-
2285
- return cjs;
2270
+ //#endregion
2271
+ dist$1 = StyleToJS;
2272
+ return dist$1;
2286
2273
  }
2287
2274
 
2288
2275
  var hasRequiredUtilities;
2289
2276
 
2290
2277
  function requireUtilities () {
2291
- if (hasRequiredUtilities) return utilities$1;
2278
+ if (hasRequiredUtilities) return utilities;
2292
2279
  hasRequiredUtilities = 1;
2293
2280
  (function (exports) {
2294
- var __importDefault = (utilities$1 && utilities$1.__importDefault) || function (mod) {
2281
+ var __importDefault = (utilities && utilities.__importDefault) || function (mod) {
2295
2282
  return (mod && mod.__esModule) ? mod : { "default": mod };
2296
2283
  };
2297
2284
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2299,7 +2286,7 @@
2299
2286
  exports.isCustomComponent = isCustomComponent;
2300
2287
  exports.setStyleProp = setStyleProp;
2301
2288
  const react_1 = require$$0;
2302
- const style_to_js_1 = __importDefault(requireCjs());
2289
+ const style_to_js_1 = __importDefault(requireDist());
2303
2290
  const RESERVED_SVG_MATHML_ELEMENTS = new Set([
2304
2291
  'annotation-xml',
2305
2292
  'color-profile',
@@ -2392,8 +2379,8 @@
2392
2379
  const returnFirstArg = (arg) => arg;
2393
2380
  exports.returnFirstArg = returnFirstArg;
2394
2381
 
2395
- } (utilities$1));
2396
- return utilities$1;
2382
+ } (utilities));
2383
+ return utilities;
2397
2384
  }
2398
2385
 
2399
2386
  var hasRequiredAttributesToProps;