pxt-core 11.3.26 → 11.3.27

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.
Files changed (34) hide show
  1. package/built/pxt.js +6 -2
  2. package/built/pxtblocks/plugins/functions/blocks/functionCallBlocks.d.ts +15 -0
  3. package/built/pxtblocks/plugins/functions/commonFunctionMixin.d.ts +2 -3
  4. package/built/pxtblocks/plugins/functions/utils.d.ts +1 -0
  5. package/built/pxtlib.d.ts +6 -1
  6. package/built/pxtlib.js +6 -2
  7. package/built/react-common/components/controls/Feedback/Feedback.d.ts +5 -7
  8. package/built/target.js +1 -1
  9. package/built/tests/blocksrunner.js +202 -126
  10. package/built/tests/blockssetup.js +202 -126
  11. package/built/web/main.js +1 -1
  12. package/built/web/pxtapp.js +1 -1
  13. package/built/web/pxtasseteditor.js +1 -1
  14. package/built/web/pxtembed.js +1 -1
  15. package/built/web/pxtlib.js +1 -1
  16. package/built/web/pxtworker.js +1 -1
  17. package/built/web/runnerembed.js +1 -1
  18. package/common-docs/blocks.md +2 -1
  19. package/common-docs/javascript/call.md +5 -3
  20. package/common-docs/javascript/functions.md +3 -1
  21. package/common-docs/javascript/operators.md +1 -1
  22. package/common-docs/javascript/sequence.md +2 -0
  23. package/common-docs/javascript/statements.md +1 -1
  24. package/common-docs/python/call.md +6 -4
  25. package/common-docs/python/functions.md +3 -3
  26. package/common-docs/python/operators.md +1 -1
  27. package/common-docs/python/statements.md +1 -1
  28. package/common-docs/types/array.md +5 -5
  29. package/common-docs/types/boolean.md +4 -4
  30. package/common-docs/types.md +1 -1
  31. package/localtypings/pxtarget.d.ts +0 -3
  32. package/package.json +1 -1
  33. package/react-common/components/controls/Feedback/Feedback.tsx +34 -35
  34. package/react-common/components/controls/Feedback/FeedbackEventListener.ts +9 -3
package/built/pxt.js CHANGED
@@ -100760,6 +100760,11 @@ var ts;
100760
100760
  return isSupported;
100761
100761
  }
100762
100762
  Util.isExperienceSupported = isExperienceSupported;
100763
+ function ocvEnabled() {
100764
+ var _a, _b;
100765
+ return ((_a = pxt.webConfig.ocv) === null || _a === void 0 ? void 0 : _a.appId) && ((_b = pxt.webConfig.ocv) === null || _b === void 0 ? void 0 : _b.iframeEndpoint);
100766
+ }
100767
+ Util.ocvEnabled = ocvEnabled;
100763
100768
  })(Util = pxtc.Util || (pxtc.Util = {}));
100764
100769
  })(pxtc = ts.pxtc || (ts.pxtc = {}));
100765
100770
  })(ts || (ts = {}));
@@ -101676,7 +101681,6 @@ var pxt;
101676
101681
  simserviceworkerUrl: "/simulatorserviceworker.js",
101677
101682
  simworkerconfigUrl: "/sim/workerConfig.js",
101678
101683
  partsUrl: "/sim/siminstructions.html",
101679
- ocvEnabled: true,
101680
101684
  };
101681
101685
  return r;
101682
101686
  }
@@ -102648,7 +102652,7 @@ var pxt;
102648
102652
  var _a;
102649
102653
  try {
102650
102654
  return typeof window !== "undefined"
102651
- && /^http:\/\/(?:localhost|127\.0\.0\.1|192\.168\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9.-]+\.local):\d+\/?/.test(window.location.href)
102655
+ && /^https?:\/\/(?:localhost|127\.0\.0\.1|192\.168\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9.-]+\.local):\d+\/?/.test(window.location.href)
102652
102656
  && (ignoreFlags || !/nolocalhost=1/.test(window.location.href))
102653
102657
  && !((_a = pxt === null || pxt === void 0 ? void 0 : pxt.webConfig) === null || _a === void 0 ? void 0 : _a.isStatic);
102654
102658
  }
@@ -1 +1,16 @@
1
+ import * as Blockly from "blockly";
2
+ import { CommonFunctionMixin, CommonFunctionBlock } from "../commonFunctionMixin";
3
+ export interface SerializedShadow {
4
+ inputName: string;
5
+ connectedShadow?: any;
6
+ connectedBlock?: string;
7
+ }
8
+ interface FunctionCallMixin extends CommonFunctionMixin {
9
+ attachShadow_(input: Blockly.Input, typeName: string): void;
10
+ buildShadowDom_(argumentType: string): Element;
11
+ onchange(event: Blockly.Events.Abstract): void;
12
+ afterWorkspaceLoad(): void;
13
+ serializeChangedInputs(newMutation: Element): SerializedShadow[];
14
+ }
15
+ export declare type FunctionCallBlock = CommonFunctionBlock & FunctionCallMixin;
1
16
  export {};
