File tree 6 files changed +22
-18
lines changed
6 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
All notable changes to this project will be documented in this file. This change log follows the conventions of [ keepachangelog.com] ( http://keepachangelog.com/ ) .
3
3
4
+ ## 1.9.7 (2024-02-02)
5
+
6
+ #### Fixed
7
+
8
+ - Pop-out window no longer crashes. See #410 .
9
+
4
10
## 1.9.6 (2024-02-02)
5
11
6
12
#### Fixed
Original file line number Diff line number Diff line change 14
14
[day8.re-frame-10x.components.re-com :as rc]
15
15
[day8.re-frame-10x.navigation.views :as container]
16
16
[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]]))
18
19
19
20
(goog-define debug? false )
20
21
128
129
(defn ^:export handle-keys! [handle-keys?]
129
130
(rf/dispatch [::settings.events/handle-keys? handle-keys?]))
130
131
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--" ))
133
134
134
135
(defn create-style-container [shadow-root]
135
136
[spade.react/with-style-container
136
137
(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?}]]])
140
143
141
144
(defn patch!
142
145
" 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 434
434
:component-will-unmount unmount
435
435
:reagent-render (fn []
436
436
[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 }]]])})]
438
440
shadow-root)))
Original file line number Diff line number Diff line change 9
9
[day8.re-frame-10x :as re-frame-10x]
10
10
[day8.re-frame-10x.inlined-deps.reagent.v1v2v0.reagent.dom :as rdom]
11
11
[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]))
14
13
15
14
(let [react-major-version (first (str/split react/version #"\. " ))]
16
15
(when-not (= " 17" react-major-version)
26
25
27
26
(rf/clear-subscription-cache! )
28
27
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 ))
30
29
31
30
(rdom/render (re-frame-10x/create-style-container shadow-root)
32
31
shadow-root)
Original file line number Diff line number Diff line change 20
20
21
21
(rf/clear-subscription-cache! )
22
22
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 ))
24
24
25
25
(rdc/render (rdc/create-root shadow-root)
26
26
(re-frame-10x/create-style-container shadow-root))
Original file line number Diff line number Diff line change 1
1
(ns day8.re-frame-10x.tools.shadow-dom )
2
2
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
-
8
3
(defn shadow-root
9
4
" Creates a new div element with the id attached to the js-document <body>,
10
5
attaches a shadow DOM tree and returns a reference to its ShadowRoot."
11
- [js-document id css-str ]
6
+ [js-document id]
12
7
(let [container (.getElementById js-document id)]
13
8
(if container
14
9
(.-shadowRoot container)
15
10
(let [body (.-body js-document)
16
11
container (.createElement js-document " div" )
17
12
shadow-root (.attachShadow container #js {:mode " open" })]
18
- (attach-stylesheet shadow-root css-str)
19
13
(.setAttribute container " id" id)
20
14
(.appendChild body container)
21
15
(js/window.focus container)
You can’t perform that action at this time.
0 commit comments