@rockshin/tao-ui 0.0.59 → 0.1.0
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/README.md +5 -1
- package/component-manifest.json +1 -1
- package/dist/components/affix/affix.css +1 -1
- package/dist/components/affix/affix.d.ts +1 -0
- package/dist/components/affix/affix.js +18 -17
- package/dist/components/alert/alert.css +123 -119
- package/dist/components/alert/alert.js +78 -188
- package/dist/components/app/app-modals.js +49 -98
- package/dist/components/app/app-notices.d.ts +2 -2
- package/dist/components/app/app-notices.js +294 -243
- package/dist/components/app/app-types.d.ts +6 -3
- package/dist/components/app/app.css +185 -183
- package/dist/components/app/app.js +1 -1
- package/dist/components/auto-complete/auto-complete.css +30 -28
- package/dist/components/auto-complete/auto-complete.d.ts +3 -1
- package/dist/components/auto-complete/auto-complete.js +2 -1
- package/dist/components/badge/badge.js +42 -127
- package/dist/components/border-beam/border-beam.css +1 -1
- package/dist/components/border-beam/border-beam.d.ts +1 -0
- package/dist/components/border-beam/border-beam.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.css +123 -120
- package/dist/components/breadcrumb/breadcrumb.js +160 -265
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +52 -151
- package/dist/components/calendar/calendar.js +28 -27
- package/dist/components/card/card-tabs.d.ts +56 -5
- package/dist/components/card/card-tabs.js +214 -468
- package/dist/components/card/card.d.ts +1 -2
- package/dist/components/card/card.js +64 -226
- package/dist/components/carousel/carousel.css +1 -1
- package/dist/components/carousel/carousel.d.ts +59 -4
- package/dist/components/carousel/carousel.js +299 -243
- package/dist/components/cascader/cascader.css +186 -184
- package/dist/components/cascader/cascader.d.ts +3 -1
- package/dist/components/cascader/cascader.js +29 -34
- package/dist/components/checkbox/checkbox.css +93 -90
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +171 -499
- package/dist/components/collapse/collapse-panels.js +145 -400
- package/dist/components/collapse/collapse.css +172 -170
- package/dist/components/collapse/collapse.d.ts +1 -1
- package/dist/components/collapse/collapse.js +62 -181
- package/dist/components/color-picker/color-picker.css +1 -1
- package/dist/components/color-picker/color-picker.js +418 -981
- package/dist/components/context-menu/context-menu.css +4 -4
- package/dist/components/context-menu/context-menu.d.ts +3 -1
- package/dist/components/context-menu/context-menu.js +54 -135
- package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
- package/dist/components/date-picker/calendar/calendar-header.js +171 -337
- package/dist/components/date-picker/calendar/month-grid.js +33 -103
- package/dist/components/date-picker/calendar/time-panel.js +84 -209
- package/dist/components/date-picker/calendar/year-grid.js +36 -105
- package/dist/components/date-picker/date-localization.js +1 -1
- package/dist/components/date-picker/date-picker.css +599 -642
- package/dist/components/date-picker/date-picker.d.ts +2 -1
- package/dist/components/date-picker/date-picker.js +96 -105
- package/dist/components/date-picker/presets.js +12 -37
- package/dist/components/date-picker/range-picker.d.ts +2 -1
- package/dist/components/date-picker/range-picker.js +222 -255
- package/dist/components/date-picker/types.d.ts +2 -1
- package/dist/components/descriptions/descriptions.css +1 -1
- package/dist/components/descriptions/descriptions.js +30 -39
- package/dist/components/drawer/drawer.css +202 -200
- package/dist/components/drawer/drawer.js +28 -34
- package/dist/components/dropdown/dropdown-core.d.ts +32 -0
- package/dist/components/dropdown/dropdown-core.js +156 -0
- package/dist/components/dropdown/dropdown.css +38 -36
- package/dist/components/dropdown/dropdown.d.ts +4 -30
- package/dist/components/dropdown/dropdown.js +91 -271
- package/dist/components/empty/empty.css +30 -28
- package/dist/components/empty/empty.js +81 -236
- package/dist/components/float-button/float-button.css +1 -1
- package/dist/components/float-button/float-button.js +38 -48
- package/dist/components/form/field-control.js +2 -3
- package/dist/components/form/form-item.js +67 -129
- package/dist/components/form/form.css +36 -34
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.js +29 -100
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/use-form.js +48 -66
- package/dist/components/form-actions/form-actions.d.ts +1 -0
- package/dist/components/form-actions/form-actions.js +10 -36
- package/dist/components/form-field/form-field-view.d.ts +1 -0
- package/dist/components/form-field/form-field-view.js +81 -288
- package/dist/components/form-field/form-field.js +13 -31
- package/dist/components/form-field/form.css +74 -72
- package/dist/components/form-section/form-section.d.ts +1 -0
- package/dist/components/form-section/form-section.js +38 -91
- package/dist/components/image/image-icons.js +16 -31
- package/dist/components/image/image.css +1 -1
- package/dist/components/image/image.js +298 -911
- package/dist/components/input/base-input.d.ts +3 -1
- package/dist/components/input/base-input.js +8 -7
- package/dist/components/input/input-shared.css +62 -60
- package/dist/components/input/input-shared.d.ts +1 -1
- package/dist/components/input/input-shared.js +56 -100
- package/dist/components/input/input.css +222 -220
- package/dist/components/input/otp.d.ts +2 -1
- package/dist/components/input/otp.js +143 -324
- package/dist/components/input/password.js +12 -67
- package/dist/components/input/search.js +13 -13
- package/dist/components/input-number/input-number.d.ts +4 -2
- package/dist/components/input-number/input-number.js +30 -137
- package/dist/components/list/list-pagination.css +107 -105
- package/dist/components/list/list-pagination.d.ts +56 -5
- package/dist/components/list/list-pagination.js +249 -316
- package/dist/components/list/list.css +179 -177
- package/dist/components/list/list.js +170 -604
- package/dist/components/listy/listy.css +55 -53
- package/dist/components/listy/listy.d.ts +43 -4
- package/dist/components/listy/listy.js +198 -216
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.d.ts +1 -0
- package/dist/components/masonry/masonry.js +90 -244
- package/dist/components/mentions/mentions.css +153 -151
- package/dist/components/mentions/mentions.d.ts +53 -11
- package/dist/components/mentions/mentions.js +291 -75
- package/dist/components/menu/menu-render.d.ts +7 -0
- package/dist/components/menu/menu-render.js +156 -302
- package/dist/components/menu/menu.css +142 -140
- package/dist/components/modal/confirm-dialog.js +19 -24
- package/dist/components/modal/modal.css +165 -162
- package/dist/components/modal/modal.js +285 -731
- package/dist/components/modal/use-modal.js +25 -25
- package/dist/components/pagination/pagination.css +134 -131
- package/dist/components/pagination/pagination.d.ts +4 -3
- package/dist/components/pagination/pagination.js +138 -281
- package/dist/components/popconfirm/popconfirm.css +38 -36
- package/dist/components/popconfirm/popconfirm.js +105 -288
- package/dist/components/popover/popover.css +89 -87
- package/dist/components/popover/popover.js +189 -469
- package/dist/components/progress/progress.css +153 -151
- package/dist/components/progress/progress.js +34 -43
- package/dist/components/qr-code/qr-code.css +36 -34
- package/dist/components/qr-code/qr-code.js +83 -277
- package/dist/components/radio/radio.css +95 -92
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +114 -376
- package/dist/components/rate/rate.css +80 -78
- package/dist/components/rate/rate.d.ts +34 -6
- package/dist/components/rate/rate.js +160 -244
- package/dist/components/result/result.css +59 -57
- package/dist/components/result/result.d.ts +1 -0
- package/dist/components/result/result.js +118 -291
- package/dist/components/scroll-area/scroll-area.css +160 -148
- package/dist/components/scroll-area/scroll-area.js +284 -488
- package/dist/components/segmented/segmented.css +1 -1
- package/dist/components/segmented/segmented.js +59 -58
- package/dist/components/select/mobile-select.css +166 -164
- package/dist/components/select/mobile-select.js +48 -131
- package/dist/components/select/select-icons.js +59 -128
- package/dist/components/select/select-model.js +1 -1
- package/dist/components/select/select-searchable-list.js +19 -19
- package/dist/components/select/select-tags.js +70 -156
- package/dist/components/select/select-types.d.ts +2 -1
- package/dist/components/select/select.css +509 -506
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +67 -65
- package/dist/components/select/use-select-selection.js +181 -261
- package/dist/components/skeleton/skeleton.css +105 -103
- package/dist/components/skeleton/skeleton.js +140 -399
- package/dist/components/slider/slider.css +160 -158
- package/dist/components/slider/slider.d.ts +45 -6
- package/dist/components/slider/slider.js +359 -74
- package/dist/components/sonner/index.d.ts +1 -1
- package/dist/components/sonner/sonner.css +190 -182
- package/dist/components/sonner/sonner.js +12 -11
- package/dist/components/spinner/spinner.css +80 -76
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.js +75 -219
- package/dist/components/splitter/splitter.css +157 -154
- package/dist/components/splitter/splitter.js +271 -448
- package/dist/components/statistic/statistic.css +1 -1
- package/dist/components/statistic/statistic.js +121 -406
- package/dist/components/status-icon/status-icon.js +14 -26
- package/dist/components/steps/steps-icons.js +63 -100
- package/dist/components/steps/steps.css +817 -807
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/steps.js +38 -94
- package/dist/components/steps/use-display-steps.js +21 -54
- package/dist/components/switch/switch-touch.css +17 -15
- package/dist/components/switch/switch.css +192 -190
- package/dist/components/switch/switch.js +63 -196
- package/dist/components/table/table-filter.d.ts +3 -1
- package/dist/components/table/table-filter.js +72 -133
- package/dist/components/table/table-icons.js +77 -152
- package/dist/components/table/table-summary.js +30 -77
- package/dist/components/table/table-types.d.ts +2 -1
- package/dist/components/table/table.css +468 -465
- package/dist/components/table/table.js +86 -84
- package/dist/components/table/use-table-data.js +137 -248
- package/dist/components/tabs/tabs.css +123 -120
- package/dist/components/tabs/tabs.d.ts +4 -3
- package/dist/components/tabs/tabs.js +157 -322
- package/dist/components/tag/tag.css +231 -221
- package/dist/components/tag/tag.js +110 -248
- package/dist/components/textarea/textarea.css +2 -1
- package/dist/components/textarea/textarea.d.ts +3 -1
- package/dist/components/textarea/textarea.js +16 -15
- package/dist/components/time-picker/time-picker.d.ts +1 -0
- package/dist/components/time-picker/time-picker.js +91 -221
- package/dist/components/timeline/timeline.css +1 -1
- package/dist/components/timeline/timeline.js +17 -17
- package/dist/components/tooltip/tooltip.css +79 -77
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +111 -263
- package/dist/components/tour/tour.css +1 -1
- package/dist/components/tour/tour.d.ts +59 -6
- package/dist/components/tour/tour.js +343 -622
- package/dist/components/transfer/transfer-list.js +19 -19
- package/dist/components/transfer/transfer-parts.js +63 -139
- package/dist/components/transfer/transfer.css +192 -190
- package/dist/components/transfer/transfer.js +57 -56
- package/dist/components/tree/tree-check.js +25 -32
- package/dist/components/tree/tree-keyboard.js +1 -1
- package/dist/components/tree/tree.css +204 -200
- package/dist/components/tree/tree.js +139 -277
- package/dist/components/tree-select/select-engine.css +200 -197
- package/dist/components/tree-select/select-engine.js +11 -38
- package/dist/components/tree-select/tree-select.css +21 -19
- package/dist/components/tree-select/tree-select.d.ts +3 -1
- package/dist/components/tree-select/tree-select.js +12 -10
- package/dist/components/upload/upload.js +193 -308
- package/dist/components/watermark/watermark-context.js +8 -14
- package/dist/components/watermark/watermark.css +1 -1
- package/dist/components/watermark/watermark.js +209 -400
- package/dist/docs/components/stack.doc.js +1 -1
- package/dist/docs/components/table.doc.js +1 -1
- package/dist/entries/affix.d.ts +0 -2
- package/dist/entries/affix.js +0 -2
- package/dist/entries/alert.d.ts +0 -2
- package/dist/entries/alert.js +0 -2
- package/dist/entries/app.d.ts +0 -2
- package/dist/entries/app.js +0 -2
- package/dist/entries/auto-complete.d.ts +0 -2
- package/dist/entries/auto-complete.js +0 -2
- package/dist/entries/avatar.d.ts +0 -2
- package/dist/entries/avatar.js +0 -2
- package/dist/entries/badge.d.ts +0 -2
- package/dist/entries/badge.js +0 -2
- package/dist/entries/border-beam.d.ts +0 -2
- package/dist/entries/border-beam.js +0 -2
- package/dist/entries/breadcrumb.d.ts +0 -2
- package/dist/entries/breadcrumb.js +0 -2
- package/dist/entries/button.d.ts +0 -2
- package/dist/entries/button.js +0 -2
- package/dist/entries/calendar.d.ts +0 -2
- package/dist/entries/calendar.js +0 -2
- package/dist/entries/card.d.ts +0 -2
- package/dist/entries/card.js +0 -2
- package/dist/entries/carousel.d.ts +0 -2
- package/dist/entries/carousel.js +0 -2
- package/dist/entries/cascader.d.ts +0 -2
- package/dist/entries/cascader.js +0 -2
- package/dist/entries/checkbox.d.ts +0 -2
- package/dist/entries/checkbox.js +0 -2
- package/dist/entries/collapse.d.ts +0 -2
- package/dist/entries/collapse.js +0 -2
- package/dist/entries/color-picker.d.ts +0 -2
- package/dist/entries/color-picker.js +0 -2
- package/dist/entries/context-menu.d.ts +0 -2
- package/dist/entries/context-menu.js +0 -2
- package/dist/entries/date-picker.d.ts +0 -2
- package/dist/entries/date-picker.js +0 -2
- package/dist/entries/descriptions.d.ts +0 -2
- package/dist/entries/descriptions.js +0 -2
- package/dist/entries/divider.d.ts +0 -2
- package/dist/entries/divider.js +0 -2
- package/dist/entries/drawer.d.ts +0 -2
- package/dist/entries/drawer.js +0 -2
- package/dist/entries/dropdown.d.ts +0 -2
- package/dist/entries/dropdown.js +0 -2
- package/dist/entries/empty.d.ts +0 -2
- package/dist/entries/empty.js +0 -2
- package/dist/entries/float-button.d.ts +0 -2
- package/dist/entries/float-button.js +0 -2
- package/dist/entries/form-actions.d.ts +0 -2
- package/dist/entries/form-actions.js +0 -2
- package/dist/entries/form-field.d.ts +0 -2
- package/dist/entries/form-field.js +0 -2
- package/dist/entries/form-layout.d.ts +0 -2
- package/dist/entries/form-layout.js +0 -2
- package/dist/entries/form-section.d.ts +0 -2
- package/dist/entries/form-section.js +0 -2
- package/dist/entries/form.d.ts +1 -3
- package/dist/entries/form.js +0 -2
- package/dist/entries/image.d.ts +0 -2
- package/dist/entries/image.js +0 -2
- package/dist/entries/input-number.d.ts +0 -2
- package/dist/entries/input-number.js +0 -2
- package/dist/entries/input.d.ts +1 -3
- package/dist/entries/input.js +0 -2
- package/dist/entries/list.d.ts +0 -2
- package/dist/entries/list.js +0 -2
- package/dist/entries/listy.d.ts +0 -2
- package/dist/entries/listy.js +0 -2
- package/dist/entries/masonry.d.ts +0 -2
- package/dist/entries/masonry.js +0 -2
- package/dist/entries/mentions.d.ts +0 -2
- package/dist/entries/mentions.js +0 -2
- package/dist/entries/modal.d.ts +0 -2
- package/dist/entries/modal.js +0 -2
- package/dist/entries/number-input.d.ts +0 -2
- package/dist/entries/number-input.js +0 -2
- package/dist/entries/pagination.d.ts +0 -2
- package/dist/entries/pagination.js +0 -2
- package/dist/entries/popconfirm.d.ts +0 -2
- package/dist/entries/popconfirm.js +0 -2
- package/dist/entries/popover.d.ts +0 -2
- package/dist/entries/popover.js +0 -2
- package/dist/entries/progress.d.ts +0 -2
- package/dist/entries/progress.js +0 -2
- package/dist/entries/provider.d.ts +1 -3
- package/dist/entries/provider.js +1 -3
- package/dist/entries/qr-code.d.ts +0 -2
- package/dist/entries/qr-code.js +0 -2
- package/dist/entries/radio.d.ts +0 -2
- package/dist/entries/radio.js +0 -2
- package/dist/entries/range-picker.d.ts +0 -2
- package/dist/entries/range-picker.js +0 -2
- package/dist/entries/rate.d.ts +0 -2
- package/dist/entries/rate.js +0 -2
- package/dist/entries/result.d.ts +0 -2
- package/dist/entries/result.js +0 -2
- package/dist/entries/scroll-area.d.ts +0 -2
- package/dist/entries/scroll-area.js +0 -2
- package/dist/entries/segmented.d.ts +0 -2
- package/dist/entries/segmented.js +0 -2
- package/dist/entries/select.d.ts +0 -2
- package/dist/entries/select.js +0 -2
- package/dist/entries/skeleton.d.ts +0 -2
- package/dist/entries/skeleton.js +0 -2
- package/dist/entries/slider.d.ts +0 -2
- package/dist/entries/slider.js +0 -2
- package/dist/entries/sonner.d.ts +0 -2
- package/dist/entries/sonner.js +0 -2
- package/dist/entries/spinner.d.ts +0 -2
- package/dist/entries/spinner.js +0 -2
- package/dist/entries/splitter.d.ts +0 -2
- package/dist/entries/splitter.js +0 -2
- package/dist/entries/stack.d.ts +0 -2
- package/dist/entries/stack.js +0 -2
- package/dist/entries/statistic.d.ts +0 -2
- package/dist/entries/statistic.js +0 -2
- package/dist/entries/steps.d.ts +0 -2
- package/dist/entries/steps.js +0 -2
- package/dist/entries/switch.d.ts +0 -2
- package/dist/entries/switch.js +0 -2
- package/dist/entries/table.d.ts +0 -2
- package/dist/entries/table.js +0 -2
- package/dist/entries/tabs.d.ts +0 -2
- package/dist/entries/tabs.js +0 -2
- package/dist/entries/tag.d.ts +0 -2
- package/dist/entries/tag.js +0 -2
- package/dist/entries/textarea.d.ts +0 -2
- package/dist/entries/textarea.js +0 -2
- package/dist/entries/time-picker.d.ts +0 -2
- package/dist/entries/time-picker.js +0 -2
- package/dist/entries/timeline.d.ts +0 -2
- package/dist/entries/timeline.js +0 -2
- package/dist/entries/tooltip.d.ts +0 -2
- package/dist/entries/tooltip.js +0 -2
- package/dist/entries/tour.d.ts +0 -2
- package/dist/entries/tour.js +0 -2
- package/dist/entries/transfer.d.ts +0 -2
- package/dist/entries/transfer.js +0 -2
- package/dist/entries/tree-select.d.ts +0 -2
- package/dist/entries/tree-select.js +0 -2
- package/dist/entries/tree.d.ts +0 -2
- package/dist/entries/tree.js +0 -2
- package/dist/entries/upload.d.ts +0 -2
- package/dist/entries/upload.js +0 -2
- package/dist/entries/watermark.d.ts +0 -2
- package/dist/entries/watermark.js +0 -2
- package/dist/index.d.ts +5 -7
- package/dist/index.js +2 -4
- package/dist/layouts/form-layout/form-layout.d.ts +1 -0
- package/dist/layouts/form-layout/form-layout.js +10 -36
- package/dist/layouts/stack/layout.css +46 -44
- package/dist/layouts/stack/stack.d.ts +1 -0
- package/dist/layouts/stack/stack.js +16 -69
- package/dist/locales/ar-EG.js +25 -2
- package/dist/locales/create-locale.d.ts +1 -2
- package/dist/locales/create-locale.js +0 -28
- package/dist/locales/de-DE.js +25 -2
- package/dist/locales/en-US.js +24 -1
- package/dist/locales/es-ES.js +25 -2
- package/dist/locales/fr-FR.js +25 -2
- package/dist/locales/hi-IN.js +25 -2
- package/dist/locales/id-ID.js +25 -2
- package/dist/locales/index.d.ts +10 -10
- package/dist/locales/index.js +9 -9
- package/dist/locales/it-IT.js +25 -2
- package/dist/locales/ja-JP.js +25 -2
- package/dist/locales/ko-KR.js +25 -2
- package/dist/locales/pt-BR.js +25 -2
- package/dist/locales/ru-RU.js +25 -2
- package/dist/locales/th-TH.js +25 -2
- package/dist/locales/tr-TR.js +25 -2
- package/dist/locales/vi-VN.js +25 -2
- package/dist/locales/zh-CN.js +25 -2
- package/dist/locales/zh-TW.js +25 -2
- package/dist/number-input/number-input.js +24 -81
- package/dist/number-input/use-number-input.d.ts +1 -0
- package/dist/number-input/use-number-input.js +47 -43
- package/dist/provider/locale.d.ts +1 -1
- package/dist/provider/tao-context.d.ts +38 -0
- package/dist/provider/tao-context.js +92 -0
- package/dist/provider/tao-portal-scope.d.ts +14 -0
- package/dist/provider/tao-portal-scope.js +54 -0
- package/dist/provider/tao-provider.d.ts +5 -55
- package/dist/provider/tao-provider.js +94 -364
- package/dist/theme/control.css +106 -122
- package/dist/theme/theme.css +4 -2
- package/dist/utils/dialog-content.js +55 -210
- package/dist/utils/overlay.js +15 -30
- package/dist/utils/rc-compat.d.ts +13 -0
- package/dist/utils/rc-compat.js +48 -0
- package/dist/utils/refs.js +5 -19
- package/package.json +10 -16
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
3
|
import { useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
5
4
|
import { cx } from "../../utils/semantic.js";
|
|
6
5
|
import { WatermarkContext } from "./watermark-context.js";
|
|
@@ -10,434 +9,244 @@ function fontString(font) {
|
|
|
10
9
|
return `${'none' === font.fontStyle ? 'normal' : font.fontStyle ?? 'normal'} ${font.fontWeight ?? 400} ${'number' == typeof font.fontSize ? `${font.fontSize}px` : font.fontSize ?? '16px'} ${font.fontFamily ?? 'sans-serif'}`;
|
|
11
10
|
}
|
|
12
11
|
const Watermark = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let content;
|
|
18
|
-
let height;
|
|
19
|
-
let image;
|
|
20
|
-
let offset;
|
|
21
|
-
let onRemove;
|
|
22
|
-
let rest;
|
|
23
|
-
let rootClassName;
|
|
24
|
-
let style;
|
|
25
|
-
let styles;
|
|
26
|
-
let t0;
|
|
27
|
-
let t1;
|
|
28
|
-
let t2;
|
|
29
|
-
let t3;
|
|
30
|
-
let width;
|
|
31
|
-
let zIndex;
|
|
32
|
-
if ($[0] !== props) {
|
|
33
|
-
({ zIndex, rotate: t0, width, height, image, content, font: t1, rootClassName, gap: t2, offset, children, inherit: t3, onRemove, classNames, styles, className, style, ...rest } = props);
|
|
34
|
-
$[0] = props;
|
|
35
|
-
$[1] = children;
|
|
36
|
-
$[2] = className;
|
|
37
|
-
$[3] = classNames;
|
|
38
|
-
$[4] = content;
|
|
39
|
-
$[5] = height;
|
|
40
|
-
$[6] = image;
|
|
41
|
-
$[7] = offset;
|
|
42
|
-
$[8] = onRemove;
|
|
43
|
-
$[9] = rest;
|
|
44
|
-
$[10] = rootClassName;
|
|
45
|
-
$[11] = style;
|
|
46
|
-
$[12] = styles;
|
|
47
|
-
$[13] = t0;
|
|
48
|
-
$[14] = t1;
|
|
49
|
-
$[15] = t2;
|
|
50
|
-
$[16] = t3;
|
|
51
|
-
$[17] = width;
|
|
52
|
-
$[18] = zIndex;
|
|
53
|
-
} else {
|
|
54
|
-
children = $[1];
|
|
55
|
-
className = $[2];
|
|
56
|
-
classNames = $[3];
|
|
57
|
-
content = $[4];
|
|
58
|
-
height = $[5];
|
|
59
|
-
image = $[6];
|
|
60
|
-
offset = $[7];
|
|
61
|
-
onRemove = $[8];
|
|
62
|
-
rest = $[9];
|
|
63
|
-
rootClassName = $[10];
|
|
64
|
-
style = $[11];
|
|
65
|
-
styles = $[12];
|
|
66
|
-
t0 = $[13];
|
|
67
|
-
t1 = $[14];
|
|
68
|
-
t2 = $[15];
|
|
69
|
-
t3 = $[16];
|
|
70
|
-
width = $[17];
|
|
71
|
-
zIndex = $[18];
|
|
72
|
-
}
|
|
73
|
-
const rotate = void 0 === t0 ? -22 : t0;
|
|
74
|
-
const font = void 0 === t1 ? EMPTY_FONT : t1;
|
|
75
|
-
let t4;
|
|
76
|
-
if ($[19] !== t2) {
|
|
77
|
-
t4 = void 0 === t2 ? [
|
|
78
|
-
100,
|
|
79
|
-
100
|
|
80
|
-
] : t2;
|
|
81
|
-
$[19] = t2;
|
|
82
|
-
$[20] = t4;
|
|
83
|
-
} else t4 = $[20];
|
|
84
|
-
const gap = t4;
|
|
85
|
-
const inherit = void 0 === t3 ? true : t3;
|
|
12
|
+
const { zIndex, rotate = -22, width, height, image, content, font = EMPTY_FONT, rootClassName, gap = [
|
|
13
|
+
100,
|
|
14
|
+
100
|
|
15
|
+
], offset, children, inherit = true, onRemove, classNames, styles, className, style, ...rest } = props;
|
|
86
16
|
const theme = useTaoInternalConfig();
|
|
87
17
|
const root = useRef(null);
|
|
88
18
|
const [tile, setTile] = useState();
|
|
89
|
-
const [panels, setPanels] = useState(
|
|
19
|
+
const [panels, setPanels] = useState(()=>new Set());
|
|
90
20
|
const removeCallback = useRef(onRemove);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
let t7;
|
|
101
|
-
if ($[22] !== onRemove) {
|
|
102
|
-
t6 = ()=>{
|
|
103
|
-
removeCallback.current = onRemove;
|
|
104
|
-
};
|
|
105
|
-
t7 = [
|
|
106
|
-
onRemove
|
|
107
|
-
];
|
|
108
|
-
$[22] = onRemove;
|
|
109
|
-
$[23] = t6;
|
|
110
|
-
$[24] = t7;
|
|
111
|
-
} else {
|
|
112
|
-
t6 = $[23];
|
|
113
|
-
t7 = $[24];
|
|
114
|
-
}
|
|
115
|
-
useLayoutEffect(t6, t7);
|
|
116
|
-
let t8;
|
|
117
|
-
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t8 = {
|
|
21
|
+
useImperativeHandle(ref, ()=>({
|
|
22
|
+
nativeElement: root.current
|
|
23
|
+
}));
|
|
24
|
+
useLayoutEffect(()=>{
|
|
25
|
+
removeCallback.current = onRemove;
|
|
26
|
+
}, [
|
|
27
|
+
onRemove
|
|
28
|
+
]);
|
|
29
|
+
const context = useMemo(()=>({
|
|
119
30
|
add: (element)=>setPanels((previous)=>previous.has(element) ? previous : new Set([
|
|
120
31
|
...previous,
|
|
121
32
|
element
|
|
122
33
|
])),
|
|
123
|
-
remove: (
|
|
124
|
-
if (!
|
|
125
|
-
const next = new Set(
|
|
126
|
-
next.delete(
|
|
34
|
+
remove: (element)=>setPanels((previous)=>{
|
|
35
|
+
if (!previous.has(element)) return previous;
|
|
36
|
+
const next = new Set(previous);
|
|
37
|
+
next.delete(element);
|
|
127
38
|
return next;
|
|
128
39
|
})
|
|
129
|
-
};
|
|
130
|
-
$[25] = t8;
|
|
131
|
-
} else t8 = $[25];
|
|
132
|
-
const context = t8;
|
|
40
|
+
}), []);
|
|
133
41
|
const [gapX, gapY] = gap;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
probe.style.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
42
|
+
useEffect(()=>{
|
|
43
|
+
let cancelled = false;
|
|
44
|
+
const canvas = document.createElement('canvas');
|
|
45
|
+
const ctx = canvas.getContext('2d');
|
|
46
|
+
if (!ctx) throw new Error('Watermark requires a Canvas 2D rendering context.');
|
|
47
|
+
const probe = document.createElement('span');
|
|
48
|
+
probe.style.color = 'var(--tao-color-fill)';
|
|
49
|
+
probe.dataset.taoTheme = theme.mode;
|
|
50
|
+
Object.entries(theme.tokenStyle).forEach(([key, value])=>{
|
|
51
|
+
probe.style.setProperty(key, String(value));
|
|
52
|
+
});
|
|
53
|
+
root.current.append(probe);
|
|
54
|
+
const defaultColor = getComputedStyle(probe).color;
|
|
55
|
+
probe.remove();
|
|
56
|
+
const lines = (Array.isArray(content) ? content : void 0 === content ? [] : [
|
|
57
|
+
content
|
|
58
|
+
]).map((line)=>'string' == typeof line ? {
|
|
59
|
+
text: line,
|
|
60
|
+
font
|
|
61
|
+
} : {
|
|
62
|
+
text: line.text,
|
|
63
|
+
font: {
|
|
64
|
+
...font,
|
|
65
|
+
...line.font
|
|
66
|
+
}
|
|
148
67
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
68
|
+
const metrics = lines.map((line)=>{
|
|
69
|
+
ctx.font = fontString(line.font);
|
|
70
|
+
const size = ctx.measureText(line.text);
|
|
71
|
+
return {
|
|
72
|
+
width: size.width,
|
|
73
|
+
height: (size.fontBoundingBoxAscent ?? size.actualBoundingBoxAscent ?? 12) + (size.fontBoundingBoxDescent ?? size.actualBoundingBoxDescent ?? 4)
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
const textWidth = Math.ceil(Math.max(0, ...metrics.map((metric)=>metric.width)));
|
|
77
|
+
const textHeight = metrics.reduce((sum, metric)=>sum + metric.height, 0) + 3 * Math.max(0, lines.length - 1);
|
|
78
|
+
const radians = rotate * Math.PI / 180;
|
|
79
|
+
const draw = (picture)=>{
|
|
80
|
+
if (cancelled) return;
|
|
81
|
+
const markWidth = width ?? Math.max(image ? 120 : 0, picture ? 0 : textWidth);
|
|
82
|
+
const markHeight = height ?? Math.max(image ? 64 : 0, picture ? 0 : textHeight);
|
|
83
|
+
const rotatedWidth = Math.abs(markWidth * Math.cos(radians)) + Math.abs(markHeight * Math.sin(radians));
|
|
84
|
+
const rotatedHeight = Math.abs(markWidth * Math.sin(radians)) + Math.abs(markHeight * Math.cos(radians));
|
|
85
|
+
const tileWidth = Math.max(1, Math.ceil(rotatedWidth + gapX));
|
|
86
|
+
const tileHeight = Math.max(1, Math.ceil(rotatedHeight + gapY));
|
|
87
|
+
const ratio = window.devicePixelRatio || 1;
|
|
88
|
+
canvas.width = Math.ceil(tileWidth * ratio);
|
|
89
|
+
canvas.height = Math.ceil(tileHeight * ratio);
|
|
90
|
+
ctx.scale(ratio, ratio);
|
|
91
|
+
ctx.translate(tileWidth / 2, tileHeight / 2);
|
|
92
|
+
ctx.rotate(radians);
|
|
93
|
+
if (picture) ctx.drawImage(picture, -markWidth / 2, -markHeight / 2, markWidth, markHeight);
|
|
94
|
+
else {
|
|
95
|
+
let y = -markHeight / 2;
|
|
96
|
+
lines.forEach((line, index)=>{
|
|
97
|
+
ctx.font = fontString(line.font);
|
|
98
|
+
ctx.fillStyle = line.font.color ?? defaultColor;
|
|
99
|
+
ctx.textAlign = line.font.textAlign ?? 'center';
|
|
100
|
+
ctx.textBaseline = 'top';
|
|
101
|
+
const x = 'left' === ctx.textAlign || 'start' === ctx.textAlign ? -markWidth / 2 : 'right' === ctx.textAlign || 'end' === ctx.textAlign ? markWidth / 2 : 0;
|
|
102
|
+
ctx.fillText(line.text, x, y);
|
|
103
|
+
y += metrics[index].height + 3;
|
|
163
104
|
});
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
height: (size.fontBoundingBoxAscent ?? size.actualBoundingBoxAscent ?? 12) + (size.fontBoundingBoxDescent ?? size.actualBoundingBoxDescent ?? 4)
|
|
170
|
-
};
|
|
105
|
+
}
|
|
106
|
+
setTile({
|
|
107
|
+
url: canvas.toDataURL(),
|
|
108
|
+
width: tileWidth,
|
|
109
|
+
height: tileHeight
|
|
171
110
|
});
|
|
172
|
-
const textWidth = Math.ceil(Math.max(0, ...metrics.map(_temp2)));
|
|
173
|
-
const textHeight = metrics.reduce(_temp3, 0) + 3 * Math.max(0, lines.length - 1);
|
|
174
|
-
const radians = rotate * Math.PI / 180;
|
|
175
|
-
const draw = (picture)=>{
|
|
176
|
-
if (cancelled) return;
|
|
177
|
-
const markWidth = width ?? Math.max(image ? 120 : 0, picture ? 0 : textWidth);
|
|
178
|
-
const markHeight = height ?? Math.max(image ? 64 : 0, picture ? 0 : textHeight);
|
|
179
|
-
const rotatedWidth = Math.abs(markWidth * Math.cos(radians)) + Math.abs(markHeight * Math.sin(radians));
|
|
180
|
-
const rotatedHeight = Math.abs(markWidth * Math.sin(radians)) + Math.abs(markHeight * Math.cos(radians));
|
|
181
|
-
const tileWidth = Math.max(1, Math.ceil(rotatedWidth + gapX));
|
|
182
|
-
const tileHeight = Math.max(1, Math.ceil(rotatedHeight + gapY));
|
|
183
|
-
const ratio = window.devicePixelRatio || 1;
|
|
184
|
-
canvas.width = Math.ceil(tileWidth * ratio);
|
|
185
|
-
canvas.height = Math.ceil(tileHeight * ratio);
|
|
186
|
-
ctx.scale(ratio, ratio);
|
|
187
|
-
ctx.translate(tileWidth / 2, tileHeight / 2);
|
|
188
|
-
ctx.rotate(radians);
|
|
189
|
-
if (picture) ctx.drawImage(picture, -markWidth / 2, -markHeight / 2, markWidth, markHeight);
|
|
190
|
-
else {
|
|
191
|
-
let y = -markHeight / 2;
|
|
192
|
-
lines.forEach((line_1, index)=>{
|
|
193
|
-
ctx.font = fontString(line_1.font);
|
|
194
|
-
ctx.fillStyle = line_1.font.color ?? defaultColor;
|
|
195
|
-
ctx.textAlign = line_1.font.textAlign ?? "center";
|
|
196
|
-
ctx.textBaseline = "top";
|
|
197
|
-
const x = "left" === ctx.textAlign || "start" === ctx.textAlign ? -markWidth / 2 : "right" === ctx.textAlign || "end" === ctx.textAlign ? markWidth / 2 : 0;
|
|
198
|
-
ctx.fillText(line_1.text, x, y);
|
|
199
|
-
y += metrics[index].height + 3;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
setTile({
|
|
203
|
-
url: canvas.toDataURL(),
|
|
204
|
-
width: tileWidth,
|
|
205
|
-
height: tileHeight
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
let picture_0;
|
|
209
|
-
if (image) {
|
|
210
|
-
picture_0 = new Image();
|
|
211
|
-
picture_0.crossOrigin = "anonymous";
|
|
212
|
-
picture_0.referrerPolicy = "no-referrer";
|
|
213
|
-
picture_0.onload = ()=>draw(picture_0);
|
|
214
|
-
picture_0.onerror = ()=>draw();
|
|
215
|
-
picture_0.src = image;
|
|
216
|
-
} else draw();
|
|
217
|
-
return ()=>{
|
|
218
|
-
cancelled = true;
|
|
219
|
-
if (picture_0) {
|
|
220
|
-
picture_0.onload = null;
|
|
221
|
-
picture_0.onerror = null;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
111
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
useEffect(t9, t10);
|
|
112
|
+
let picture;
|
|
113
|
+
if (image) {
|
|
114
|
+
picture = new Image();
|
|
115
|
+
picture.crossOrigin = 'anonymous';
|
|
116
|
+
picture.referrerPolicy = 'no-referrer';
|
|
117
|
+
picture.onload = ()=>draw(picture);
|
|
118
|
+
picture.onerror = ()=>draw();
|
|
119
|
+
picture.src = image;
|
|
120
|
+
} else draw();
|
|
121
|
+
return ()=>{
|
|
122
|
+
cancelled = true;
|
|
123
|
+
if (picture) {
|
|
124
|
+
picture.onload = null;
|
|
125
|
+
picture.onerror = null;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}, [
|
|
129
|
+
rotate,
|
|
130
|
+
width,
|
|
131
|
+
height,
|
|
132
|
+
image,
|
|
133
|
+
content,
|
|
134
|
+
font,
|
|
135
|
+
gapX,
|
|
136
|
+
gapY,
|
|
137
|
+
theme.mode,
|
|
138
|
+
theme.tokenStyle
|
|
139
|
+
]);
|
|
254
140
|
const offsetX = (offset?.[0] ?? gapX / 2) - gapX / 2;
|
|
255
141
|
const offsetY = (offset?.[1] ?? gapY / 2) - gapY / 2;
|
|
256
|
-
const rootPosition = style?.position ?? styles?.root?.position ??
|
|
257
|
-
const rootOverflow = style?.overflow ?? styles?.root?.overflow ??
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
142
|
+
const rootPosition = style?.position ?? styles?.root?.position ?? 'relative';
|
|
143
|
+
const rootOverflow = style?.overflow ?? styles?.root?.overflow ?? 'hidden';
|
|
144
|
+
useEffect(()=>{
|
|
145
|
+
if (!tile) return;
|
|
146
|
+
const holders = [
|
|
147
|
+
root.current,
|
|
148
|
+
...panels
|
|
149
|
+
];
|
|
150
|
+
const cleanups = holders.map((holder)=>{
|
|
151
|
+
const originalPosition = holder.style.position;
|
|
152
|
+
if ('static' === getComputedStyle(holder).position) holder.style.position = 'relative';
|
|
153
|
+
const mark = document.createElement('div');
|
|
154
|
+
mark.setAttribute('data-tao-watermark-mark', '');
|
|
155
|
+
mark.setAttribute('aria-hidden', 'true');
|
|
156
|
+
const markStyle = {
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
left: Math.max(0, offsetX),
|
|
159
|
+
top: Math.max(0, offsetY),
|
|
160
|
+
width: offsetX > 0 ? `calc(100% - ${offsetX}px)` : '100%',
|
|
161
|
+
height: offsetY > 0 ? `calc(100% - ${offsetY}px)` : '100%',
|
|
162
|
+
zIndex: zIndex ?? 'calc(var(--tao-z-index-popup-base) - 1)',
|
|
163
|
+
pointerEvents: 'none',
|
|
164
|
+
backgroundRepeat: 'repeat',
|
|
165
|
+
backgroundImage: `url("${tile.url}")`,
|
|
166
|
+
backgroundSize: `${tile.width}px ${tile.height}px`,
|
|
167
|
+
backgroundPosition: `${Math.min(0, offsetX)}px ${Math.min(0, offsetY)}px`,
|
|
168
|
+
...styles?.mark
|
|
169
|
+
};
|
|
170
|
+
for (const [key, value] of Object.entries(markStyle)){
|
|
171
|
+
if (null == value) continue;
|
|
172
|
+
const property = key.startsWith('--') ? key : key.replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`);
|
|
173
|
+
mark.style.setProperty(property, String(value));
|
|
174
|
+
if ('number' == typeof value && !mark.style.getPropertyValue(property)) mark.style.setProperty(property, `${value}px`);
|
|
175
|
+
}
|
|
176
|
+
mark.style.setProperty('visibility', 'visible', 'important');
|
|
177
|
+
const expectedStyle = mark.style.cssText;
|
|
178
|
+
const expectedClass = classNames?.mark ?? '';
|
|
179
|
+
mark.className = expectedClass;
|
|
180
|
+
holder.append(mark);
|
|
181
|
+
const observer = new MutationObserver((records)=>{
|
|
182
|
+
const removed = mark.parentElement !== holder;
|
|
183
|
+
const changed = records.some((record)=>record.target === mark);
|
|
184
|
+
const rootChanged = holder === root.current && records.some((record)=>record.target === holder && 'style' === record.attributeName);
|
|
185
|
+
if (!removed && !changed && !rootChanged) return;
|
|
186
|
+
observer.disconnect();
|
|
187
|
+
if (removed) {
|
|
188
|
+
holder.append(mark);
|
|
189
|
+
removeCallback.current?.();
|
|
291
190
|
}
|
|
292
|
-
mark.style.
|
|
293
|
-
const expectedStyle = mark.style.cssText;
|
|
294
|
-
const expectedClass = classNames?.mark ?? "";
|
|
191
|
+
mark.style.cssText = expectedStyle;
|
|
295
192
|
mark.className = expectedClass;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
holder.append(mark);
|
|
305
|
-
removeCallback.current?.();
|
|
306
|
-
}
|
|
307
|
-
mark.style.cssText = expectedStyle;
|
|
308
|
-
mark.className = expectedClass;
|
|
309
|
-
mark.setAttribute("data-tao-watermark-mark", "");
|
|
310
|
-
mark.setAttribute("aria-hidden", "true");
|
|
311
|
-
mark.removeAttribute("hidden");
|
|
312
|
-
mark.replaceChildren();
|
|
313
|
-
if (rootChanged) {
|
|
314
|
-
holder.style.position = rootPosition;
|
|
315
|
-
holder.style.overflow = rootOverflow;
|
|
316
|
-
}
|
|
317
|
-
observer.observe(holder, {
|
|
318
|
-
childList: true,
|
|
319
|
-
attributes: true,
|
|
320
|
-
subtree: true
|
|
321
|
-
});
|
|
322
|
-
});
|
|
193
|
+
mark.setAttribute('data-tao-watermark-mark', '');
|
|
194
|
+
mark.setAttribute('aria-hidden', 'true');
|
|
195
|
+
mark.removeAttribute('hidden');
|
|
196
|
+
mark.replaceChildren();
|
|
197
|
+
if (rootChanged) {
|
|
198
|
+
holder.style.position = rootPosition;
|
|
199
|
+
holder.style.overflow = rootOverflow;
|
|
200
|
+
}
|
|
323
201
|
observer.observe(holder, {
|
|
324
202
|
childList: true,
|
|
325
203
|
attributes: true,
|
|
326
204
|
subtree: true
|
|
327
205
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
206
|
+
});
|
|
207
|
+
observer.observe(holder, {
|
|
208
|
+
childList: true,
|
|
209
|
+
attributes: true,
|
|
210
|
+
subtree: true
|
|
333
211
|
});
|
|
334
212
|
return ()=>{
|
|
335
|
-
|
|
213
|
+
observer.disconnect();
|
|
214
|
+
mark.remove();
|
|
215
|
+
if (holder !== root.current && 'relative' === holder.style.position) holder.style.position = originalPosition;
|
|
336
216
|
};
|
|
217
|
+
});
|
|
218
|
+
return ()=>{
|
|
219
|
+
cleanups.forEach((cleanup)=>{
|
|
220
|
+
cleanup();
|
|
221
|
+
});
|
|
337
222
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
offsetY,
|
|
359
|
-
t12,
|
|
360
|
-
t13,
|
|
361
|
-
rootPosition,
|
|
362
|
-
rootOverflow
|
|
363
|
-
];
|
|
364
|
-
$[48] = offsetX;
|
|
365
|
-
$[49] = offsetY;
|
|
366
|
-
$[50] = panels;
|
|
367
|
-
$[51] = rootOverflow;
|
|
368
|
-
$[52] = rootPosition;
|
|
369
|
-
$[53] = t12;
|
|
370
|
-
$[54] = t13;
|
|
371
|
-
$[55] = tile;
|
|
372
|
-
$[56] = zIndex;
|
|
373
|
-
$[57] = t14;
|
|
374
|
-
} else t14 = $[57];
|
|
375
|
-
useEffect(t11, t14);
|
|
376
|
-
const t15 = classNames?.root;
|
|
377
|
-
let t16;
|
|
378
|
-
if ($[58] !== className || $[59] !== rootClassName || $[60] !== t15) {
|
|
379
|
-
t16 = cx(t15, className, rootClassName);
|
|
380
|
-
$[58] = className;
|
|
381
|
-
$[59] = rootClassName;
|
|
382
|
-
$[60] = t15;
|
|
383
|
-
$[61] = t16;
|
|
384
|
-
} else t16 = $[61];
|
|
385
|
-
const t17 = styles?.root;
|
|
386
|
-
let t18;
|
|
387
|
-
if ($[62] !== style || $[63] !== t17) {
|
|
388
|
-
t18 = {
|
|
389
|
-
position: "relative",
|
|
390
|
-
overflow: "hidden",
|
|
391
|
-
...t17,
|
|
223
|
+
}, [
|
|
224
|
+
tile,
|
|
225
|
+
panels,
|
|
226
|
+
zIndex,
|
|
227
|
+
offsetX,
|
|
228
|
+
offsetY,
|
|
229
|
+
styles?.mark,
|
|
230
|
+
classNames?.mark,
|
|
231
|
+
rootPosition,
|
|
232
|
+
rootOverflow
|
|
233
|
+
]);
|
|
234
|
+
return /*#__PURE__*/ jsx("div", {
|
|
235
|
+
...rest,
|
|
236
|
+
ref: root,
|
|
237
|
+
"data-tao-watermark": "",
|
|
238
|
+
className: cx(classNames?.root, className, rootClassName),
|
|
239
|
+
style: {
|
|
240
|
+
position: 'relative',
|
|
241
|
+
overflow: 'hidden',
|
|
242
|
+
...styles?.root,
|
|
392
243
|
...style
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
$[64] = t18;
|
|
397
|
-
} else t18 = $[64];
|
|
398
|
-
const t19 = inherit ? context : null;
|
|
399
|
-
let t20;
|
|
400
|
-
if ($[65] !== children || $[66] !== t19) {
|
|
401
|
-
t20 = /*#__PURE__*/ jsx(WatermarkContext.Provider, {
|
|
402
|
-
value: t19,
|
|
244
|
+
},
|
|
245
|
+
children: /*#__PURE__*/ jsx(WatermarkContext.Provider, {
|
|
246
|
+
value: inherit ? context : null,
|
|
403
247
|
children: children
|
|
404
|
-
})
|
|
405
|
-
|
|
406
|
-
$[66] = t19;
|
|
407
|
-
$[67] = t20;
|
|
408
|
-
} else t20 = $[67];
|
|
409
|
-
let t21;
|
|
410
|
-
if ($[68] !== rest || $[69] !== t16 || $[70] !== t18 || $[71] !== t20) {
|
|
411
|
-
t21 = /*#__PURE__*/ jsx("div", {
|
|
412
|
-
...rest,
|
|
413
|
-
ref: root,
|
|
414
|
-
"data-tao-watermark": "",
|
|
415
|
-
className: t16,
|
|
416
|
-
style: t18,
|
|
417
|
-
children: t20
|
|
418
|
-
});
|
|
419
|
-
$[68] = rest;
|
|
420
|
-
$[69] = t16;
|
|
421
|
-
$[70] = t18;
|
|
422
|
-
$[71] = t20;
|
|
423
|
-
$[72] = t21;
|
|
424
|
-
} else t21 = $[72];
|
|
425
|
-
return t21;
|
|
248
|
+
})
|
|
249
|
+
});
|
|
426
250
|
});
|
|
427
251
|
Watermark.displayName = 'Watermark';
|
|
428
|
-
function _temp() {
|
|
429
|
-
return new Set();
|
|
430
|
-
}
|
|
431
|
-
function _temp2(metric) {
|
|
432
|
-
return metric.width;
|
|
433
|
-
}
|
|
434
|
-
function _temp3(sum, metric_0) {
|
|
435
|
-
return sum + metric_0.height;
|
|
436
|
-
}
|
|
437
|
-
function _temp4(letter) {
|
|
438
|
-
return `-${letter.toLowerCase()}`;
|
|
439
|
-
}
|
|
440
|
-
function _temp5(cleanup) {
|
|
441
|
-
cleanup();
|
|
442
|
-
}
|
|
443
252
|
export { Watermark };
|
|
@@ -28,7 +28,7 @@ const stackDoc = {
|
|
|
28
28
|
bestPractices: [
|
|
29
29
|
'Prefer Stack over one-off margin rules for repeated spacing.',
|
|
30
30
|
'Use semantic containers when the layout has richer meaning.',
|
|
31
|
-
|
|
31
|
+
"Pass breakpoint maps (e.g. direction={{ xs: 'vertical', md: 'horizontal' }}) for responsive layouts."
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
props: [
|