') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Update `highlight.js` dependency for dash-table by HammadTheOne · Pull Request #262 · plotly/dashR · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/dccClipboard.R
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
# AUTO GENERATED FILE - DO NOT EDIT

dccClipboard <- function(id=NULL, className=NULL, loading_state=NULL, n_clicks=NULL, style=NULL, target_id=NULL, text=NULL, title=NULL) {
dccClipboard <- function(id=NULL, className=NULL, content=NULL, loading_state=NULL, n_clicks=NULL, style=NULL, target_id=NULL, title=NULL) {

props <- list(id=id, className=className, loading_state=loading_state, n_clicks=n_clicks, style=style, target_id=target_id, text=text, title=title)
props <- list(id=id, className=className, content=content, loading_state=loading_state, n_clicks=n_clicks, style=style, target_id=target_id, title=title)
if (length(props) > 0) {
props <- props[!vapply(props, is.null, logical(1))]
}
component <- list(
props = props,
type = 'Clipboard',
namespace = 'dash_core_components',
propNames = c('id', 'className', 'loading_state', 'n_clicks', 'style', 'target_id', 'text', 'title'),
propNames = c('id', 'className', 'content', 'loading_state', 'n_clicks', 'style', 'target_id', 'title'),
package = 'dashCoreComponents'
)

Expand Down
6 changes: 3 additions & 3 deletions R/htmlTable.R
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
# AUTO GENERATED FILE - DO NOT EDIT

htmlTable <- function(children=NULL, id=NULL, accessKey=NULL, className=NULL, contentEditable=NULL, contextMenu=NULL, dir=NULL, draggable=NULL, hidden=NULL, key=NULL, lang=NULL, loading_state=NULL, n_clicks=NULL, n_clicks_timestamp=NULL, role=NULL, spellCheck=NULL, style=NULL, tabIndex=NULL, title=NULL, ...) {
htmlTable <- function(children=NULL, id=NULL, accessKey=NULL, className=NULL, contentEditable=NULL, contextMenu=NULL, dir=NULL, draggable=NULL, hidden=NULL, key=NULL, lang=NULL, loading_state=NULL, n_clicks=NULL, n_clicks_timestamp=NULL, role=NULL, spellCheck=NULL, style=NULL, summary=NULL, tabIndex=NULL, title=NULL, ...) {

wildcard_names = names(dash_assert_valid_wildcards(attrib = list('aria', 'data'), ...))

props <- list(children=children, id=id, accessKey=accessKey, className=className, contentEditable=contentEditable, contextMenu=contextMenu, dir=dir, draggable=draggable, hidden=hidden, key=key, lang=lang, loading_state=loading_state, n_clicks=n_clicks, n_clicks_timestamp=n_clicks_timestamp, role=role, spellCheck=spellCheck, style=style, tabIndex=tabIndex, title=title, ...)
props <- list(children=children, id=id, accessKey=accessKey, className=className, contentEditable=contentEditable, contextMenu=contextMenu, dir=dir, draggable=draggable, hidden=hidden, key=key, lang=lang, loading_state=loading_state, n_clicks=n_clicks, n_clicks_timestamp=n_clicks_timestamp, role=role, spellCheck=spellCheck, style=style, summary=summary, tabIndex=tabIndex, title=title, ...)
if (length(props) > 0) {
props <- props[!vapply(props, is.null, logical(1))]
}
component <- list(
props = props,
type = 'Table',
namespace = 'dash_html_components',
propNames = c('children', 'id', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'key', 'lang', 'loading_state', 'n_clicks', 'n_clicks_timestamp', 'role', 'spellCheck', 'style', 'tabIndex', 'title', wildcard_names),
propNames = c('children', 'id', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'key', 'lang', 'loading_state', 'n_clicks', 'n_clicks_timestamp', 'role', 'spellCheck', 'style', 'summary', 'tabIndex', 'title', wildcard_names),
package = 'dashHtmlComponents'
)

Expand Down
8 changes: 4 additions & 4 deletions R/internal.R
Original file line numberDiff line numberDiff line change
Expand Up@@ -133,7 +133,7 @@ all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_core_components` = structure(list(name = "dash_core_components",
version = "1.16.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-highlight.js',
script = 'core-async-highlight.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dash",
all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_core_components` = structure(list(name = "dash_core_components",
Expand DownExpand Up@@ -175,7 +175,7 @@ all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_core_components` = structure(list(name = "dash_core_components",
version = "1.16.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-highlight.js.map',
script = 'core-async-highlight.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dash",
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_core_components` = structure(list(name = "dash_core_components",
Expand DownExpand Up@@ -292,7 +292,7 @@ all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.11.3", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-highlight.js',
script = 'table-async-highlight.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dash",
all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
Expand All@@ -310,7 +310,7 @@ all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.11.3", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-highlight.js.map',
script = 'table-async-highlight.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dash",
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
Expand Down
24 changes: 14 additions & 10 deletions gulpfile.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,9 +42,13 @@ function copyCoreInstDirectory() {
path.resolve(__dirname, 'gulp-assets/dash-core-components/inst')
)
) {
return src('gulp-assets/dash-core-components/inst/**/*')
return src([
'gulp-assets/dash-core-components/inst/**/*',
'!gulp-assets/dash-core-components/inst/deps/async-highlight.js',
'!gulp-assets/dash-core-components/inst/deps/async-highlight.js.map',
])
.pipe(print())
.pipe(dest('inst/'));
.pipe(dest('inst/', {overwrite: true}));
}
return log('Unable to find dash-core-components inst directory.');
}
Expand All@@ -57,7 +61,7 @@ function copyHtmlInstDirectory() {
) {
return src('gulp-assets/dash-html-components/inst/**/*')
.pipe(print())
.pipe(dest('inst/'));
.pipe(dest('inst/', {overwrite: true}));
}
return log('Unable to find dash-html-components inst directory.');
}
Expand All@@ -69,7 +73,7 @@ function copyTableInstDirectory() {
'!gulp-assets/dash-table/inst/deps/index.html',
])
.pipe(print())
.pipe(dest('inst/'));
.pipe(dest('inst/', {overwrite: true}));
}
return log('Unable to find dash-table `inst` directory.');
}
Expand All@@ -84,7 +88,7 @@ function copyCoreManDirectory() {
return src([
'gulp-assets/dash-core-components/man/**/*',
'!gulp-assets/dash-core-components/man/*-package.Rd',
]).pipe(dest('man/'));
]).pipe(dest('man/', {overwrite: true}));
}
return log('Unable to find dash-core-components `man` directory.');
}
Expand All@@ -98,7 +102,7 @@ function copyHtmlManDirectory() {
return src([
'gulp-assets/dash-html-components/man/**/*',
'!gulp-assets/dash-html-components/man/*-package.Rd',
]).pipe(dest('man/'));
]).pipe(dest('man/', {overwrite: true}));
}
return log('Unable to find dash-html-components `man` directory.');
}
Expand All@@ -108,7 +112,7 @@ function copyTableManDirectory() {
return src([
'gulp-assets/dash-table/man/**/*',
'!gulp-assets/dash-table/man/*-package.Rd',
]).pipe(dest('man/'));
]).pipe(dest('man/', {overwrite: true}));
}
return log('Unable to find dash-table `man` directory.');
}
Expand All@@ -125,7 +129,7 @@ function copyCoreRDirectory() {
'!gulp-assets/dash-core-components/R/internal.R',
])
.pipe(print())
.pipe(dest('R/'));
.pipe(dest('R/', {overwrite: true}));
}
return log('Unable to find dash-core-components `R` directory.');
}
Expand All@@ -141,7 +145,7 @@ function copyHtmlRDirectory() {
'!gulp-assets/dash-html-components/R/internal.R',
])
.pipe(print())
.pipe(dest('R/'));
.pipe(dest('R/', {overwrite: true}));
}
return log('Unable to find dash-html-components `R` directory.');
}
Expand All@@ -153,7 +157,7 @@ function copyTableRDirectory() {
'!gulp-assets/dash-table/R/internal.R',
])
.pipe(print())
.pipe(dest('R/'));
.pipe(dest('R/', {overwrite: true}));
}
return log('Unable to find dash-core-components `R` directory.');
}
Expand Down
2 changes: 1 addition & 1 deletion inst/deps/async-datepicker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-datepicker.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-dropdown.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-graph.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-markdown.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-plotlyjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-slider.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-slider.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/async-upload.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/bundle.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion inst/deps/dash_core_components-shared.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_core_components.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_core_components.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_html_components.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_html_components.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/demo.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions inst/deps/table-async-highlight.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions inst/deps/table-async-highlight.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions man/dccClipboard.Rd
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,15 +10,17 @@ The Clipboard component copies text to the clipboard
}