@@ -36,9 +36,8 @@ export declare const COMMON_FUNCTION_MIXIN: {
36
36
  getFunctionId: (this: CommonFunctionBlock) => string;
37
37
  getArguments: (this: CommonFunctionBlock) => FunctionArgument[];
38
38
  removeValueInputs_: (this: CommonFunctionBlock) => void;
39
- disconnectOldBlocks_: (this: CommonFunctionBlock) => ConnectionMap;
40
- deleteShadows_: (this: CommonFunctionBlock, connectionMap: ConnectionMap) => void;
41
- createAllInputs_: (this: CommonFunctionBlock, connectionMap?: ConnectionMap) => void;
39
+ createAllInputs_: (this: CommonFunctionBlock) => void;
40
+ updateArgumentInputs_(this: CommonFunctionBlock): void;
42
41
  updateDisplay_: (this: CommonFunctionBlock) => void;
43
42
  setStatements_: (this: CommonFunctionBlock, hasStatements: boolean) => void;
44
43
  ensureIds_: (this: CommonFunctionBlock) => void;
@@ -12,6 +12,7 @@ export declare function createCustomArgumentEditor(typeName: string, ws: Blockly
12
12
  export declare function findLegalName(name: string, ws: Blockly.Workspace, block?: CommonFunctionBlock): string;
13
13
  export declare function idsInUse(ws: Blockly.Workspace): string[];
14
14
  export declare function mutateCallersAndDefinition(name: string, ws: Blockly.Workspace, mutation: Element): void;
15
+ export declare function getArgMap(mutation: Element, inverse: boolean): StringMap<string>;
15
16
  export declare function findUniqueParamName(name: string, paramNames: string[]): string;
16
17
  export declare function getShadowBlockInfoFromType_(argumentType: string, ws: Blockly.Workspace): string[];
17
18
  export declare function flyoutCategory(workspace: Blockly.WorkspaceSvg): Element[];
package/built/pxtlib.d.ts CHANGED
@@ -487,6 +487,7 @@ declare namespace ts.pxtc.Util {
487
487
  export function fromUTF8Array(s: Uint8Array): string;
488
488
  export function getHomeUrl(): string;
489
489
  export function isExperienceSupported(experienceId: string): boolean;
490
+ export function ocvEnabled(): string;
490
491
  export {};
491
492
  }
492
493
  declare namespace ts.pxtc.BrowserImpl {
@@ -626,7 +627,11 @@ declare namespace pxt {
626
627
  teachertoolUrl?: string;
627
628
  isStatic?: boolean;
628
629
  verprefix?: string;
629
- ocvEnabled?: boolean;
630
+ ocv?: OcvConfig;
631
+ }
632
+ interface OcvConfig {
633
+ appId: number;
634
+ iframeEndpoint: string;
630
635
  }
631
636
  function localWebConfig(): WebConfig;
632
637
  let webConfig: WebConfig;
package/built/pxtlib.js CHANGED
@@ -3074,6 +3074,11 @@ var ts;
3074
3074
  return isSupported;
3075
3075
  }
3076
3076
  Util.isExperienceSupported = isExperienceSupported;
3077
+ function ocvEnabled() {
3078
+ var _a, _b;
3079
+ return ((_a = pxt.webConfig.ocv) === null || _a === void 0 ? void 0 : _a.appId) && ((_b = pxt.webConfig.ocv) === null || _b === void 0 ? void 0 : _b.iframeEndpoint);
3080
+ }
3081
+ Util.ocvEnabled = ocvEnabled;
3077
3082
  })(Util = pxtc.Util || (pxtc.Util = {}));
3078
3083
  })(pxtc = ts.pxtc || (ts.pxtc = {}));
3079
3084
  })(ts || (ts = {}));
@@ -3990,7 +3995,6 @@ var pxt;
3990
3995
  simserviceworkerUrl: "/simulatorserviceworker.js",
3991
3996
  simworkerconfigUrl: "/sim/workerConfig.js",
3992
3997
  partsUrl: "/sim/siminstructions.html",
3993
- ocvEnabled: true,
3994
3998
  };
3995
3999
  return r;
3996
4000
  }
@@ -4962,7 +4966,7 @@ var pxt;
4962
4966
  var _a;
4963
4967
  try {
4964
4968
  return typeof window !== "undefined"
4965
- && /^http:\/\/(?:localhost|127\.0\.0\.1|192\.168\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9.-]+\.local):\d+\/?/.test(window.location.href)
4969
+ && /^https?:\/\/(?:localhost|127\.0\.0\.1|192\.168\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9.-]+\.local):\d+\/?/.test(window.location.href)
4966
4970
  && (ignoreFlags || !/nolocalhost=1/.test(window.location.href))
4967
4971
  && !((_a = pxt === null || pxt === void 0 ? void 0 : pxt.webConfig) === null || _a === void 0 ? void 0 : _a.isStatic);
4968
4972
  }
@@ -1,14 +1,12 @@
1
1
  /// <reference path="../../../../../localtypings/ocv.d.ts" />
2
- interface IFeedbackModalProps {
3
- feedbackConfig: ocv.IFeedbackConfig;
4
- frameId: string;
5
- title: string;
6
- onClose: () => void;
7
- }
8
2
  interface IFeedbackProps {
3
+ kind: ocv.FeedbackKind;
4
+ onClose?: () => void;
5
+ }
6
+ interface IFeedbackModalProps {
9
7
  kind: ocv.FeedbackKind;
10
8
  onClose: () => void;
11
9
  }
12
- export declare const Feedback: (props: IFeedbackProps) => JSX.Element;
13
10
  export declare const FeedbackModal: (props: IFeedbackModalProps) => JSX.Element;
11
+ export declare const Feedback: (props: IFeedbackProps) => JSX.Element;
14
12
  export {};