draw-libre 0.4.0 → 0.5.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/README.md CHANGED
@@ -137,6 +137,8 @@ Available events:
137
137
  - `mdl:removeall` (RemoveAllEvent) -- Fired when all points are removed by clicking the delete button
138
138
  - `mdl:save` (SaveEvent) -- Fired when the save button is clicked
139
139
  - `mdl:modechanged` (ModeChangeEvent) -- Fired when the drawing mode is changed
140
+ - `mdl:undostackchanged` (UndoStackChangeEvent) -- Fired when the undo stack is changed
141
+ - `mdl:redostackchanged` (RedoStackChangeEvent) -- Fired when the redo stack is changed
140
142
 
141
143
  ### Methods
142
144
 
@@ -158,6 +160,16 @@ draw.setSteps(steps: {lat: number; lng: number; id?: string}[])
158
160
  // Remove all steps
159
161
  draw.removeAllSteps()
160
162
 
163
+ // If you don't like the panel, you can hide it in options and use these handlers to create your own panel
164
+ // Clear all steps from the drawing
165
+ draw.clear()
166
+ // Save the current drawing state
167
+ draw.save()
168
+ // Undo the last action. Pass the original(!) DOM event when the dynamic line is enabled. Check the mdl:undostackchanged to disable/enable the button
169
+ draw.undo(e)
170
+ // Redo the last undone action. Pass the original(!) DOM event when the dynamic line is enabled. Check the mdl:redostackchanged to disable/enable the button
171
+ draw.redo(e)
172
+
161
173
  // Update options. Note that options are immutable, so return a new object with spread values.
