1 line
26 KiB
JSON
1 line
26 KiB
JSON
{"ast":null,"code":"\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React, { useEffect } from 'react';\nimport { useMutateObserver } from '@rc-component/mutate-observer';\nimport classNames from 'classnames';\nimport { useEvent } from 'rc-util';\nimport { useToken } from '../theme/internal';\nimport WatermarkContext from './context';\nimport useClips, { FontGap } from './useClips';\nimport useRafDebounce from './useRafDebounce';\nimport useWatermark from './useWatermark';\nimport { getPixelRatio, reRendering } from './utils';\n/**\n * Only return `next` when size changed.\n * This is only used for elements compare, not a shallow equal!\n */\nfunction getSizeDiff(prev, next) {\n return prev.size === next.size ? prev : next;\n}\nconst DEFAULT_GAP_X = 100;\nconst DEFAULT_GAP_Y = 100;\nconst fixedStyle = {\n position: 'relative',\n overflow: 'hidden'\n};\nconst Watermark = props => {\n var _a, _b;\n const {\n /**\n * The antd content layer zIndex is basically below 10\n * https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335\n */\n zIndex = 9,\n rotate = -22,\n width,\n height,\n image,\n content,\n font = {},\n style,\n className,\n rootClassName,\n gap = [DEFAULT_GAP_X, DEFAULT_GAP_Y],\n offset,\n children,\n inherit = true\n } = props;\n const mergedStyle = Object.assign(Object.assign({}, fixedStyle), style);\n const [, token] = useToken();\n const {\n color = token.colorFill,\n fontSize = token.fontSizeLG,\n fontWeight = 'normal',\n fontStyle = 'normal',\n fontFamily = 'sans-serif',\n textAlign = 'center'\n } = font;\n const [gapX = DEFAULT_GAP_X, gapY = DEFAULT_GAP_Y] = gap;\n const gapXCenter = gapX / 2;\n const gapYCenter = gapY / 2;\n const offsetLeft = (_a = offset === null || offset === void 0 ? void 0 : offset[0]) !== null && _a !== void 0 ? _a : gapXCenter;\n const offsetTop = (_b = offset === null || offset === void 0 ? void 0 : offset[1]) !== null && _b !== void 0 ? _b : gapYCenter;\n const markStyle = React.useMemo(() => {\n const mergedMarkStyle = {\n zIndex,\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n backgroundRepeat: 'repeat'\n };\n /** Calculate the style of the offset */\n let positionLeft = offsetLeft - gapXCenter;\n let positionTop = offsetTop - gapYCenter;\n if (positionLeft > 0) {\n mergedMarkStyle.left = `${positionLeft}px`;\n mergedMarkStyle.width = `calc(100% - ${positionLeft}px)`;\n positionLeft = 0;\n }\n if (positionTop > 0) {\n mergedMarkStyle.top = `${positionTop}px`;\n mergedMarkStyle.height = `calc(100% - ${positionTop}px)`;\n positionTop = 0;\n }\n mergedMarkStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;\n return mergedMarkStyle;\n }, [zIndex, offsetLeft, gapXCenter, offsetTop, gapYCenter]);\n const [container, setContainer] = React.useState();\n // Used for nest case like Modal, Drawer\n const [subElements, setSubElements] = React.useState(new Set());\n // Nest elements should also support watermark\n const targetElements = React.useMemo(() => {\n const list = container ? [container] : [];\n return [].concat(list, _toConsumableArray(Array.from(subElements)));\n }, [container, subElements]);\n // ============================ Content =============================\n /**\n * Get the width and height of the watermark. The default values are as follows\n * Image: [120, 64]; Content: It's calculated by content;\n */\n const getMarkSize = ctx => {\n let defaultWidth = 120;\n let defaultHeight = 64;\n if (!image && ctx.measureText) {\n ctx.font = `${Number(fontSize)}px ${fontFamily}`;\n const contents = Array.isArray(content) ? content : [content];\n const sizes = contents.map(item => {\n const metrics = ctx.measureText(item);\n return [metrics.width, metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent];\n });\n defaultWidth = Math.ceil(Math.max.apply(Math, _toConsumableArray(sizes.map(size => size[0]))));\n defaultHeight = Math.ceil(Math.max.apply(Math, _toConsumableArray(sizes.map(size => size[1])))) * contents.length + (contents.length - 1) * FontGap;\n }\n return [width !== null && width !== void 0 ? width : defaultWidth, height !== null && height !== void 0 ? height : defaultHeight];\n };\n const getClips = useClips();\n const [watermarkInfo, setWatermarkInfo] = React.useState(null);\n // Generate new Watermark content\n const renderWatermark = () => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (ctx) {\n const ratio = getPixelRatio();\n const [markWidth, markHeight] = getMarkSize(ctx);\n const drawCanvas = drawContent => {\n const [nextClips, clipWidth] = getClips(drawContent || '', rotate, ratio, markWidth, markHeight, {\n color,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n textAlign\n }, gapX, gapY);\n setWatermarkInfo([nextClips, clipWidth]);\n };\n if (image) {\n const img = new Image();\n img.onload = () => {\n drawCanvas(img);\n };\n img.onerror = () => {\n drawCanvas(content);\n };\n img.crossOrigin = 'anonymous';\n img.referrerPolicy = 'no-referrer';\n img.src = image;\n } else {\n drawCanvas(content);\n }\n }\n };\n const syncWatermark = useRafDebounce(renderWatermark);\n // ============================= Effect =============================\n // Append watermark to the container\n const [appendWatermark, removeWatermark, isWatermarkEle] = useWatermark(markStyle);\n useEffect(() => {\n if (watermarkInfo) {\n targetElements.forEach(holder => {\n appendWatermark(watermarkInfo[0], watermarkInfo[1], holder);\n });\n }\n }, [watermarkInfo, targetElements]);\n // ============================ Observe =============================\n const onMutate = useEvent(mutations => {\n mutations.forEach(mutation => {\n if (reRendering(mutation, isWatermarkEle)) {\n syncWatermark();\n } else if (mutation.target === container && mutation.attributeName === 'style') {\n // We've only force container not modify.\n // Not consider nest case.\n const keyStyles = Object.keys(fixedStyle);\n for (let i = 0; i < keyStyles.length; i += 1) {\n const key = keyStyles[i];\n const oriValue = mergedStyle[key];\n const currentValue = container.style[key];\n if (oriValue && oriValue !== currentValue) {\n container.style[key] = oriValue;\n }\n }\n }\n });\n });\n useMutateObserver(targetElements, onMutate);\n useEffect(syncWatermark, [rotate, zIndex, width, height, image, content, color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, gapX, gapY, offsetLeft, offsetTop]);\n // ============================ Context =============================\n const watermarkContext = React.useMemo(() => ({\n add: ele => {\n setSubElements(prev => {\n const clone = new Set(prev);\n clone.add(ele);\n return getSizeDiff(prev, clone);\n });\n },\n remove: ele => {\n removeWatermark(ele);\n setSubElements(prev => {\n const clone = new Set(prev);\n clone.delete(ele);\n return getSizeDiff(prev, clone);\n });\n }\n }), []);\n // ============================= Render =============================\n const childNode = inherit ? ( /*#__PURE__*/React.createElement(WatermarkContext.Provider, {\n value: watermarkContext\n }, children)) : children;\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: setContainer,\n className: classNames(className, rootClassName),\n style: mergedStyle\n }, childNode);\n};\nif (process.env.NODE_ENV !== 'production') {\n Watermark.displayName = 'Watermark';\n}\nexport default Watermark;","map":{"version":3,"names":["_toConsumableArray","React","useEffect","useMutateObserver","classNames","useEvent","useToken","WatermarkContext","useClips","FontGap","useRafDebounce","useWatermark","getPixelRatio","reRendering","getSizeDiff","prev","next","size","DEFAULT_GAP_X","DEFAULT_GAP_Y","fixedStyle","position","overflow","Watermark","props","_a","_b","zIndex","rotate","width","height","image","content","font","style","className","rootClassName","gap","offset","children","inherit","mergedStyle","Object","assign","token","color","colorFill","fontSize","fontSizeLG","fontWeight","fontStyle","fontFamily","textAlign","gapX","gapY","gapXCenter","gapYCenter","offsetLeft","offsetTop","markStyle","useMemo","mergedMarkStyle","left","top","pointerEvents","backgroundRepeat","positionLeft","positionTop","backgroundPosition","container","setContainer","useState","subElements","setSubElements","Set","targetElements","list","concat","Array","from","getMarkSize","ctx","defaultWidth","defaultHeight","measureText","Number","contents","isArray","sizes","map","item","metrics","fontBoundingBoxAscent","fontBoundingBoxDescent","Math","ceil","max","apply","length","getClips","watermarkInfo","setWatermarkInfo","renderWatermark","canvas","document","createElement","getContext","ratio","markWidth","markHeight","drawCanvas","drawContent","nextClips","clipWidth","img","Image","onload","onerror","crossOrigin","referrerPolicy","src","syncWatermark","appendWatermark","removeWatermark","isWatermarkEle","forEach","holder","onMutate","mutations","mutation","target","attributeName","keyStyles","keys","i","key","oriValue","currentValue","watermarkContext","add","ele","clone","remove","delete","childNode","Provider","value","ref","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/watermark/index.js"],"sourcesContent":["\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React, { useEffect } from 'react';\nimport { useMutateObserver } from '@rc-component/mutate-observer';\nimport classNames from 'classnames';\nimport { useEvent } from 'rc-util';\nimport { useToken } from '../theme/internal';\nimport WatermarkContext from './context';\nimport useClips, { FontGap } from './useClips';\nimport useRafDebounce from './useRafDebounce';\nimport useWatermark from './useWatermark';\nimport { getPixelRatio, reRendering } from './utils';\n/**\n * Only return `next` when size changed.\n * This is only used for elements compare, not a shallow equal!\n */\nfunction getSizeDiff(prev, next) {\n return prev.size === next.size ? prev : next;\n}\nconst DEFAULT_GAP_X = 100;\nconst DEFAULT_GAP_Y = 100;\nconst fixedStyle = {\n position: 'relative',\n overflow: 'hidden'\n};\nconst Watermark = props => {\n var _a, _b;\n const {\n /**\n * The antd content layer zIndex is basically below 10\n * https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335\n */\n zIndex = 9,\n rotate = -22,\n width,\n height,\n image,\n content,\n font = {},\n style,\n className,\n rootClassName,\n gap = [DEFAULT_GAP_X, DEFAULT_GAP_Y],\n offset,\n children,\n inherit = true\n } = props;\n const mergedStyle = Object.assign(Object.assign({}, fixedStyle), style);\n const [, token] = useToken();\n const {\n color = token.colorFill,\n fontSize = token.fontSizeLG,\n fontWeight = 'normal',\n fontStyle = 'normal',\n fontFamily = 'sans-serif',\n textAlign = 'center'\n } = font;\n const [gapX = DEFAULT_GAP_X, gapY = DEFAULT_GAP_Y] = gap;\n const gapXCenter = gapX / 2;\n const gapYCenter = gapY / 2;\n const offsetLeft = (_a = offset === null || offset === void 0 ? void 0 : offset[0]) !== null && _a !== void 0 ? _a : gapXCenter;\n const offsetTop = (_b = offset === null || offset === void 0 ? void 0 : offset[1]) !== null && _b !== void 0 ? _b : gapYCenter;\n const markStyle = React.useMemo(() => {\n const mergedMarkStyle = {\n zIndex,\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n backgroundRepeat: 'repeat'\n };\n /** Calculate the style of the offset */\n let positionLeft = offsetLeft - gapXCenter;\n let positionTop = offsetTop - gapYCenter;\n if (positionLeft > 0) {\n mergedMarkStyle.left = `${positionLeft}px`;\n mergedMarkStyle.width = `calc(100% - ${positionLeft}px)`;\n positionLeft = 0;\n }\n if (positionTop > 0) {\n mergedMarkStyle.top = `${positionTop}px`;\n mergedMarkStyle.height = `calc(100% - ${positionTop}px)`;\n positionTop = 0;\n }\n mergedMarkStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;\n return mergedMarkStyle;\n }, [zIndex, offsetLeft, gapXCenter, offsetTop, gapYCenter]);\n const [container, setContainer] = React.useState();\n // Used for nest case like Modal, Drawer\n const [subElements, setSubElements] = React.useState(new Set());\n // Nest elements should also support watermark\n const targetElements = React.useMemo(() => {\n const list = container ? [container] : [];\n return [].concat(list, _toConsumableArray(Array.from(subElements)));\n }, [container, subElements]);\n // ============================ Content =============================\n /**\n * Get the width and height of the watermark. The default values are as follows\n * Image: [120, 64]; Content: It's calculated by content;\n */\n const getMarkSize = ctx => {\n let defaultWidth = 120;\n let defaultHeight = 64;\n if (!image && ctx.measureText) {\n ctx.font = `${Number(fontSize)}px ${fontFamily}`;\n const contents = Array.isArray(content) ? content : [content];\n const sizes = contents.map(item => {\n const metrics = ctx.measureText(item);\n return [metrics.width, metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent];\n });\n defaultWidth = Math.ceil(Math.max.apply(Math, _toConsumableArray(sizes.map(size => size[0]))));\n defaultHeight = Math.ceil(Math.max.apply(Math, _toConsumableArray(sizes.map(size => size[1])))) * contents.length + (contents.length - 1) * FontGap;\n }\n return [width !== null && width !== void 0 ? width : defaultWidth, height !== null && height !== void 0 ? height : defaultHeight];\n };\n const getClips = useClips();\n const [watermarkInfo, setWatermarkInfo] = React.useState(null);\n // Generate new Watermark content\n const renderWatermark = () => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (ctx) {\n const ratio = getPixelRatio();\n const [markWidth, markHeight] = getMarkSize(ctx);\n const drawCanvas = drawContent => {\n const [nextClips, clipWidth] = getClips(drawContent || '', rotate, ratio, markWidth, markHeight, {\n color,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n textAlign\n }, gapX, gapY);\n setWatermarkInfo([nextClips, clipWidth]);\n };\n if (image) {\n const img = new Image();\n img.onload = () => {\n drawCanvas(img);\n };\n img.onerror = () => {\n drawCanvas(content);\n };\n img.crossOrigin = 'anonymous';\n img.referrerPolicy = 'no-referrer';\n img.src = image;\n } else {\n drawCanvas(content);\n }\n }\n };\n const syncWatermark = useRafDebounce(renderWatermark);\n // ============================= Effect =============================\n // Append watermark to the container\n const [appendWatermark, removeWatermark, isWatermarkEle] = useWatermark(markStyle);\n useEffect(() => {\n if (watermarkInfo) {\n targetElements.forEach(holder => {\n appendWatermark(watermarkInfo[0], watermarkInfo[1], holder);\n });\n }\n }, [watermarkInfo, targetElements]);\n // ============================ Observe =============================\n const onMutate = useEvent(mutations => {\n mutations.forEach(mutation => {\n if (reRendering(mutation, isWatermarkEle)) {\n syncWatermark();\n } else if (mutation.target === container && mutation.attributeName === 'style') {\n // We've only force container not modify.\n // Not consider nest case.\n const keyStyles = Object.keys(fixedStyle);\n for (let i = 0; i < keyStyles.length; i += 1) {\n const key = keyStyles[i];\n const oriValue = mergedStyle[key];\n const currentValue = container.style[key];\n if (oriValue && oriValue !== currentValue) {\n container.style[key] = oriValue;\n }\n }\n }\n });\n });\n useMutateObserver(targetElements, onMutate);\n useEffect(syncWatermark, [rotate, zIndex, width, height, image, content, color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, gapX, gapY, offsetLeft, offsetTop]);\n // ============================ Context =============================\n const watermarkContext = React.useMemo(() => ({\n add: ele => {\n setSubElements(prev => {\n const clone = new Set(prev);\n clone.add(ele);\n return getSizeDiff(prev, clone);\n });\n },\n remove: ele => {\n removeWatermark(ele);\n setSubElements(prev => {\n const clone = new Set(prev);\n clone.delete(ele);\n return getSizeDiff(prev, clone);\n });\n }\n }), []);\n // ============================= Render =============================\n const childNode = inherit ? ( /*#__PURE__*/React.createElement(WatermarkContext.Provider, {\n value: watermarkContext\n }, children)) : children;\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: setContainer,\n className: classNames(className, rootClassName),\n style: mergedStyle\n }, childNode);\n};\nif (process.env.NODE_ENV !== 'production') {\n Watermark.displayName = 'Watermark';\n}\nexport default Watermark;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,gBAAgB,MAAM,WAAW;AACxC,OAAOC,QAAQ,IAAIC,OAAO,QAAQ,YAAY;AAC9C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,SAASC,aAAa,EAAEC,WAAW,QAAQ,SAAS;AACpD;AACA;AACA;AACA;AACA,SAASC,WAAWA,CAACC,IAAI,EAAEC,IAAI,EAAE;EAC/B,OAAOD,IAAI,CAACE,IAAI,KAAKD,IAAI,CAACC,IAAI,GAAGF,IAAI,GAAGC,IAAI;AAC9C;AACA,MAAME,aAAa,GAAG,GAAG;AACzB,MAAMC,aAAa,GAAG,GAAG;AACzB,MAAMC,UAAU,GAAG;EACjBC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE;AACZ,CAAC;AACD,MAAMC,SAAS,GAAGC,KAAK,IAAI;EACzB,IAAIC,EAAE,EAAEC,EAAE;EACV,MAAM;IACJ;AACJ;AACA;A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