File tree Expand file tree Collapse file tree 6 files changed +22
-18
lines changed
Expand file tree Collapse file tree 6 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 11# Change Log
22All notable changes to this project will be documented in this file. This change log follows the conventions of [ keepachangelog.com] ( http://keepachangelog.com/ ) .
33
4+ ## 1.9.7 (2024-02-02)
5+
6+ #### Fixed
7+
8+ - Pop-out window no longer crashes. See #410 .
9+
410## 1.9.6 (2024-02-02)
511
612#### Fixed
Original file line number Diff line number Diff line change 1414 [day8.re-frame-10x.components.re-com :as rc]
1515 [day8.re-frame-10x.navigation.views :as container]
1616 [day8.re-frame-10x.panels.settings.subs :as settings.subs]
17- [day8.re-frame-10x.panels.settings.events :as settings.events]))
17+ [day8.re-frame-10x.panels.settings.events :as settings.events])
18+ (:require-macros [day8.re-frame-10x.components.re-com :refer [inline-resource]]))
1819
1920(goog-define debug? false )
2021
128129(defn ^:export handle-keys! [handle-keys?]
129130 (rf/dispatch [::settings.events/handle-keys? handle-keys?]))
130131
131- (defn create-shadow-root [css-str ]
132- (tools.shadow-dom/shadow-root js/document " --re-frame-10x--" css-str ))
132+ (defn create-shadow-root []
133+ (tools.shadow-dom/shadow-root js/document " --re-frame-10x--" ))
133134
134135(defn create-style-container [shadow-root]
135136 [spade.react/with-style-container
136137 (spade.dom/create-container shadow-root)
137- [devtools-outer
138- {:panel-type :inline
139- :debug? debug?}]])
138+ [:<>
139+ [:style (inline-resource " day8/re_frame_10x/style.css" )]
140+ [devtools-outer
141+ {:panel-type :inline
142+ :debug? debug?}]]])
140143
141144(defn patch!
142145 " Sets up any initial state that needs to be there for tracing. Does not enable tracing."
Original file line number Diff line number Diff line change 434434 :component-will-unmount unmount
435435 :reagent-render (fn []
436436 [spade.react/with-style-container spade-container
437- [devtools-inner {:panel-type :popup }]])})]
437+ [:<>
438+ [:style (inline-resource " day8/re_frame_10x/style.css" )]
439+ [devtools-inner {:panel-type :popup }]]])})]
438440 shadow-root)))
Original file line number Diff line number Diff line change 99 [day8.re-frame-10x :as re-frame-10x]
1010 [day8.re-frame-10x.inlined-deps.reagent.v1v2v0.reagent.dom :as rdom]
1111 [day8.re-frame-10x.inlined-deps.re-frame.v1v3v0.re-frame.core :as rf]
12- [day8.re-frame-10x.events :as events])
13- (:require-macros [day8.re-frame-10x.components.re-com :refer [inline-resource]]))
12+ [day8.re-frame-10x.events :as events]))
1413
1514(let [react-major-version (first (str/split react/version #"\. " ))]
1615 (when-not (= " 17" react-major-version)
2625
2726(rf/clear-subscription-cache! )
2827
29- (def shadow-root (re-frame-10x/create-shadow-root ( inline-resource " day8/re_frame_10x/style.css " ) ))
28+ (def shadow-root (re-frame-10x/create-shadow-root ))
3029
3130(rdom/render (re-frame-10x/create-style-container shadow-root)
3231 shadow-root)
Original file line number Diff line number Diff line change 2020
2121(rf/clear-subscription-cache! )
2222
23- (def shadow-root (re-frame-10x/create-shadow-root ( inline-resource " day8/re_frame_10x/style.css " ) ))
23+ (def shadow-root (re-frame-10x/create-shadow-root ))
2424
2525(rdc/render (rdc/create-root shadow-root)
2626 (re-frame-10x/create-style-container shadow-root))
Original file line number Diff line number Diff line change 11(ns day8.re-frame-10x.tools.shadow-dom )
22
3- (defn attach-stylesheet [shadow-root css-str]
4- (let [stylesheet (js/CSSStyleSheet. )
5- _ (.replaceSync stylesheet css-str)]
6- (set! (.-adoptedStyleSheets shadow-root) (js/Array. stylesheet))))
7-
83(defn shadow-root
94 " Creates a new div element with the id attached to the js-document <body>,
105 attaches a shadow DOM tree and returns a reference to its ShadowRoot."
11- [js-document id css-str ]
6+ [js-document id]
127 (let [container (.getElementById js-document id)]
138 (if container
149 (.-shadowRoot container)
1510 (let [body (.-body js-document)
1611 container (.createElement js-document " div" )
1712 shadow-root (.attachShadow container #js {:mode " open" })]
18- (attach-stylesheet shadow-root css-str)
1913 (.setAttribute container " id" id)
2014 (.appendChild body container)
2115 (js/window.focus container)
You can’t perform that action at this time.
0 commit comments