<commit_before>(ns frontend.components.clip-viewer
  (:require [clojure.set :as set]
            [clojure.string :as str]
            [cljs-time.core :as time]
            [datascript :as d]
            [frontend.async :refer [put!]]
            [frontend.auth :as auth]
            [frontend.components.common :as common]
            [frontend.datascript :as ds]
            [frontend.datetime :as datetime]
            [frontend.db :as fdb]
            [frontend.state :as state]
            [frontend.sente :as sente]
            [frontend.urls :as urls]
            [frontend.utils :as utils :include-macros true]
            [frontend.utils.date :refer (date->bucket)]
            [goog.date]
            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true])
  (:require-macros [sablono.core :refer (html)])
  (:import [goog.ui IdGenerator]))

(defn signup-prompt [app owner]
  (reify
    om/IDisplayName (display-name [_] "Clip Viewer Signup Prompt")
    om/IRender
    (render [_]
      (let [cast! (om/get-shared owner :cast!)]
        (html
         [:section.menu-view
          [:div.content
           [:h2.make
            "Keep track of everything you copy and paste."]
           [:p.make
            "If you sign in with Google we keep track of everything you copy."]
           [:div.calls-to-action.make
            (om/build common/google-login {:source "Clip viewer signup"})]]])))))

(defn clips-list [clips owner]
  (reify
    om/IDisplayName (display-name [_] "Clip Viewer clips List")
    om/IDidMount (did-mount [_] (fdb/watch-doc-name-changes owner))
    om/IRender
    (render [_]
      (let [cast! (om/get-shared owner :cast!)]
        (html
         [:div.content
          [:h2.make "Paste clips into your doc. "]
          [:p.make "Add new clips to the list by copying selected shapes on the canvas with Cmd+C. "
                   "Star clips to pin them to the top. "]
          [:div.clips
           (for [clip clips]
             (html
              [:div.clip.make
               [:a.clip-preview {:role "button"
                                 :on-click #(cast! :clip-pasted clip)}
                [:img.clip-thumbnail {:src (:clip/s3-url clip)}]]
               (if (:clip/important? clip)

                 [:div.clip-option.stuck
                  [:a.clip-button {:role "button"
                                   :on-click #(do (cast! :unimportant-clip-marked {:clip/uuid (:clip/uuid clip)})
                                                (utils/stop-event %))}
                   (common/icon :starred)]]
<commit_msg>ctrl+c to copy on windows<commit_after>(ns frontend.components.clip-viewer
  (:require [clojure.set :as set]
            [clojure.string :as str]
            [cljs-time.core :as time]
            [datascript :as d]
            [frontend.async :refer [put!]]
            [frontend.auth :as auth]
            [frontend.components.common :as common]
            [frontend.datascript :as ds]
            [frontend.datetime :as datetime]
            [frontend.db :as fdb]
            [frontend.state :as state]
            [frontend.sente :as sente]
            [frontend.urls :as urls]
            [frontend.utils :as utils :include-macros true]
            [frontend.utils.date :refer (date->bucket)]
            [goog.date]
            [goog.userAgent]
            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true])
  (:require-macros [sablono.core :refer (html)])
  (:import [goog.ui IdGenerator]))

(defn signup-prompt [app owner]
  (reify
    om/IDisplayName (display-name [_] "Clip Viewer Signup Prompt")
    om/IRender
    (render [_]
      (let [cast! (om/get-shared owner :cast!)]
        (html
         [:section.menu-view
          [:div.content
           [:h2.make
            "Keep track of everything you copy and paste."]
           [:p.make
            "If you sign in with Google, we'll keep track of all the shapes you copy from the canvas. Use this unique feature to create a custom library of your favorite components."]
           [:div.calls-to-action.make
            (om/build common/google-login {:source "Clip viewer signup"})]]])))))

(defn clips-list [clips owner]
  (reify
    om/IDisplayName (display-name [_] "Clip Viewer clips List")
    om/IInitState (init-state [_] {:mac? goog.userAgent/MAC})
    om/IDidMount (did-mount [_] (fdb/watch-doc-name-changes owner))
    om/IRender
    (render [_]
      (let [cast! (om/get-shared owner :cast!)]
        (html
         [:div.content
          [:h2.make "Paste clips into your doc. "]
          [:p.make "Add new clips to the list by copying selected shapes on the canvas with " (if (om/get-state owner :mac?)
                                                                                                "Cmd+C."
                                                                                                "Ctrl+C.")
                   " Star clips to pin them to the top. "]
          [:div.clips
           (for [clip clips]
             (html
              [:div.clip.make
               [:a.clip-preview {:role "button"
                                 :on-click #(cast! :clip-pasted clip)}
                [:img.clip-thumbnail {:src (:clip/s3-url clip)}]]
               (if (:clip/important? clip)

                 [:div.clip-option.stuck
                  [:a.clip-button {:role "button"
                                   :on-click #(do (cast! :unimportant-clip-marked {:clip/uuid (:clip/uuid clip)})
                                                (utils/stop-event %))}
                   (common/icon :starred)]]

{'fraction_non_alphanumeric': 0.12601914214817442, 'fraction_numerical': 0.0010634526763559022, 'mean_word_length': 1.5464801444043321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6072446', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1633, 'n_words': 446}