Map and clean deprecated functions (#175)

* add image and deprecated arrow functions

* update locales

* map basic.showArrow

* map arrow blocks

* map & remove arrow images

* remove arrow blocks

* update locales

* remove & patch:
rgbw -> rgb
button/pin pressed -> button/pin event
loudness -> soundLevel

* update ts mappings for arrows

* add wip ts patch rules

* update .blocks files

* use Click instead of Down as default in Documentation and tests

* patch test.blocks

* fix lowercase name tag

* update test.blocks

* update blocks test files

* update blocks test files

* format block files

* pass blocks file tests

* fix ts mapping

* fix color.defl value

closes https://github.com/microsoft/pxt-calliope/issues/136

* fix ts mappings

- add optional spacing at the end of rgbw()
- map up to v4.0.19

* add suggested changes

* replace innerText by textContent

Co-authored-by: JW <gitkraken@juriwolf.de>
Co-authored-by: Juri <info@juriwolf.de>
This commit is contained in:
Juri Wolf
2022-04-26 19:28:42 +02:00
committed by GitHub
parent 3b9d90e551
commit a93febb5b7
102 changed files with 1458 additions and 740 deletions

View File

@ -1,53 +1,125 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="PGGhch1kuMF##st8~wFr">receivedNumber</variable>
</variables>
<block type="pxt-on-start" x="77" y="38">
<statement name="HANDLER">
<block type="device_show_number">
<value name="number">
<shadow type="math_number">
<field name="NUM">12</field>
</shadow>
</value>
<next>
<block type="basic_show_icon">
<field name="i">IconNames.Umbrella</field>
<next>
<block type="device_print_message">
<value name="text">
<shadow type="text">
<field name="TEXT">hi!</field>
</shadow>
</value>
<next>
<block type="device_pause">
<value name="pause">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
<next>
<block type="device_clear_display">
<next>
<block type="device_pause">
<value name="pause">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="device_forever" x="418" y="25"></block>
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="PGGhch1kuMF##st8~wFr">receivedNumber</variable>
</variables>
<block type="pxt-on-start" x="-307" y="-128">
<statement name="HANDLER">
<block type="device_show_number">
<value name="number">
<shadow type="math_number">
<field name="NUM">12</field>
</shadow>
</value>
<next>
<block type="device_show_number">
<value name="number">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="basic_show_icon">
<field name="i">IconNames.Umbrella</field>
<next>
<block type="basic_show_icon">
<field name="i">IconNames.Heart</field>
<next>
<block type="device_print_message">
<value name="text">
<shadow type="text">
<field name="TEXT">hi!</field>
</shadow>
</value>
<next>
<block type="device_print_message">
<value name="text">
<shadow type="text">
<field name="TEXT">hi!</field>
</shadow>
</value>
<next>
<block type="device_pause">
<value name="pause">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
<next>
<block type="device_clear_display">
<next>
<block type="device_show_leds">
<field name="LEDS">`
. . . . #
. . . # .
. . # . .
. # . . .
# . . . .
`</field>
<next>
<block type="device_set_led_color">
<value name="color">
<shadow type="colorNumberPicker">
<field name="value">0xff0000</field>
</shadow>
</value>
<next>
<block type="device_show_number">
<value name="number">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="core_rgb">
<value name="red">
<shadow type="math_number">
<field name="NUM">255</field>
</shadow>
</value>
<value name="green">
<shadow type="math_number">
<field name="NUM">255</field>
</shadow>
</value>
<value name="blue">
<shadow type="math_number">
<field name="NUM">255</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="basic_show_compass">
<value name="interval">
<shadow type="timePicker">
<field name="ms">600</field>
</shadow>
</value>
<next>
<block type="device_turn_rgb_led_off" />
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="device_forever" x="412" y="-30" />
</xml>

View File

@ -1,38 +1,53 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="tgDN]qF_Ah1Z*?=|+?^Y">item</variable>
</variables>
<block type="pxt-on-start" x="-29" y="116">
<statement name="HANDLER">
<block type="device_show_image_offset">
<value name="sprite">
<block type="builtin_image">
<field name="i">IconNames.Heart</field>
</block>
</value>
<value name="offset">
<shadow type="math_number" id="KX(1%=^vQUd=Q`UHhD*n">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="device_scroll_image">
<value name="frameoffset">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="delay">
<shadow type="math_number">
<field name="NUM">200</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
<block type="variables_get" disabled="true" x="145" y="168">
<field name="VAR" id="tgDN]qF_Ah1Z*?=|+?^Y" variabletype="">item</field>
</block>
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="tgDN]qF_Ah1Z*?=|+?^Y">item</variable>
</variables>
<block type="pxt-on-start" x="48" y="151">
<statement name="HANDLER">
<block type="variables_set">
<field name="VAR" id="tgDN]qF_Ah1Z*?=|+?^Y">item</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="builtin_image">
<field name="i">IconNames.Yes</field>
</block>
</value>
<next>
<block type="device_show_image_offset">
<value name="sprite">
<block type="builtin_image">
<field name="i">IconNames.Heart</field>
</block>
</value>
<value name="offset">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="device_scroll_image">
<value name="sprite">
<block type="variables_get">
<field name="VAR" id="tgDN]qF_Ah1Z*?=|+?^Y">item</field>
</block>
</value>
<value name="frameoffset">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="delay">
<shadow type="math_number">
<field name="NUM">200</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>

View File

@ -1,132 +1,141 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="wUkGVHoc@p^mter~Rc7h">item</variable>
<variable type="" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</variable>
</variables>
<block type="device_button_event" x="-6" y="17">
<field name="NAME">Button.AB</field>
<statement name="HANDLER">
<block type="variables_set">
<field name="VAR" id="wUkGVHoc@p^mter~Rc7h" variabletype="">item</field>
<value name="VALUE">
<shadow type="math_number" id="*jGI?[NsA.f}=qk0RHHf">
<field name="NUM">0</field>
</shadow>
<block type="device_get_button2">
<field name="NAME">Button.B</field>
</block>
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="wUkGVHoc@p^mter~Rc7h">item</variable>
<variable id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</variable>
</variables>
<block type="device_button_selected_event" x="0" y="0">
<field name="NAME">Button.AB</field>
<value name="eventType">
<shadow type="control_button_event_value_id"></shadow>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="wUkGVHoc@p^mter~Rc7h" variabletype="">item</field>
<value name="VALUE">
<shadow type="math_number" id="*jGI?[NsA.f}=qk0RHHf">
<field name="NUM">0</field>
</shadow>
<block type="device_pin_is_pressed">
<field name="NAME">TouchPin.P1</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<statement name="HANDLER">
<block type="variables_set">
<field name="VAR" id="wUkGVHoc@p^mter~Rc7h">item</field>
<value name="VALUE">
<shadow type="math_number" id="bZBPUCLiZ6#D@e_[Y`:0">
<field name="NUM">0</field>
</shadow>
<block type="device_acceleration">
<field name="NAME">Dimension.Y</field>
</block>
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_get_button2">
<field name="NAME">Button.B</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number" id="bZBPUCLiZ6#D@e_[Y`:0">
<field name="NUM">0</field>
</shadow>
<block type="device_get_light_level"></block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<block type="variables_set">
<field name="VAR" id="wUkGVHoc@p^mter~Rc7h">item</field>
<value name="VALUE">
<shadow type="math_number" id="bZBPUCLiZ6#D@e_[Y`:0">
<field name="NUM">0</field>
</shadow>
<block type="device_heading"></block>
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_pin_is_pressed">
<field name="NAME">TouchPin.P1</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number" id="bZBPUCLiZ6#D@e_[Y`:0">
<field name="NUM">0</field>
</shadow>
<block type="device_temperature"></block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number" id="o~k},FK*r@[O2)Cy!lM}">
<field name="NUM">0</field>
</shadow>
<block type="device_get_rotation">
<field name="NAME">Rotation.Roll</field>
</block>
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_acceleration">
<field name="NAME">Dimension.Y</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number" id="Uu,ZpYs7!BzIpX`%V_^!">
<field name="NUM">0</field>
</shadow>
<block type="device_get_magnetic_force">
<field name="NAME">Dimension.Z</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;" variabletype="">sdfsadf</field>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number" id="s{USu#UBc84Ao*jy(EQC">
<field name="NUM">0</field>
</shadow>
<block type="device_get_running_time"></block>
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_get_light_level" />
</value>
<next>
<block type="device_set_accelerometer_range">
<field name="range">AcceleratorRange.TwoG</field>
</block>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_heading" />
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_temperature" />
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_get_rotation">
<field name="NAME">Rotation.Roll</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_get_magnetic_force">
<field name="NAME">Dimension.Z</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id=")f$ml.CVl6|1^?sPWl:;">sdfsadf</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_get_running_time" />
</value>
<next>
<block type="device_set_accelerometer_range">
<field name="range">AcceleratorRange.TwoG</field>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</block>
</next>
</block>
</next>
</block>
</block>
</next>
</block>
</next>
</block>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="device_gesture_event" x="472" y="-8">
<field name="NAME">Gesture.SixG</field>
</block>
<block type="device_pin_event" x="555" y="96">
<field name="name">TouchPin.P2</field>
</block>
<block type="device_pin_released" x="188" y="435">
<field name="NAME">TouchPin.P2</field>
</block>
</block>
</statement>
</block>
<block type="device_gesture_event" x="555" y="30">
<field name="NAME">Gesture.SixG</field>
</block>
<block type="device_pin_custom_event" x="556" y="156">
<field name="name">TouchPin.P0</field>
<value name="eventType">
<shadow type="control_button_event_value_id"></shadow>
</value>
</block>
<block type="device_pin_custom_event" x="560" y="274">
<field name="name">TouchPin.P0</field>
<value name="eventType">
<shadow type="control_button_event_value_id"></shadow>
</value>
</block>
</xml>

View File

@ -0,0 +1,29 @@
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="pxt-on-start" x="20" y="20">
<statement name="HANDLER">
<block type="motor_on">
<value name="percent">
<shadow type="speedPicker">
<field name="speed">100</field>
</shadow>
</value>
<next>
<block type="motor_command">
<field name="command">MotorCommand.Break</field>
<next>
<block type="block_dual_motor">
<field name="motor">Motor.A</field>
<value name="percent">
<shadow type="speedPicker">
<field name="speed">100</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="device_forever" x="294" y="22" />
</xml>

View File

@ -1,95 +1,94 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="I3xB5Q]ehg#-~(sq{[|E">item</variable>
</variables>
<block type="melody_on_event" x="-27" y="128">
<field name="value">MusicEvent.BackgroundMelodyStarted</field>
<statement name="HANDLER">
<block type="device_play_note">
<value name="note">
<shadow type="device_note">
<field name="name">175</field>
</shadow>
</value>
<value name="duration">
<shadow type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</shadow>
</value>
<next>
<block type="device_ring">
<value name="note">
<shadow type="device_note">
<field name="name">147</field>
</shadow>
</value>
<next>
<block type="device_rest">
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="I3xB5Q]ehg#-~(sq{[|E">item</variable>
</variables>
<block type="device_forever" x="21" y="128">
<statement name="HANDLER">
<block type="device_play_note">
<value name="note">
<shadow type="device_note">
<field name="name">175</field>
</shadow>
</value>
<value name="duration">
<shadow type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</shadow>
<shadow type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</shadow>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E" variabletype="">item</field>
<value name="VALUE">
<shadow type="math_number" id="8/Ht9pG0DuL-0~sPe},^">
<field name="NUM">0</field>
</shadow>
<block type="device_note">
<field name="name">466</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E" variabletype="">item</field>
<value name="VALUE">
<shadow type="math_number" id="8/Ht9pG0DuL-0~sPe},^">
<field name="NUM">0</field>
</shadow>
<block type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</block>
<block type="device_ring">
<value name="note">
<shadow type="device_note">
<field name="name">147</field>
</shadow>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E" variabletype="">item</field>
<value name="VALUE">
<shadow type="math_number" id="8/Ht9pG0DuL-0~sPe},^">
<field name="NUM">0</field>
</shadow>
<block type="device_tempo"></block>
</value>
<next>
<block type="device_change_tempo">
<value name="value">
<shadow type="math_number">
<field name="NUM">1242</field>
</shadow>
<block type="device_rest">
<value name="duration">
<shadow type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</shadow>
</value>
<next>
<block type="device_set_tempo">
<value name="value">
<shadow type="math_number">
<field name="NUM">5</field>
</shadow>
</value>
</block>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E">item</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_note">
<field name="name">466</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E">item</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_beat">
<field name="fraction">BeatFraction.Sixteenth</field>
</block>
</value>
<next>
<block type="variables_set">
<field name="VAR" id="I3xB5Q]ehg#-~(sq{[|E">item</field>
<value name="VALUE">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
<block type="device_tempo" />
</value>
<next>
<block type="device_change_tempo">
<value name="value">
<shadow type="math_number">
<field name="NUM">1242</field>
</shadow>
</value>
<next>
<block type="device_set_tempo">
<value name="value">
<shadow type="math_number">
<field name="NUM">5</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</block>
</next>
</block>
</next>
</block>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</block>
</statement>
</block>
</xml>

View File

@ -59,8 +59,8 @@
</value>
<next>
<block type="serial_redirect">
<field name="tx">SerialPin.P12</field>
<field name="rx">SerialPin.P13</field>
<field name="tx">SerialPin.C16</field>
<field name="rx">SerialPin.C17</field>
<field name="rate">BaudRate.BaudRate28800</field>
<next>
<block type="serial_writebuffer">

File diff suppressed because one or more lines are too long