\usage{
dccClipboard(id=NULL, className=NULL, loading_state=NULL, n_clicks=NULL,
style=NULL, target_id=NULL, text=NULL, title=NULL)
dccClipboard(id=NULL, className=NULL, content=NULL, loading_state=NULL,
n_clicks=NULL, style=NULL, target_id=NULL, title=NULL)
}

\arguments{
\item{id}{Character. The ID used to identify this component.}

\item{className}{Character. The class name of the icon element}

\item{content}{Character. The text to be copied to the clipboard if the `target_id` is None.}

\item{loading_state}{Lists containing elements 'is_loading', 'prop_name', 'component_name'.
those elements have the following types:
- is_loading (logical; optional): determines if the component is loading or not
Expand All@@ -33,8 +35,6 @@ those elements have the following types:
The inner text of the `children` prop will be copied to the clipboard. If none, then the text from the
`value` prop will be copied.}

\item{text}{Character. The text to be copied to the clipboard if the `target_id` is None.}

\item{title}{Character. The text shown as a tooltip when hovering over the copy icon.}
}

Expand Down
6 changes: 4 additions & 2 deletions man/htmlTable.Rd
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,8 +14,8 @@ htmlTable(children=NULL, id=NULL, accessKey=NULL, className=NULL,
contentEditable=NULL, contextMenu=NULL, dir=NULL,
draggable=NULL, hidden=NULL, key=NULL, lang=NULL,
loading_state=NULL, n_clicks=NULL, n_clicks_timestamp=NULL,
role=NULL, spellCheck=NULL, style=NULL, tabIndex=NULL,
title=NULL, ...)
role=NULL, spellCheck=NULL, style=NULL, summary=NULL,
tabIndex=NULL, title=NULL, ...)
}

\arguments{
Expand DownExpand Up@@ -64,6 +64,8 @@ which button was changed most recently.}

\item{style}{Named list. Defines CSS styles which will override styles previously set.}

\item{summary}{Character. }

\item{tabIndex}{Character. Overrides the browser's default tab order and follows the one specified instead.}

\item{title}{Character. Text to be displayed in a tooltip when hovering over the element.}
Expand Down