From 6cbb3a5d2a86ecbb3840dc5c88b6ec8dbbed1d60 Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Tue, 30 Jan 2024 18:25:34 -0500 Subject: [PATCH 1/3] fix: add default word-break to .trix-content --- src/exports/styles/trix-core.css | 44 +++++++++++++++++--------------- src/exports/styles/trix.css | 44 +++++++++++++++++--------------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/exports/styles/trix-core.css b/src/exports/styles/trix-core.css index 69690bf5..b48095a2 100644 --- a/src/exports/styles/trix-core.css +++ b/src/exports/styles/trix-core.css @@ -1,8 +1,25 @@ /* These all come from Trix / ActionText. This should probably be cleaned up into a regular .css for users to include. */ -.trix-content .rhino-upload-error { - background-color: rgba(255, 0, 0, 0.3); + +.trix-content { + border: 1px solid var(--rhino-border-color); + border-radius: 0px 0px var(--rhino-border-radius) var(--rhino-border-radius); + margin: 0; + padding: 0.4em 0.6em; + min-height: 200px; + outline: transparent; + overflow-wrap: break-word; + word-break: break-word; +} + +.trix-content[contenteditable="true"] { + /* Required by Prosemirror / TipTap */ + white-space: pre-wrap; +} + +.trix-content:is(:focus, :focus-within) { + border-color: var(--rhino-button-active-border-color); } .trix-content :is(img, svg, figure) { @@ -46,6 +63,10 @@ white-space: break-spaces; } +.trix-content .rhino-upload-error { + background-color: rgba(255, 0, 0, 0.3); +} + /* Attachments */ .trix-content:not([readonly]) figure:is(:focus-within, :focus, .has-focus):nth-child(2) { @@ -74,25 +95,6 @@ cursor: text; content: ""; } - -.trix-content { - border: 1px solid var(--rhino-border-color); - border-radius: 0px 0px var(--rhino-border-radius) var(--rhino-border-radius); - margin: 0; - padding: 0.4em 0.6em; - min-height: 200px; - outline: transparent; -} - -.trix-content[contenteditable="true"] { - /* Required by Prosemirror / TipTap */ - white-space: pre-wrap; -} - -.trix-content:is(:focus, :focus-within) { - border-color: var(--rhino-button-active-border-color); -} - .trix-content figure.attachment figcaption { position: relative; } diff --git a/src/exports/styles/trix.css b/src/exports/styles/trix.css index e81cd719..5d736622 100644 --- a/src/exports/styles/trix.css +++ b/src/exports/styles/trix.css @@ -2,8 +2,25 @@ /* These all come from Trix / ActionText. This should probably be cleaned up into a regular .css for users to include. */ -.trix-content .rhino-upload-error { - background-color: rgba(255, 0, 0, 0.3); + +.trix-content { + border: 1px solid var(--rhino-border-color); + border-radius: 0px 0px var(--rhino-border-radius) var(--rhino-border-radius); + margin: 0; + padding: 0.4em 0.6em; + min-height: 200px; + outline: transparent; + overflow-wrap: break-word; + word-break: break-word; +} + +.trix-content[contenteditable="true"] { + /* Required by Prosemirror / TipTap */ + white-space: pre-wrap; +} + +.trix-content:is(:focus, :focus-within) { + border-color: var(--rhino-button-active-border-color); } .trix-content :is(img, svg, figure) { @@ -47,6 +64,10 @@ white-space: break-spaces; } +.trix-content .rhino-upload-error { + background-color: rgba(255, 0, 0, 0.3); +} + /* Attachments */ .trix-content:not([readonly]) figure:is(:focus-within, :focus, .has-focus):nth-child(2) { @@ -75,25 +96,6 @@ cursor: text; content: ""; } - -.trix-content { - border: 1px solid var(--rhino-border-color); - border-radius: 0px 0px var(--rhino-border-radius) var(--rhino-border-radius); - margin: 0; - padding: 0.4em 0.6em; - min-height: 200px; - outline: transparent; -} - -.trix-content[contenteditable="true"] { - /* Required by Prosemirror / TipTap */ - white-space: pre-wrap; -} - -.trix-content:is(:focus, :focus-within) { - border-color: var(--rhino-button-active-border-color); -} - .trix-content figure.attachment figcaption { position: relative; } From 6ccbefd2cbcdec4e735e50f4cd7e3b615a4a30c6 Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Tue, 30 Jan 2024 18:26:38 -0500 Subject: [PATCH 2/3] add changeset --- .changeset/brown-beds-cover.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/brown-beds-cover.md diff --git a/.changeset/brown-beds-cover.md b/.changeset/brown-beds-cover.md new file mode 100644 index 00000000..9aa6d76b --- /dev/null +++ b/.changeset/brown-beds-cover.md @@ -0,0 +1,5 @@ +--- +"rhino-editor": patch +--- + +Add default word-break to .trix-content From f3fe4d788ff0d59bf484cff07544d021e82ff3c2 Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Tue, 30 Jan 2024 18:40:37 -0500 Subject: [PATCH 3/3] upgrade bridgetown version --- docs/Gemfile | 12 +-- docs/Gemfile.lock | 114 +++++++++++++--------------- docs/config/initializers.rb | 22 ++++++ docs/package.json | 1 + docs/plugins/builders/inspectors.rb | 2 +- docs/pnpm-lock.yaml | 22 ++++++ 6 files changed, 104 insertions(+), 69 deletions(-) create mode 100644 docs/config/initializers.rb diff --git a/docs/Gemfile b/docs/Gemfile index 92b1e540..fd5e0257 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -17,21 +17,17 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } # This will help ensure the proper Bridgetown version is running. #### -# If you need to upgrade/switch Bridgetown versions, change the line below -# and then run `bundle update bridgetown` -gem "bridgetown", "~> 1.1" +gem "bridgetown", "~> 1.3" # Uncomment to add file-based dynamic routing to your project: -# gem "bridgetown-routes", "~> 1.1.0", group: :bridgetown_plugins +# gem "bridgetown-routes", "~> 1.3" # Uncomment to use the Inspectors API to manipulate the output # of your HTML or XML resources: -# gem "nokogiri", "~> 1.13" +gem "nokogiri", "~> 1.13" # Puma is a Rack-compatible server used by Bridgetown # (you can optionally limit this to the "development" group) gem "puma", "~> 5.6" -gem "bridgetown-quick-search", "~> 1.1", :group => :bridgetown_plugins - -gem "nokogiri", "~> 1.13" +gem "bridgetown-quick-search", "~> 2.0" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 774d6279..fd285ee6 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,31 +1,39 @@ GEM remote: https://rubygems.org/ specs: - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activesupport (7.0.4.3) + activemodel (7.1.3) + activesupport (= 7.1.3) + activesupport (7.1.3) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - amazing_print (1.4.0) - bridgetown (1.2.0) - bridgetown-builder (= 1.2.0) - bridgetown-core (= 1.2.0) - bridgetown-paginate (= 1.2.0) - bridgetown-builder (1.2.0) - bridgetown-core (= 1.2.0) - bridgetown-core (1.2.0) + amazing_print (1.5.0) + base64 (0.2.0) + bigdecimal (3.1.6) + bridgetown (1.3.2) + bridgetown-builder (= 1.3.2) + bridgetown-core (= 1.3.2) + bridgetown-paginate (= 1.3.2) + bridgetown-builder (1.3.2) + bridgetown-core (= 1.3.2) + bridgetown-core (1.3.2) activemodel (>= 6.0, < 8.0) activesupport (>= 6.0, < 8.0) addressable (~> 2.4) amazing_print (~> 1.2) colorator (~> 1.0) + csv (~> 3.2) erubi (~> 1.9) - faraday (~> 1.0) - faraday_middleware (~> 1.0) + faraday (~> 2.0) + faraday-follow_redirects (~> 0.3) hash_with_dot_access (~> 1.2) i18n (~> 1.0) kramdown (~> 2.1) @@ -38,44 +46,28 @@ GEM serbea (~> 1.0) thor (~> 1.1) tilt (~> 2.0) - webrick (~> 1.7) zeitwerk (~> 2.5) - bridgetown-paginate (1.2.0) - bridgetown-core (= 1.2.0) - bridgetown-quick-search (1.1.3) - bridgetown (>= 0.15.0.beta1, < 2.0) + bridgetown-paginate (1.3.2) + bridgetown-core (= 1.3.2) + bridgetown-quick-search (2.0.0) + bridgetown (>= 1.2.0.beta2, < 2.0) colorator (1.1.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + csv (3.2.8) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - ffi (1.15.5) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.1.0) + net-http + ffi (1.16.3) hash_with_dot_access (1.2.0) activesupport (>= 5.0.0, < 8.0) - i18n (1.13.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) kramdown (2.4.0) rexml @@ -85,24 +77,26 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - minitest (5.18.0) - multipart-post (2.3.0) + minitest (5.21.2) + mutex_m (0.2.0) + net-http (0.4.1) + uri nio4r (2.5.8) nokogiri (1.13.9-arm64-darwin) racc (~> 1.4) nokogiri (1.13.9-x86_64-linux) racc (~> 1.4) - public_suffix (5.0.1) + public_suffix (5.0.4) puma (5.6.5) nio4r (~> 2.0) racc (1.6.0) - rack (3.0.7) - rake (13.0.6) + rack (3.0.8) + rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - roda (3.68.0) + rexml (3.2.6) + roda (3.76.0) rack rouge (3.30.0) ruby2_keywords (0.0.5) @@ -110,12 +104,12 @@ GEM activesupport (>= 6.0) erubi (>= 1.10) tilt (~> 2.0) - thor (1.2.2) - tilt (2.1.0) + thor (1.3.0) + tilt (2.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - webrick (1.8.1) - zeitwerk (2.6.8) + uri (0.13.0) + zeitwerk (2.6.12) PLATFORMS arm64-darwin-21 @@ -123,8 +117,8 @@ PLATFORMS x86_64-linux DEPENDENCIES - bridgetown (~> 1.1) - bridgetown-quick-search (~> 1.1) + bridgetown (~> 1.3) + bridgetown-quick-search (~> 2.0) nokogiri (~> 1.13) puma (~> 5.6) diff --git a/docs/config/initializers.rb b/docs/config/initializers.rb new file mode 100644 index 00000000..73134cdb --- /dev/null +++ b/docs/config/initializers.rb @@ -0,0 +1,22 @@ +Bridgetown.configure do |config| + config.url = ENV["URL"] || ENV["RELEASE_URL"] || "https://rhino-editor.vercel.app" + config.base_path = ENV.fetch("BASE_PATH", "/") + config.base_url = config.url + config.base_path + config.base_path_with_trailing_slash = config.base_path.ends_with?("/") ? config.base_path : config.base_path + "/" + config.base_path_no_trailing_slash = config.base_path.gsub(/\/$/, "") + init :"bridgetown-quick-search" + + # init :ssr + # init :"bridgetown-routes" + # only :server do + # roda do |app| + # app.plugin :default_headers, + # 'Content-Type'=>'text/html', + # 'Strict-Transport-Security'=>'max-age=16070400;', + # 'X-Content-Type-Options'=>'nosniff', + # 'X-Frame-Options'=>'deny', + # 'X-XSS-Protection'=>'1; mode=block', + # 'Access-Control-Allow-Origin'=>'*' + # end + # end +end diff --git a/docs/package.json b/docs/package.json index bc73172d..bf0ff035 100644 --- a/docs/package.json +++ b/docs/package.json @@ -26,6 +26,7 @@ "@shoelace-style/shoelace": "^2.12.0", "@tiptap/extension-character-count": "~2.1.7", "@tiptap/extension-code-block-lowlight": "~2.1.7", + "bridgetown-quick-search": "2.0.0", "linkifyjs": "^4.1.1", "lowlight": "^3.1.0", "prosemirror-view": "1.28.2", diff --git a/docs/plugins/builders/inspectors.rb b/docs/plugins/builders/inspectors.rb index 6a85d7f1..e772e2b9 100644 --- a/docs/plugins/builders/inspectors.rb +++ b/docs/plugins/builders/inspectors.rb @@ -9,7 +9,7 @@ def build def mark_external(document) document.css("a[href^='http']").each do |anchor| - next unless anchor[:href]&.starts_with?("http") && !anchor[:href]&.include?(site.config.url) + next unless anchor[:href]&.starts_with?("http") && !anchor[:href].to_s.include?(site.config.url) anchor[:target] = "_blank" anchor[:rel] = "nofollow noopener noreferrer" diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index bafc0246..3e3ce1ea 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -30,6 +30,9 @@ dependencies: '@tiptap/extension-code-block-lowlight': specifier: ~2.1.7 version: 2.1.7(@tiptap/core@2.1.16)(@tiptap/extension-code-block@2.1.16)(@tiptap/pm@2.1.16) + bridgetown-quick-search: + specifier: 2.0.0 + version: 2.0.0 linkifyjs: specifier: ^4.1.1 version: 4.1.1 @@ -77,6 +80,13 @@ devDependencies: packages: + /@babel/runtime@7.23.9: + resolution: {integrity: sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.1 + dev: false + /@csstools/postcss-cascade-layers@1.1.1(postcss@8.4.19): resolution: {integrity: sha512-+KdYrpKC5TgomQr2DlZF4lDEpHcoxnj5IGddYYfBWJAKfj1JtuHUIqMa+E1pJJ+z3kvDViWMqyqPlG4Ja7amQA==} engines: {node: ^12 || ^14 || >=16} @@ -521,6 +531,14 @@ packages: balanced-match: 1.0.2 dev: true + /bridgetown-quick-search@2.0.0: + resolution: {integrity: sha512-Sr8RS0qu+a9o4dDbRyaDGEcVEWphuuhcZUnqqgL6EghDncE4QiocGB8xem6mPdT+gWAw22O5BznqH3DCb1WI+Q==} + dependencies: + '@babel/runtime': 7.23.9 + lit: 2.8.0 + lunr: 2.3.9 + dev: false + /browserslist@4.21.4: resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1783,6 +1801,10 @@ packages: dependencies: pify: 2.3.0 + /regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + dev: false + /resolve@1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true