@latitude-data/embedding
Advanced tools
Comparing version 0.1.0 to 0.1.1
# @latitude-data/embedding | ||
## 0.1.1 | ||
### Patch Changes | ||
- 663b413: Fix infinite loop when changing an input field. Use different event in embedding when url param is changed from inside view | ||
## 0.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -10,3 +10,3 @@ import { EmbeddingEvent, EmbeddingEventData, ParamsChangedEventData } from './types'; | ||
set onRun(handler: MessageHandlerFn<EmbeddingEvent.Run>); | ||
set onParamsChanged(handler: MessageHandlerFn<EmbeddingEvent.ParamsChanged>); | ||
set onParamsRequestChange(handler: MessageHandlerFn<EmbeddingEvent.ChangeParamRequest>); | ||
set onCustomEvent(handler: MessageHandlerFn<EmbeddingEvent.Custom>); | ||
@@ -13,0 +13,0 @@ listen(): void; |
var EmbeddingEvent; | ||
(function (EmbeddingEvent) { | ||
EmbeddingEvent["Run"] = "latitude-run"; | ||
EmbeddingEvent["ChangeParamRequest"] = "latitude-change-param-request"; | ||
EmbeddingEvent["ParamsChanged"] = "latitude-params-changed"; | ||
@@ -24,3 +25,3 @@ EmbeddingEvent["Custom"] = "latitude-custom"; | ||
} | ||
set onParamsChanged(handler) { | ||
set onParamsRequestChange(handler) { | ||
if (this._onParamsChanged) | ||
@@ -46,3 +47,3 @@ return; | ||
break; | ||
case EmbeddingEvent.ParamsChanged: | ||
case EmbeddingEvent.ChangeParamRequest: | ||
this._onParamsChanged?.(event.data); | ||
@@ -82,3 +83,3 @@ break; | ||
function changeEmbedParams(params) { | ||
triggerEvent(EmbeddingEvent.ParamsChanged, { params }); | ||
triggerEvent(EmbeddingEvent.ChangeParamRequest, { params }); | ||
} | ||
@@ -85,0 +86,0 @@ const iframe = new IframeMessages(); |
export declare enum EmbeddingEvent { | ||
Run = "latitude-run", | ||
ChangeParamRequest = "latitude-change-param-request", | ||
ParamsChanged = "latitude-params-changed", | ||
@@ -20,2 +21,5 @@ Custom = "latitude-custom" | ||
params: ParamsChangedEventData; | ||
} : T extends EmbeddingEvent.ChangeParamRequest ? { | ||
type: T; | ||
params: ParamsChangedEventData; | ||
} : T extends EmbeddingEvent.Custom ? { | ||
@@ -22,0 +26,0 @@ type: T; |
{ | ||
"name": "@latitude-data/embedding", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "LGPL", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -15,3 +15,3 @@ import { | ||
private _onParamsChanged: | ||
| MessageHandlerFn<EmbeddingEvent.ParamsChanged> | ||
| MessageHandlerFn<EmbeddingEvent.ChangeParamRequest> | ||
| undefined | ||
@@ -33,3 +33,5 @@ private _onCustomEvent: MessageHandlerFn<EmbeddingEvent.Custom> | undefined | ||
set onParamsChanged(handler: MessageHandlerFn<EmbeddingEvent.ParamsChanged>) { | ||
set onParamsRequestChange( | ||
handler: MessageHandlerFn<EmbeddingEvent.ChangeParamRequest>, | ||
) { | ||
if (this._onParamsChanged) return | ||
@@ -57,3 +59,3 @@ | ||
break | ||
case EmbeddingEvent.ParamsChanged: | ||
case EmbeddingEvent.ChangeParamRequest: | ||
this._onParamsChanged?.(event.data) | ||
@@ -60,0 +62,0 @@ break |
@@ -23,3 +23,3 @@ import { | ||
export function changeEmbedParams(params: ParamsChangedEventData) { | ||
triggerEvent(EmbeddingEvent.ParamsChanged, { params }) | ||
triggerEvent(EmbeddingEvent.ChangeParamRequest, { params }) | ||
} | ||
@@ -26,0 +26,0 @@ |
export enum EmbeddingEvent { | ||
Run = 'latitude-run', | ||
ChangeParamRequest = 'latitude-change-param-request', | ||
ParamsChanged = 'latitude-params-changed', | ||
@@ -24,4 +25,6 @@ Custom = 'latitude-custom', | ||
? { type: T; params: ParamsChangedEventData } | ||
: T extends EmbeddingEvent.Custom | ||
? { type: T; data: unknown } | ||
: never | ||
: T extends EmbeddingEvent.ChangeParamRequest | ||
? { type: T; params: ParamsChangedEventData } | ||
: T extends EmbeddingEvent.Custom | ||
? { type: T; data: unknown } | ||
: never |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20598
277