Преглед изворни кода

enhance(ui): add without animation prop for the shui-related popoups

charlie пре 1 година
родитељ
комит
5f34d4da77

+ 3 - 1
packages/ui/@/components/ui/popover.tsx

@@ -24,7 +24,9 @@ const PopoverContent = React.forwardRef<
       sideOffset={sideOffset}
       className={cn(
         'ui__popover-content',
-        'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
+        'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',
+        // @ts-ignore
+        !props.withoutAnimation && 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
         className
       )}
       {...props}

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
resources/js/ui.js


+ 4 - 14
src/main/frontend/components/editor.cljs

@@ -714,7 +714,7 @@
     (some #(some-> % (:id) (str) (string/starts-with? ":editor.commands")))))
 
 ;; TODO: [WIP]
-(rum/defc shui-models
+(rum/defc shui-modals
   [id format action _data]
   (rum/use-effect!
     (fn []
@@ -732,6 +732,7 @@
                                          (state/clear-editor-action!)))}
                        :content-props {:onOpenAutoFocus #(.preventDefault %)
                                        :onCloseAutoFocus #(.preventDefault %)
+                                       :withoutAnimation true
                                        :data-editor-popup-ref "commands"}
                        :force-popover? true})
 
@@ -746,6 +747,7 @@
                                          (state/clear-editor-action!)))}
                        :content-props {:onOpenAutoFocus #(.preventDefault %)
                                        :onCloseAutoFocus #(.preventDefault %)
+                                       :withoutAnimation true
                                        :data-editor-popup-ref "commands"}
                        :force-popover? true})
 
@@ -813,20 +815,8 @@
   [id format]
   (let [action (state/sub :editor/action)]
     [:<>
-     (shui-models id format action nil)
+     (shui-modals id format action nil)
      (cond
-       (= action :commands-classic)
-       (animated-modal "commands" (commands id format) true)
-
-       (= action :block-commands-classic)
-       (animated-modal "block-commands" (block-commands id format) true)
-
-       (contains? #{:page-search-classic :page-search-hashtag-classic} action)
-       (animated-modal "page-search" (page-search id format) true)
-
-       (= :block-search-classic action)
-       (animated-modal "block-search" (block-search id format) true)
-
        (= :template-search action)
        (animated-modal "template-search" (template-search id format) true)
 

Неке датотеке нису приказане због велике количине промена