162
174
  draw.setOptions((options: RequiredDrawOptions) => {
163
175
  return {
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .undo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E")}.redo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E")}.delete{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E")}.save{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E")}.dashboard{display:flex;align-items:center;background-color:#fff;border-radius:4px}.dashboard-container{position:absolute;z-index:1000000;pointer-events:auto}.dashboard-container.hidden{opacity:0;pointer-events:none}.panel-button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:28px;outline:none;padding:0;width:28px}.panel-button:disabled{opacity:.25;cursor:not-allowed}.panel-button:hover{background-color:#0000000d}.icon{background-position:50%;background-repeat:no-repeat;display:block;height:18px}.panel-button:not(:last-child) .icon{border-right:1px solid #ddd}.panel-button-small{width:20px;height:20px}.panel-button-medium{width:24px;height:24px}.panel-button-large{width:28px;height:28px}.icon-small{height:14px}.icon-medium{height:16px}.icon-large{height:18px}.hide-panel{visibility:hidden}.popup-container{display:block;position:absolute;z-index:1000;pointer-events:none;top:0;left:0}.popup-text{display:inline-block;padding:4px 16px;background-color:#4d4d4d;border-radius:18px;color:#fff;font-size:14px}.popup-text-bottom{opacity:0;transform:translateY(16px);transition:all .2s ease-out;transition-delay:.25s}.popup-text-left{opacity:0;transform:translate(16px);transition:all .3s ease-out}.popup-text-active{transform:translate(0);opacity:1}.line{transform:rotate(44deg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E")}.polygon{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.break{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.control-button:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.maplibregl-ctrl-group button.control-button-active{background-color:#edeaea}.control-button:disabled{opacity:.25}.maplibregl-popup-tip,.mapboxgl-popup-tip{display:none!important}.maplibregl-popup-content,.mapboxgl-popup-content{padding:0!important}
1
+ .popup-container{display:block;position:absolute;z-index:1000;pointer-events:none;top:0;left:0}.popup-text{display:inline-block;padding:4px 16px;background-color:#4d4d4d;border-radius:18px;color:#fff;font-size:14px}.popup-text-bottom{opacity:0;transform:translateY(16px);transition:all .2s ease-out;transition-delay:.25s}.popup-text-left{opacity:0;transform:translate(16px);transition:all .3s ease-out}.popup-text-active{transform:translate(0);opacity:1}.undo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E")}.redo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E")}.delete{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E")}.save{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E")}.mdl-dashboard{display:flex;align-items:center;background-color:#fff;border-radius:4px}.mdl-dashboard-container{position:absolute;z-index:1000000;pointer-events:auto}.mdl-dashboard-container.hidden{opacity:0;pointer-events:none}.mdl-panel-button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:28px;outline:none;padding:0;width:28px}.mdl-panel-button:disabled{opacity:.25;cursor:not-allowed}.mdl-panel-button:hover{background-color:#0000000d}.icon{background-position:50%;background-repeat:no-repeat;display:block;height:18px}.mdl-panel-button:not(:last-child) .icon{border-right:1px solid #ddd}.mdl-panel-button-small{width:20px;height:20px}.mdl-panel-button-medium{width:24px;height:24px}.mdl-panel-button-large{width:28px;height:28px}.icon-small{height:14px}.icon-medium{height:16px}.icon-large{height:18px}.hide-panel{visibility:hidden}.line{transform:rotate(44deg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E")}.polygon{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.break{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.control-button:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.maplibregl-ctrl-group button.control-button-active{background-color:#edeaea}.control-button:disabled{opacity:.25}.maplibregl-popup-tip,.mapboxgl-popup-tip{display:none!important}.maplibregl-popup-content,.mapboxgl-popup-content{padding:0!important}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/panel/panel.css","../src/components/tooltip/tooltip.css","../src/components/side-control/control.css","../src/draw.css"],"sourcesContent":[".undo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E\");\n}\n\n.redo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E\");\n}\n\n.delete {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.save {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.dashboard {\n display: flex;\n align-items: center;\n background-color: white;\n border-radius: 4px;\n}\n\n.dashboard-container {\n position: absolute;\n z-index: 1000000;\n pointer-events: auto;\n}\n\n.dashboard-container.hidden {\n opacity: 0;\n pointer-events: none;\n}\n\n.panel-button {\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n cursor: pointer;\n display: block;\n height: 28px;\n outline: none;\n padding: 0;\n width: 28px;\n}\n\n.panel-button:disabled {\n opacity: 0.25;\n cursor: not-allowed;\n}\n\n.panel-button:hover {\n background-color: #0000000d;\n}\n\n.icon {\n background-position: 50%;\n background-repeat: no-repeat;\n display: block;\n height: 18px;\n}\n\n.panel-button:not(:last-child) .icon {\n border-right: 1px solid #ddd;\n}\n\n.panel-button-small {\n width: 20px;\n height: 20px;\n}\n\n.panel-button-medium {\n width: 24px;\n height: 24px;\n}\n.panel-button-large {\n width: 28px;\n height: 28px;\n}\n\n.icon-small {\n height: 14px;\n}\n\n.icon-medium {\n height: 16px;\n}\n\n.icon-large {\n height: 18px;\n}\n\n.hide-panel {\n visibility: hidden;\n}\n",".popup-container {\n display: block;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n top: 0;\n left: 0;\n}\n\n.popup-text {\n display: inline-block;\n padding: 4px 16px;\n background-color: #4d4d4d;\n border-radius: 18px;\n color: #fff;\n font-size: 14px;\n}\n\n.popup-text-bottom {\n opacity: 0;\n transform: translateY(16px);\n transition: all 0.2s ease-out;\n transition-delay: 0.25s;\n}\n\n.popup-text-left {\n opacity: 0;\n transform: translateX(16px);\n transition: all 0.3s ease-out;\n}\n\n.popup-text-active {\n transform: translate(0px);\n opacity: 1;\n}\n",".line {\n transform: rotate(44deg);\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E\");\n}\n\n.polygon {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.break {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.control-button:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n\n/* otherwise if we just .control-button-active, then maplibre will have higher importance */\n.maplibregl-ctrl-group button.control-button-active {\n background-color: #edeaea;\n}\n\n.control-button:disabled {\n opacity: 0.25;\n}\n",".maplibregl-popup-tip,\n.mapboxgl-popup-tip {\n display: none !important;\n}\n\n.maplibregl-popup-content,\n.mapboxgl-popup-content {\n padding: 0 !important;\n}\n"],"mappings":"AAAA,CAAC,KACC,iBAAkB,mUACpB,CAEA,CAAC,KACC,iBAAkB,qUACpB,CAEA,CAAC,OACC,iBAAkB,iiBACpB,CAEA,CAAC,KACC,iBAAkB,qYACpB,CAEA,CAAC,UACC,QAAS,KACT,YAAa,OACb,iBAAkB,KAnBpB,cAoBiB,GACjB,CAEA,CAAC,oBACC,SAAU,SACV,QAAS,QACT,eAAgB,IAClB,CAEA,CANC,mBAMmB,CAAC,OACnB,QAAS,EACT,eAAgB,IAClB,CAEA,CAAC,aACC,iBAAkB,YAClB,OAAQ,EACR,WAAY,WACZ,OAAQ,QACR,QAAS,MACT,OAAQ,KACR,QAAS,KAzCX,QA0CW,EACT,MAAO,IACT,CAEA,CAZC,YAYY,UACX,QAAS,IACT,OAAQ,WACV,CAEA,CAjBC,YAiBY,OACX,iBAAkB,SACpB,CAEA,CAAC,KACC,oBAAqB,IACrB,kBAAmB,UACnB,QAAS,MACT,OAAQ,IACV,CAEA,CA5BC,YA4BY,KAAK,aAAa,CAP9B,KAQC,aAAc,IAAI,MAAM,IAC1B,CAEA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,oBACC,MAAO,KACP,OAAQ,IACV,CACA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,YACC,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,WACC,WAAY,MACd,CC9FA,CAAC,gBACC,QAAS,MACT,SAAU,SACV,QAAS,KACT,eAAgB,KAChB,IAAK,EACL,KAAM,CACR,CAEA,CAAC,WACC,QAAS,aAVX,QAWW,IAAI,KACb,iBAAkB,QAZpB,cAaiB,KACf,MAAO,KACP,UAAW,IACb,CAEA,CAAC,kBACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,IAAI,IAAK,SACrB,iBAAkB,IACpB,CAEA,CAAC,gBACC,QAAS,EACT,UAAW,UAAW,MACtB,WAAY,IAAI,IAAK,QACvB,CAEA,CAAC,kBACC,UAAW,UAAU,GACrB,QAAS,CACX,CClCA,CAAC,KACC,UAAW,OAAO,OAClB,iBAAkB,m9CACpB,CAEA,CAAC,QACC,iBAAkB,u5DACpB,CAEA,CAAC,MACC,iBAAkB,syDACpB,CAEA,CAAC,cAAc,aACb,uBAAwB,IACxB,wBAAyB,GAC3B,CAGA,CAAC,sBAAsB,MAAM,CAAC,sBAC5B,iBAAkB,OACpB,CAEA,CAVC,cAUc,UACb,QAAS,GACX,CCzBA,CAAC,qBACD,CAAC,mBACC,QAAS,cACX,CAEA,CAAC,yBACD,CAAC,uBAND,QAOW,WACX","names":[]}
1
+ {"version":3,"sources":["../src/components/tooltip/tooltip.css","../src/components/panel/panel.css","../src/components/side-control/control.css","../src/draw.css"],"sourcesContent":[".popup-container {\n display: block;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n top: 0;\n left: 0;\n}\n\n.popup-text {\n display: inline-block;\n padding: 4px 16px;\n background-color: #4d4d4d;\n border-radius: 18px;\n color: #fff;\n font-size: 14px;\n}\n\n.popup-text-bottom {\n opacity: 0;\n transform: translateY(16px);\n transition: all 0.2s ease-out;\n transition-delay: 0.25s;\n}\n\n.popup-text-left {\n opacity: 0;\n transform: translateX(16px);\n transition: all 0.3s ease-out;\n}\n\n.popup-text-active {\n transform: translate(0px);\n opacity: 1;\n}\n",".undo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E\");\n}\n\n.redo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E\");\n}\n\n.delete {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.save {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.mdl-dashboard {\n display: flex;\n align-items: center;\n background-color: white;\n border-radius: 4px;\n}\n\n.mdl-dashboard-container {\n position: absolute;\n z-index: 1000000;\n pointer-events: auto;\n}\n\n.mdl-dashboard-container.hidden {\n opacity: 0;\n pointer-events: none;\n}\n\n.mdl-panel-button {\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n cursor: pointer;\n display: block;\n height: 28px;\n outline: none;\n padding: 0;\n width: 28px;\n}\n\n.mdl-panel-button:disabled {\n opacity: 0.25;\n cursor: not-allowed;\n}\n\n.mdl-panel-button:hover {\n background-color: #0000000d;\n}\n\n.icon {\n background-position: 50%;\n background-repeat: no-repeat;\n display: block;\n height: 18px;\n}\n\n.mdl-panel-button:not(:last-child) .icon {\n border-right: 1px solid #ddd;\n}\n\n.mdl-panel-button-small {\n width: 20px;\n height: 20px;\n}\n\n.mdl-panel-button-medium {\n width: 24px;\n height: 24px;\n}\n.mdl-panel-button-large {\n width: 28px;\n height: 28px;\n}\n\n.icon-small {\n height: 14px;\n}\n\n.icon-medium {\n height: 16px;\n}\n\n.icon-large {\n height: 18px;\n}\n\n.hide-panel {\n visibility: hidden;\n}\n",".line {\n transform: rotate(44deg);\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E\");\n}\n\n.polygon {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.break {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.control-button:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n\n/* otherwise if we just .control-button-active, then maplibre will have higher importance */\n.maplibregl-ctrl-group button.control-button-active {\n background-color: #edeaea;\n}\n\n.control-button:disabled {\n opacity: 0.25;\n}\n",".maplibregl-popup-tip,\n.mapboxgl-popup-tip {\n display: none !important;\n}\n\n.maplibregl-popup-content,\n.mapboxgl-popup-content {\n padding: 0 !important;\n}\n"],"mappings":"AAAA,CAAC,gBACC,QAAS,MACT,SAAU,SACV,QAAS,KACT,eAAgB,KAChB,IAAK,EACL,KAAM,CACR,CAEA,CAAC,WACC,QAAS,aAVX,QAWW,IAAI,KACb,iBAAkB,QAZpB,cAaiB,KACf,MAAO,KACP,UAAW,IACb,CAEA,CAAC,kBACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,IAAI,IAAK,SACrB,iBAAkB,IACpB,CAEA,CAAC,gBACC,QAAS,EACT,UAAW,UAAW,MACtB,WAAY,IAAI,IAAK,QACvB,CAEA,CAAC,kBACC,UAAW,UAAU,GACrB,QAAS,CACX,CClCA,CAAC,KACC,iBAAkB,mUACpB,CAEA,CAAC,KACC,iBAAkB,qUACpB,CAEA,CAAC,OACC,iBAAkB,iiBACpB,CAEA,CAAC,KACC,iBAAkB,qYACpB,CAEA,CAAC,cACC,QAAS,KACT,YAAa,OACb,iBAAkB,KAnBpB,cAoBiB,GACjB,CAEA,CAAC,wBACC,SAAU,SACV,QAAS,QACT,eAAgB,IAClB,CAEA,CANC,uBAMuB,CAAC,OACvB,QAAS,EACT,eAAgB,IAClB,CAEA,CAAC,iBACC,iBAAkB,YAClB,OAAQ,EACR,WAAY,WACZ,OAAQ,QACR,QAAS,MACT,OAAQ,KACR,QAAS,KAzCX,QA0CW,EACT,MAAO,IACT,CAEA,CAZC,gBAYgB,UACf,QAAS,IACT,OAAQ,WACV,CAEA,CAjBC,gBAiBgB,OACf,iBAAkB,SACpB,CAEA,CAAC,KACC,oBAAqB,IACrB,kBAAmB,UACnB,QAAS,MACT,OAAQ,IACV,CAEA,CA5BC,gBA4BgB,KAAK,aAAa,CAPlC,KAQC,aAAc,IAAI,MAAM,IAC1B,CAEA,CAAC,uBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,wBACC,MAAO,KACP,OAAQ,IACV,CACA,CAAC,uBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,YACC,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,WACC,WAAY,MACd,CC9FA,CAAC,KACC,UAAW,OAAO,OAClB,iBAAkB,m9CACpB,CAEA,CAAC,QACC,iBAAkB,u5DACpB,CAEA,CAAC,MACC,iBAAkB,syDACpB,CAEA,CAAC,cAAc,aACb,uBAAwB,IACxB,wBAAyB,GAC3B,CAGA,CAAC,sBAAsB,MAAM,CAAC,sBAC5B,iBAAkB,OACpB,CAEA,CAVC,cAUc,UACb,QAAS,GACX,CCzBA,CAAC,qBACD,CAAC,mBACC,QAAS,cACX,CAEA,CAAC,yBACD,CAAC,uBAND,QAOW,WACX","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  import { CircleLayerSpecification, LineLayerSpecification, FillLayerSpecification } from 'maplibre-gl';
2
2
  import mapboxgl from 'mapbox-gl';
3
3
 
4
- type UnifiedMap = maplibregl.Map & mapboxgl.Map;
5
- type IControl = maplibregl.IControl & mapboxgl.IControl;
6
-
7
- type Mode = "line" | "polygon" | null;
8
-
9
- type AnyFunction = (...args: any[]) => any;
4
+ type AnyFunction = (...args: any) => any;
10
5
  type DeepRequired<T> = T extends AnyFunction ? T : {
11
6
  [K in keyof T]-?: DeepRequired<T[K]>;
12
7
  };
13
8
 
9
+ type Mode = "line" | "polygon" | null;
10
+
14
11
  type LatLng = {
15
12
  lat: number;
16
13
  lng: number;
@@ -102,6 +99,9 @@ declare class ListNode {
102
99
  constructor(val?: Step | null, next?: ListNode | null, prev?: ListNode | null);
103
100
  }
104
101
 
102
+ type UnifiedMap = maplibregl.Map & mapboxgl.Map;
103
+ type IControl = maplibregl.IControl & mapboxgl.IControl;
104
+
105
105
  interface ModeEvent {
106
106
  geometry: Mode;
107
107
  closedGeometry: boolean;
@@ -175,9 +175,30 @@ interface ModeChangeEvent {
175
175
  target: UnifiedMap;
176
176
  type: "mdl:modechanged";
177
177
  }
178
+ interface UndoStackChangeEvent {
179
+ mode: Mode | "break";
180
+ target: UnifiedMap;
181
+ type: "mdl:undostackchanged";
182
+ }
183
+ interface RedoStackChangeEvent {
184
+ mode: Mode | "break";
185
+ target: UnifiedMap;
186
+ type: "mdl:redostackchanged";
187
+ }
178
188
 
179
189
  declare class DrawLibre implements IControl {
180
- #private;
190
+ private container;
191
+ private store;
192
+ private mode;
193
+ private defaultOptions;
194
+ private tiles;
195
+ private panel;
196
+ private control;
197
+ private cursor;
198
+ private mouseEvents;
199
+ private timelineAdapter;
200
+ private renderer;
201
+ static instance: DrawLibre | null;
181
202
  private constructor();
182
203
  static getInstance(options?: DrawOptions): DrawLibre;
183
204
  /**
@@ -185,7 +206,7 @@ declare class DrawLibre implements IControl {
185
206
  *
186
207
  * @example ```ts
187
208
  * const map = new Map();
188
- * const draw = new DrawLibre();
209
+ * const draw = DrawLibre.getInstance();
189
210
  * map.addControl(draw)
190
211
  * ```
191
212
  *
@@ -203,7 +224,7 @@ declare class DrawLibre implements IControl {
203
224
  *
204
225
  * @example ```ts
205
226
  * const map = new Map();
206
- * const draw = new DrawLibre();
227
+ * const draw = DrawLibre.getInstance();
207
228
  * map.removeControl(draw)
208
229
  * ```
209
230
  *
@@ -244,10 +265,11 @@ declare class DrawLibre implements IControl {
244
265
  size: number | undefined;
245
266
  };
246
267
  setOptions: (fn: (options: RequiredDrawOptions) => RequiredDrawOptions) => void;
247
- /**
248
- * Removes all steps.
249
- */
268
+ undo: (e: Event) => void;
269
+ redo: (e: Event) => void;
270
+ clear: () => void;
271
+ save: () => void;
250
272
  removeAllSteps: () => void;
251
273
  }
252
274
 
253
- export { type DrawOptions, type ModeChangeEvent, type PointAddEvent, type PointEnterEvent, type PointLeaveEvent, type PointMoveEvent, type PointRightClickRemoveEvent, type RemoveAllEvent, type RequiredDrawOptions, type SaveEvent, type UndoEvent, type UnifiedMap, DrawLibre as default };
275
+ export { type DrawOptions, type ModeChangeEvent, type PointAddEvent, type PointEnterEvent, type PointLeaveEvent, type PointMoveEvent, type PointRightClickRemoveEvent, type RedoStackChangeEvent, type RemoveAllEvent, type RequiredDrawOptions, type SaveEvent, type UndoEvent, type UndoStackChangeEvent, type UnifiedMap, DrawLibre as default };