@markerjs/markerjs3 3.6.3 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/markerjs3.d.ts +159 -3
- package/markerjs3.js +1 -1
- package/markerjs3.js.map +1 -1
- package/package.json +1 -1
- package/umd/markerjs3.js +1 -1
- package/umd/markerjs3.js.map +1 -1
package/markerjs3.d.ts
CHANGED
|
@@ -1932,6 +1932,26 @@ declare class MarkerBaseEditor<TMarkerType extends MarkerBase = MarkerBase> {
|
|
|
1932
1932
|
* Does a check if the state has indeed changed before firing the handler.
|
|
1933
1933
|
*/
|
|
1934
1934
|
protected stateChanged(): void;
|
|
1935
|
+
/**
|
|
1936
|
+
* Hides all marker's visuals and editor controls.
|
|
1937
|
+
*
|
|
1938
|
+
* @remarks
|
|
1939
|
+
* This could be useful when you want to temporarily hide the marker so you can,
|
|
1940
|
+
* for example, create a new one in the same place. Reveal it later with {@link show}.
|
|
1941
|
+
*
|
|
1942
|
+
* @since 3.7.0
|
|
1943
|
+
*/
|
|
1944
|
+
hide(): void;
|
|
1945
|
+
/**
|
|
1946
|
+
* Shows all marker's visuals and editor controls.
|
|
1947
|
+
*
|
|
1948
|
+
* @remarks
|
|
1949
|
+
* This could be useful when you want to temporarily hide the marker (with {@link hide}) so you can,
|
|
1950
|
+
* for example, create a new one in the same place.
|
|
1951
|
+
*
|
|
1952
|
+
* @since 3.7.0
|
|
1953
|
+
*/
|
|
1954
|
+
show(): void;
|
|
1935
1955
|
/**
|
|
1936
1956
|
* Returns marker's state that can be restored in the future.
|
|
1937
1957
|
*
|
|
@@ -1948,58 +1968,139 @@ declare class MarkerBaseEditor<TMarkerType extends MarkerBase = MarkerBase> {
|
|
|
1948
1968
|
|
|
1949
1969
|
/**
|
|
1950
1970
|
* Marker area custom event types.
|
|
1971
|
+
*
|
|
1972
|
+
* @summary
|
|
1973
|
+
* Defines the custom events that can be dispatched by the {@link MarkerArea} component.
|
|
1974
|
+
*
|
|
1975
|
+
* @remarks
|
|
1976
|
+
* The `MarkerAreaEventMap` interface defines the events that can be dispatched by the {@link MarkerArea} component.
|
|
1977
|
+
*
|
|
1978
|
+
* You can listen to these events using the {@link MarkerArea.addEventListener | addEventListener} method on the {@link MarkerArea} instance.
|
|
1979
|
+
*
|
|
1980
|
+
* The events can be logically grouped into two categories:
|
|
1981
|
+
* 1. Marker area events (start with `area`)
|
|
1982
|
+
* 2. Marker editor events (start with `marker`).
|
|
1983
|
+
*
|
|
1984
|
+
* The marker area events are related to the overall state of the {@link MarkerArea} component,
|
|
1985
|
+
* while the marker editor events are related to the individual marker editors within the area.
|
|
1986
|
+
*
|
|
1987
|
+
* Marker area events receive {@link MarkerAreaEventData} as their `event.detail`,
|
|
1988
|
+
* while marker editor events receive {@link MarkerEditorEventData} as their `event.detail`.
|
|
1989
|
+
* Both event data types contain a reference to the {@link MarkerArea} instance
|
|
1990
|
+
* and, for marker editor events, a reference to the specific marker editor that triggered the event.
|
|
1951
1991
|
*/
|
|
1952
1992
|
interface MarkerAreaEventMap {
|
|
1953
1993
|
/**
|
|
1954
1994
|
* Marker area initialized.
|
|
1995
|
+
*
|
|
1996
|
+
* @remarks
|
|
1997
|
+
* This event is dispatched early in the lifecycle when the {@link MarkerArea} component is initialized
|
|
1998
|
+
* but none of its internal elements have been created yet.
|
|
1999
|
+
*
|
|
2000
|
+
* Use {@link areashow} to know when the component is fully initialized and ready to be used.
|
|
1955
2001
|
*/
|
|
1956
2002
|
areainit: CustomEvent<MarkerAreaEventData>;
|
|
1957
2003
|
/**
|
|
1958
2004
|
* Marker area shown.
|
|
2005
|
+
*
|
|
2006
|
+
* @remarks
|
|
2007
|
+
* This event is dispatched when the {@link MarkerArea} component is fully initialized and ready to be used.
|
|
1959
2008
|
*/
|
|
1960
2009
|
areashow: CustomEvent<MarkerAreaEventData>;
|
|
1961
2010
|
/**
|
|
1962
2011
|
* Marker area state restored.
|
|
2012
|
+
*
|
|
2013
|
+
* @remarks
|
|
2014
|
+
* This event is dispatched when the {@link MarkerArea} component restores its state from
|
|
2015
|
+
* a previously saved state.
|
|
1963
2016
|
*/
|
|
1964
2017
|
arearestorestate: CustomEvent<MarkerAreaEventData>;
|
|
1965
2018
|
/**
|
|
1966
2019
|
* Marker area focused.
|
|
2020
|
+
*
|
|
2021
|
+
* @remarks
|
|
2022
|
+
* This event is dispatched when the {@link MarkerArea} component receives focus.
|
|
1967
2023
|
*/
|
|
1968
2024
|
areafocus: CustomEvent<MarkerAreaEventData>;
|
|
1969
2025
|
/**
|
|
1970
2026
|
* Marker area lost focus.
|
|
2027
|
+
*
|
|
2028
|
+
* @remarks
|
|
2029
|
+
* This event is dispatched when the {@link MarkerArea} component loses focus.
|
|
1971
2030
|
*/
|
|
1972
2031
|
areablur: CustomEvent<MarkerAreaEventData>;
|
|
1973
2032
|
/**
|
|
1974
2033
|
* Marker area state changed.
|
|
2034
|
+
*
|
|
2035
|
+
* @remarks
|
|
2036
|
+
* This event is dispatched when the {@link MarkerArea} component's state changes.
|
|
2037
|
+
*
|
|
2038
|
+
* This is a good place to implement auto-saving or update the UI based on the current state.
|
|
1975
2039
|
*/
|
|
1976
2040
|
areastatechange: CustomEvent<MarkerAreaEventData>;
|
|
1977
2041
|
/**
|
|
1978
2042
|
* Marker selected.
|
|
2043
|
+
*
|
|
2044
|
+
* @remarks
|
|
2045
|
+
* This event is dispatched when a marker editor is selected.
|
|
2046
|
+
* You can use this event to update the UI or perform actions based on the selected marker editor.
|
|
1979
2047
|
*/
|
|
1980
2048
|
markerselect: CustomEvent<MarkerEditorEventData>;
|
|
1981
2049
|
/**
|
|
1982
2050
|
* Marker deselected.
|
|
2051
|
+
*
|
|
2052
|
+
* @remarks
|
|
2053
|
+
* This event is dispatched when a marker editor is deselected.
|
|
2054
|
+
* You can use this event to update the UI or perform actions based on the deselected marker editor.
|
|
1983
2055
|
*/
|
|
1984
2056
|
markerdeselect: CustomEvent<MarkerEditorEventData>;
|
|
1985
2057
|
/**
|
|
1986
2058
|
* Marker creating.
|
|
2059
|
+
*
|
|
2060
|
+
* @remarks
|
|
2061
|
+
* This event is dispatched when a marker creation has been initiated.
|
|
2062
|
+
* You can use this event to update the UI or perform actions based on the marker creation process.
|
|
1987
2063
|
*/
|
|
1988
2064
|
markercreating: CustomEvent<MarkerEditorEventData>;
|
|
1989
2065
|
/**
|
|
1990
2066
|
* Marker created.
|
|
2067
|
+
*
|
|
2068
|
+
* @remarks
|
|
2069
|
+
* This event is dispatched when a marker has been created.
|
|
2070
|
+
* You can use this event to update the UI or perform actions based on the created marker editor.
|
|
2071
|
+
*
|
|
2072
|
+
* One common use case is implementing continuous marker creation,
|
|
2073
|
+
* where you create a new marker editor immediately after the previous one has been created.
|
|
2074
|
+
*
|
|
2075
|
+
* @example
|
|
2076
|
+
* ```js
|
|
2077
|
+
* // create another marker of the same type
|
|
2078
|
+
* markerArea.addEventListener("markercreate", (ev) => {
|
|
2079
|
+
* markerArea.createMarker(ev.detail.markerEditor.marker.typeName);
|
|
2080
|
+
* });
|
|
2081
|
+
* ```
|
|
1991
2082
|
*/
|
|
1992
2083
|
markercreate: CustomEvent<MarkerEditorEventData>;
|
|
1993
2084
|
/**
|
|
1994
2085
|
* Marker about to be deleted.
|
|
2086
|
+
*
|
|
2087
|
+
* @remarks
|
|
2088
|
+
* This event is dispatched before a marker editor is deleted.
|
|
1995
2089
|
*/
|
|
1996
2090
|
markerbeforedelete: CustomEvent<MarkerEditorEventData>;
|
|
1997
2091
|
/**
|
|
1998
2092
|
* Marker deleted.
|
|
2093
|
+
*
|
|
2094
|
+
* @remarks
|
|
2095
|
+
* This event is dispatched after a marker editor is deleted.
|
|
2096
|
+
* You can use this event to update the UI or perform actions based on the deleted marker editor.
|
|
1999
2097
|
*/
|
|
2000
2098
|
markerdelete: CustomEvent<MarkerEditorEventData>;
|
|
2001
2099
|
/**
|
|
2002
2100
|
* Marker changed.
|
|
2101
|
+
*
|
|
2102
|
+
* @remarks
|
|
2103
|
+
* This event is dispatched when a marker editor's state has changed.
|
|
2003
2104
|
*/
|
|
2004
2105
|
markerchange: CustomEvent<MarkerEditorEventData>;
|
|
2005
2106
|
}
|
|
@@ -2198,7 +2299,7 @@ declare class MarkerArea extends HTMLElement {
|
|
|
2198
2299
|
* Deletes a marker represented by the specified editor.
|
|
2199
2300
|
* @param markerEditor
|
|
2200
2301
|
*/
|
|
2201
|
-
deleteMarker(markerEditor: MarkerBaseEditor): void;
|
|
2302
|
+
deleteMarker(markerEditor: MarkerBaseEditor, suppressUndo?: boolean): void;
|
|
2202
2303
|
/**
|
|
2203
2304
|
* Deselects all markers.
|
|
2204
2305
|
*/
|
|
@@ -2827,7 +2928,7 @@ declare class TextBlockEditor {
|
|
|
2827
2928
|
* Returns editor's UI,
|
|
2828
2929
|
* @returns UI in a div element.
|
|
2829
2930
|
*/
|
|
2830
|
-
getEditorUi():
|
|
2931
|
+
getEditorUi(): HTMLTextAreaElement;
|
|
2831
2932
|
/**
|
|
2832
2933
|
* Focuses text editing in the editor.
|
|
2833
2934
|
*/
|
|
@@ -2969,47 +3070,102 @@ declare class CurveMarkerEditor<TMarkerType extends CurveMarker = CurveMarker> e
|
|
|
2969
3070
|
}
|
|
2970
3071
|
|
|
2971
3072
|
/**
|
|
2972
|
-
*
|
|
3073
|
+
* Marker view custom event types.
|
|
3074
|
+
*
|
|
3075
|
+
* @summary
|
|
3076
|
+
* Defines the custom events that can be dispatched by the {@link MarkerView} component.
|
|
3077
|
+
*
|
|
3078
|
+
* @remarks
|
|
3079
|
+
* The `MarkerViewEventMap` interface defines the events that can be dispatched by the {@link MarkerView} component.
|
|
3080
|
+
*
|
|
3081
|
+
* You can listen to these events using the {@link MarkerView.addEventListener | addEventListener} method on the {@link MarkerView} instance.
|
|
3082
|
+
*
|
|
3083
|
+
* The events can be logically grouped into two categories:
|
|
3084
|
+
* 1. Marker view events (start with `view`)
|
|
3085
|
+
* 2. Marker events (start with `marker`).
|
|
3086
|
+
*
|
|
3087
|
+
* The marker view events are related to the overall state of the {@link MarkerView} component,
|
|
3088
|
+
* while the marker events are related to the individual markers within the view.
|
|
3089
|
+
*
|
|
3090
|
+
* Marker view events receive {@link MarkerViewEventData} as their `event.detail`,
|
|
3091
|
+
* while marker events receive {@link MarkerEventData} as their `event.detail`.
|
|
3092
|
+
* Both event data types contain a reference to the {@link MarkerView} instance
|
|
3093
|
+
* and, for marker events, a reference to the specific marker that triggered the event.
|
|
2973
3094
|
*/
|
|
2974
3095
|
interface MarkerViewEventMap {
|
|
2975
3096
|
/**
|
|
2976
3097
|
* Viewer initialized.
|
|
3098
|
+
*
|
|
3099
|
+
* @remarks
|
|
3100
|
+
* This event is dispatched when the {@link MarkerView} instance is created and initialized
|
|
3101
|
+
* but none of its internal elements have been created yet.
|
|
2977
3102
|
*/
|
|
2978
3103
|
viewinit: CustomEvent<MarkerViewEventData>;
|
|
2979
3104
|
/**
|
|
2980
3105
|
* Viewer shown.
|
|
3106
|
+
*
|
|
3107
|
+
* @remarks
|
|
3108
|
+
* This event is dispatched when the {@link MarkerView} instance is fully initialized,
|
|
3109
|
+
* its internal elements are created, and the target image is loaded.
|
|
3110
|
+
* It indicates that the viewer is ready to display markers and annotations.
|
|
2981
3111
|
*/
|
|
2982
3112
|
viewshow: CustomEvent<MarkerViewEventData>;
|
|
2983
3113
|
/**
|
|
2984
3114
|
* Viewer state restored.
|
|
3115
|
+
*
|
|
3116
|
+
* @remarks
|
|
3117
|
+
* This event is dispatched when the {@link MarkerView} instance has restored a previously saved state.
|
|
3118
|
+
* It indicates that the viewer has loaded markers and annotations from a saved state.
|
|
2985
3119
|
*/
|
|
2986
3120
|
viewrestorestate: CustomEvent<MarkerViewEventData>;
|
|
2987
3121
|
/**
|
|
2988
3122
|
* Marker clicked.
|
|
3123
|
+
*
|
|
3124
|
+
* @remarks
|
|
3125
|
+
* This event is dispatched when a marker within the {@link MarkerView} is clicked.
|
|
3126
|
+
* It provides access to the clicked marker and the {@link MarkerView} instance.
|
|
2989
3127
|
*/
|
|
2990
3128
|
markerclick: CustomEvent<MarkerEventData>;
|
|
2991
3129
|
/**
|
|
2992
3130
|
* Marker mouse over.
|
|
3131
|
+
*
|
|
3132
|
+
* @remarks
|
|
3133
|
+
* This event is dispatched when the mouse pointer hovers over a marker within the {@link MarkerView}.
|
|
2993
3134
|
*/
|
|
2994
3135
|
markerover: CustomEvent<MarkerEventData>;
|
|
2995
3136
|
/**
|
|
2996
3137
|
* Marker pointer down.
|
|
3138
|
+
*
|
|
3139
|
+
* @remarks
|
|
3140
|
+
* This event is dispatched when a pointer (mouse, touch, etc.) is pressed down on a marker within the {@link MarkerView}.
|
|
2997
3141
|
*/
|
|
2998
3142
|
markerpointerdown: CustomEvent<MarkerEventData>;
|
|
2999
3143
|
/**
|
|
3000
3144
|
* Marker pointer move.
|
|
3145
|
+
*
|
|
3146
|
+
* @remarks
|
|
3147
|
+
* This event is dispatched when a pointer (mouse, touch, etc.) moves while over a marker within the {@link MarkerView}.
|
|
3001
3148
|
*/
|
|
3002
3149
|
markerpointermove: CustomEvent<MarkerEventData>;
|
|
3003
3150
|
/**
|
|
3004
3151
|
* Marker pointer up.
|
|
3152
|
+
*
|
|
3153
|
+
* @remarks
|
|
3154
|
+
* This event is dispatched when a pointer (mouse, touch, etc.) is released after being pressed down on a marker within the {@link MarkerView}.
|
|
3005
3155
|
*/
|
|
3006
3156
|
markerpointerup: CustomEvent<MarkerEventData>;
|
|
3007
3157
|
/**
|
|
3008
3158
|
* Marker pointer enter.
|
|
3159
|
+
*
|
|
3160
|
+
* @remarks
|
|
3161
|
+
* This event is dispatched when a pointer (mouse, touch, etc.) enters the area of a marker within the {@link MarkerView}.
|
|
3009
3162
|
*/
|
|
3010
3163
|
markerpointerenter: CustomEvent<MarkerEventData>;
|
|
3011
3164
|
/**
|
|
3012
3165
|
* Marker pointer leave.
|
|
3166
|
+
*
|
|
3167
|
+
* @remarks
|
|
3168
|
+
* This event is dispatched when a pointer (mouse, touch, etc.) leaves the area of a marker within the {@link MarkerView}.
|
|
3013
3169
|
*/
|
|
3014
3170
|
markerpointerleave: CustomEvent<MarkerEventData>;
|
|
3015
3171
|
}
|