@cbjwwwcode/common 0.0.8 → 0.0.9
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/dist/es/dompurify.d.mts +5 -0
- package/dist/es/dompurify.mjs +12 -0
- package/dist/es/format.mjs +4 -5
- package/dist/es/index.d.mts +2 -1
- package/dist/es/index.mjs +2 -1
- package/dist/umd/common.min.js +239 -233
- package/package.json +7 -8
- package/src/dompurify.ts +21 -0
- package/src/format.ts +3 -4
- package/src/index.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { merge } from "es-toolkit/compat";
|
|
2
|
+
import DOMPurify from "dompurify";
|
|
3
|
+
//#region src/dompurify.ts
|
|
4
|
+
function toSafeHtml(html, config) {
|
|
5
|
+
return DOMPurify.sanitize(html, merge({ USE_PROFILES: {
|
|
6
|
+
html: true,
|
|
7
|
+
svg: true,
|
|
8
|
+
svgFilters: true
|
|
9
|
+
} }, { ...config }));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { DOMPurify, toSafeHtml };
|
package/dist/es/format.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isString } from "es-toolkit/compat";
|
|
1
|
+
import { isString, merge } from "es-toolkit/compat";
|
|
2
2
|
import esthetic from "esthetic";
|
|
3
3
|
//#region src/format.ts
|
|
4
4
|
const formatMsps = /* @__PURE__ */ new Set([
|
|
@@ -34,7 +34,7 @@ const formatMsps = /* @__PURE__ */ new Set([
|
|
|
34
34
|
*/
|
|
35
35
|
function formatCode(code, language, rules) {
|
|
36
36
|
language = isString(language) && formatMsps.has(language) ? language : language == "vue" ? "html" : "auto";
|
|
37
|
-
return esthetic.format(code, {
|
|
37
|
+
return esthetic.format(code, merge({
|
|
38
38
|
language,
|
|
39
39
|
preset: "recommended",
|
|
40
40
|
preserveLine: 0,
|
|
@@ -64,9 +64,8 @@ function formatCode(code, language, rules) {
|
|
|
64
64
|
sortSelectors: false,
|
|
65
65
|
noLeadZero: true,
|
|
66
66
|
quoteConvert: "double"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
});
|
|
67
|
+
}
|
|
68
|
+
}, { ...rules }));
|
|
70
69
|
}
|
|
71
70
|
//#endregion
|
|
72
71
|
export { esthetic, formatCode };
|
package/dist/es/index.d.mts
CHANGED
|
@@ -21,4 +21,5 @@ import { Lowlight, VueLowlight, highlightLanguages, lowlight } from "./lowlight/
|
|
|
21
21
|
import { Hucre } from "./hucre.mjs";
|
|
22
22
|
import { useCopy } from "./copy.mjs";
|
|
23
23
|
import { FormatRule as Rules, esthetic, formatCode } from "./format.mjs";
|
|
24
|
-
|
|
24
|
+
import { DOMConfig as Config, DOMPurify, toSafeHtml } from "./dompurify.mjs";
|
|
25
|
+
export { $http, $mitt, AlovaAxiosRequestConfig, ApiConfig, type BlockSchema, ContextMode, CryptoJS, type Config as DOMConfig, DOMPurify, type Rules as FormatRule, Hucre, IDBKeyValReturn, IDBOptions, JsonNodeProps, Lowlight, type NProgress, type NProgressOptions, type Toast, ToastApi, type ToastOptions, Toolkit, type UseStore, VeeValidate, VtjCore, VtjRenderer, VtjUtils, Vue, VueLowlight, VueRouter, VueUse, axios, createClientTokenAuthentication, createFunction, createGlobalState, createNaiveStore, createReusableTemplate, dayjs, determineTextColor, esthetic, formatCode, hasProperty, highlightLanguages, hljs, idb, initProvider, isComponentRegistered, isHttpUrl, isModuleObject, isNotNil, isPromise, isStringNumber, keepProps, loadJsStore, loadRemoteModule, loaderScript, lowlight, makeRawComponent, makeUuid, makeVueId, md5, mergeOmitBy, mergePropsOmitBy, mergeUrlWithParams, onClickOutside, randomId, registerWindow, setDayjsLocale, setupJsonNode, setupRequest, setupToast, toSafeHtml, toast, transformPx, useCaptcha, useClipboard, useCopy, useGlobalProvider, useIdb, useJsonNode, useProgress, useRequest, useScriptTag, useStorage, useStyleLink, useStyleTag, useToggle, useUploader, vtjSymbol, zod };
|
package/dist/es/index.mjs
CHANGED
|
@@ -21,4 +21,5 @@ import { VtjCore, VtjRenderer, VtjUtils } from "./vtj/index.mjs";
|
|
|
21
21
|
import { Hucre } from "./hucre.mjs";
|
|
22
22
|
import { useCopy } from "./copy.mjs";
|
|
23
23
|
import { esthetic, formatCode } from "./format.mjs";
|
|
24
|
-
|
|
24
|
+
import { DOMPurify, toSafeHtml } from "./dompurify.mjs";
|
|
25
|
+
export { $http, $mitt, ContextMode, CryptoJS, DOMPurify, Hucre, ToastApi, Toolkit, VeeValidate, VtjCore, VtjRenderer, VtjUtils, Vue, VueLowlight, VueRouter, VueUse, axios, createClientTokenAuthentication, createFunction, createGlobalState, createNaiveStore, createReusableTemplate, dayjs, determineTextColor, esthetic, formatCode, hasProperty, highlightLanguages, hljs_default as hljs, idb, initProvider, isComponentRegistered, isHttpUrl, isModuleObject, isNotNil, isPromise, isStringNumber, keepProps, loadJsStore, loadRemoteModule, loaderScript, lowlight, makeRawComponent, makeUuid, makeVueId, md5, mergeOmitBy, mergePropsOmitBy, mergeUrlWithParams, onClickOutside, randomId, registerWindow, setDayjsLocale, setupJsonNode, setupRequest, setupToast, toSafeHtml, toast, transformPx, useCaptcha, useClipboard, useCopy, useGlobalProvider, useIdb, useJsonNode, useProgress, useRequest, useScriptTag, useStorage, useStyleLink, useStyleTag, useToggle, useUploader, vtjSymbol, zod };
|