Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update package with upstream #2

Merged
merged 1 commit into from
Feb 8, 2024
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
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [emilhe] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
46 changes: 41 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,41 @@

All notable changes to this project will be documented in this file.

## [1.0.4+deps] - 26-10-23
## [1.0.12] - 04-02-23

### Changed

- Relax `more-itertools` constraint _down_ to `>=8.0.0`
- Relax other package constraints
- Upgrade `dev` dependencies (`js` & `py`)
- Upgrade `dash-extensions` dependencies
- Set `allow_duplicate=True` for the default logging configurations for the `LogTransform`, thereby fixing [#280](https://github.com/emilhe/dash-extensions/issues/280).

## [1.0.11] - 03-02-23

### Changed

- Add `useCapture` property to `EventListener` and `Keyboard` components, thereby fixing [#255](https://github.com/emilhe/dash-extensions/issues/255).

## [1.0.10] - 03-02-23

### Changed

- Update dependencies, including `Flask-caching`, thereby fixing [#296](https://github.com/emilhe/dash-extensions/issues/296).

## [1.0.9] - 03-02-23

### Changed

- Fixed bug in `Keyboard` component where the keydown event would fire twice.

## [1.0.8] - 25-01-23

### Changed

- Fixed bug in `BlockingCallbackTransform` component where the callback would never get invoked again, if an (uncaught) exception was raised during execution. Contributed by [lcornelatti](https://github.com/lcornelatti).

## [1.0.7] - 27-12-23

### Added

- Re-introduce `Keyboard` component (due to many user requests)

## [1.0.4] - 07-10-23

Expand All @@ -23,6 +50,15 @@ All notable changes to this project will be documented in this file.
- Dynamic prefixing is now applied recursively
- Inline JS functions created using `assign` are now re-used if the code is identical

## [1.0.4+deps] - 26-10-23

### Changed

- Relax `more-itertools` constraint _down_ to `>=8.0.0`
- Relax other package constraints
- Upgrade `dev` dependencies (`js` & `py`)
- Upgrade `dash-extensions` dependencies

## [1.0.3] - 31-07-23

### Added
Expand Down
2 changes: 2 additions & 0 deletions dash_extensions/_imports_.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .DeferScript import DeferScript
from .EventListener import EventListener
from .EventSource import EventSource
from .Keyboard import Keyboard
from .Lottie import Lottie
from .Mermaid import Mermaid
from .Purify import Purify
Expand All @@ -14,6 +15,7 @@
"DeferScript",
"EventListener",
"EventSource",
"Keyboard",
"Lottie",
"Mermaid",
"Purify",
Expand Down
18 changes: 12 additions & 6 deletions dash_extensions/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def apply_serverside(self, callbacks):
State(start_blocked_id, "data")
)
# Modify the original callback to send finished signal.
single_output = len(callback.outputs) <= 1
num_outputs = len(callback.outputs)
out_flex_key = callback.outputs.append(Output(end_server_id, "data"))
# Change original inputs to state.
for i, item in enumerate(callback.inputs):
Expand All @@ -612,22 +612,28 @@ def apply_serverside(self, callbacks):
st_flex_key = callback.inputs.append(State(start_client_ctx, "data"))
# Modify the callback function accordingly.
f = callback.f
callback.f = skip_input_signal_add_output_signal(single_output, out_flex_key, in_flex_key, st_flex_key)(f)
callback.f = skip_input_signal_add_output_signal(num_outputs, out_flex_key, in_flex_key, st_flex_key)(f)

return callbacks


def skip_input_signal_add_output_signal(single_output, out_flex_key, in_flex_key, st_flex_key):
def skip_input_signal_add_output_signal(num_outputs, out_flex_key, in_flex_key, st_flex_key):
def wrapper(f):
@functools.wraps(f)
def decorated_function(*args, **kwargs):
args, kwargs, fltr = _skip_inputs(args, kwargs, [in_flex_key, st_flex_key])
cached_ctx = fltr[1]
single_output = num_outputs <= 1
if cached_ctx is not None and "triggered" in cached_ctx:
ctx = context_value.get()
ctx["triggered_inputs"] = cached_ctx["triggered"]
context_value.set(ctx)
outputs = f(*args, **kwargs)
try:
outputs = f(*args, **kwargs)
except Exception:
logging.exception(f"Exception raised in blocking callback [{f.__name__}]")
outputs = no_update if single_output else [no_update] * num_outputs

return _append_output(outputs, datetime.utcnow().timestamp(), single_output, out_flex_key)

return decorated_function
Expand All @@ -650,7 +656,7 @@ def __init__(self, log_output, log_writer_map: Dict[int, Callable],

def setup_notifications_log_config():
log_id = "notifications_provider"
log_output = Output(log_id, "children")
log_output = Output(log_id, "children", allow_duplicate=True)

def notification_layout_transform(layout: List[Component]):
import dash_mantine_components as dmc
Expand All @@ -668,7 +674,7 @@ def div_layout_transform(layout: List[Component]):
layout.append(html.Div(id=log_id))
return layout

log_output = Output(log_id, "children")
log_output = Output(log_id, "children", allow_duplicate=True)
return LogConfig(log_output, get_default_log_writers(), div_layout_transform)


Expand Down
Loading
Loading