[royale-compiler] branch develop updated: JSConfiguration: add new --source-map-source-root compiler option

2020-10-28 Thread joshtynjala
This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
 new 3ceee57  JSConfiguration: add new --source-map-source-root compiler 
option
3ceee57 is described below

commit 3ceee572c331770f3852a7b77c5e5c5c2f414909
Author: Josh Tynjala 
AuthorDate: Wed Oct 28 14:35:06 2020 -0700

JSConfiguration: add new --source-map-source-root compiler option

In source maps, instead of using the relative path from the original 
AS/MXML source files to the generated JS files, allows an optional custom path 
where all of the original source files may be found. In other words, allows the 
original source files to be moved from their original location at compile-time 
to a new location during debugging.
---
 .../royale/compiler/clients/JSConfiguration.java   |  19 ++
 .../compiler/internal/graph/GoogDepsWriter.java| 327 ++---
 .../royale/compiler/utils/SourceMapUtils.java  | 257 
 3 files changed, 373 insertions(+), 230 deletions(-)

diff --git 
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
 
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
index 938a9f3..874fdea 100644
--- 
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
+++ 
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
@@ -133,6 +133,25 @@ public class JSConfiguration extends Configuration
 }
 
 //
+// 'source-map-source-root'
+//
+
+private String sourceMapSourceRoot = null;
+
+public String getSourceMapSourceRoot()
+{
+return sourceMapSourceRoot;
+}
+
+@Config
+@Mapping("source-map-source-root")
+public void setSourceMapSourceRoot(ConfigurationValue cv, String value)
+throws ConfigurationException
+{
+sourceMapSourceRoot = value;
+}
+
+//
 // 'js-default-initializers'
 //
 
diff --git 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
index da29ceb..5f2f828 100644
--- 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
+++ 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
@@ -50,6 +50,7 @@ import 
org.apache.royale.compiler.problems.FileNotFoundProblem;
 import org.apache.royale.compiler.problems.MainDefinitionQNameProblem;
 import org.apache.royale.compiler.problems.UnexpectedExceptionProblem;
 import org.apache.royale.compiler.units.ICompilationUnit;
+import org.apache.royale.compiler.utils.SourceMapUtils;
 import org.apache.royale.swc.ISWC;
 import org.apache.royale.swc.ISWCFileEntry;
 
@@ -68,6 +69,7 @@ public class GoogDepsWriter {
this.mainName = mainClassName;
removeCirculars = config.getRemoveCirculars();
sourceMaps = config.getSourceMap();
+   sourceMapsSourceRoot = config.getSourceMapSourceRoot();
otherPaths = config.getSDKJSLib();
verbose = config.isVerbose();
otherPaths.add(new File(outputFolder.getParent(), 
"royale/Royale/src").getPath());
@@ -89,6 +91,7 @@ public class GoogDepsWriter {
private List swcs;
private boolean removeCirculars = false;
private boolean sourceMaps = false;
+   private String sourceMapsSourceRoot = null;
private boolean verbose = false;
private ArrayList dps;
private DependencyGraph graph;
@@ -122,7 +125,12 @@ public class GoogDepsWriter {
else
files.add(gd.filePath);
visited.put(gd.className, gd);
+   if(sourceMaps && sourceMapsSourceRoot != null)
+   {
+   rewriteSourceMapSourceRoot(gd);
+   }
}
+   rewriteSourceMapSourceRoot(depMap.get(mainName));
if (removeCirculars)
{
GoogDep mainDep = depMap.get(mainName);
@@ -141,6 +149,55 @@ public class GoogDepsWriter {
}
return files;
}
+
+   private void rewriteSourceMapSourceRoot(GoogDep gd)
+   {
+   if (!sourceMaps || sourceMapsSourceRoot == null || 
sourceMapsSourceRoot.length() == 0)
+   {
+   return;
+   }
+   File sourceMapFile = new File(gd.filePath + ".map");
+   if (!sourceMapFile.exists())
+   {
+   return;
+   }
+   String sourceMapContents = null;
+   try
+   {
+   

[royale-asjs] branch develop updated: HTML: Add video tag

2020-10-28 Thread piotrz
This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
 new b004a40  HTML: Add video tag
b004a40 is described below

commit b004a40a6b3a16b7ee7b68f9c099b46f5bb479c9
Author: Piotr Zarzycki 
AuthorDate: Wed Oct 28 20:33:02 2020 +0100

HTML: Add video tag
---
 .../HTML/src/main/resources/html-manifest.xml  |  2 +-
 .../org/apache/royale/html/elements/Video.as   | 94 ++
 2 files changed, 95 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/HTML/src/main/resources/html-manifest.xml 
b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
index 03b03c0..19ff917 100644
--- a/frameworks/projects/HTML/src/main/resources/html-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
@@ -68,6 +68,7 @@
 
 
 
+
 
 
 
@@ -115,5 +116,4 @@
 
 
 
-
 
diff --git 
a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
 
b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
new file mode 100644
index 000..f06e434
--- /dev/null
+++ 
b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
@@ -0,0 +1,94 @@
+
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+package org.apache.royale.html.elements
+{
+COMPILE::JS
+{
+import org.apache.royale.core.WrappedHTMLElement;
+   import org.apache.royale.html.util.addElementToWrapper;
+}
+import org.apache.royale.html.NodeElementBase;
+
+   /**
+*  The Video class represents an HTML  element
+ *  
+*  
+ *  @toplevel
+*  @langversion 3.0
+*  @playerversion Flash 10.2
+*  @playerversion AIR 2.6
+*  @productversion Royale 0.9.8
+*/
+   public class Video extends NodeElementBase
+   {
+   /**
+*  constructor.
+*
+*  @langversion 3.0
+*  @playerversion Flash 10.2
+*  @playerversion AIR 2.6
+*  @productversion Royale 0.9.8
+*/
+   public function Video()
+   {
+   super();
+   }
+
+   COMPILE::SWF
+private var _autoplay:Boolean;
+
+/**
+ *  Whether the input is autofocused
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.2
+ *  @playerversion AIR 2.6
+ *  @productversion Royale 0.9
+ */
+public function get autoplay():Boolean
+{
+COMPILE::SWF
+{
+return _autoplay;
+}
+
+COMPILE::JS
+{
+return (element as HTMLVideoElement).autoplay;
+}
+}
+public function set autoplay(value:Boolean):void
+{
+COMPILE::SWF
+{
+_autoplay = value;
+}
+COMPILE::JS
+{
+(element as HTMLVideoElement).autoplay = value;
+}
+}
+
+COMPILE::JS
+override protected function createElement():WrappedHTMLElement
+{
+   return addElementToWrapper(this,'video');
+}
+}
+}



[royale-compiler] branch develop updated: GoogDepsWriter: rewrites sourceRoot for framework source maps so that it points to the local SDK path instead of CI server SDK path

2020-10-28 Thread joshtynjala
This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
 new ecfd694  GoogDepsWriter: rewrites sourceRoot for framework source maps 
so that it points to the local SDK path instead of CI server SDK path
ecfd694 is described below

commit ecfd694e2b3064839e9a41dc864ec8b5321ec334
Author: Josh Tynjala 
AuthorDate: Wed Oct 28 10:28:00 2020 -0700

GoogDepsWriter: rewrites sourceRoot for framework source maps so that it 
points to the local SDK path instead of CI server SDK path
---
 .../compiler/internal/graph/GoogDepsWriter.java| 58 +++---
 1 file changed, 51 insertions(+), 7 deletions(-)

diff --git 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
index e64e17b..da29ceb 100644
--- 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
+++ 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
@@ -34,6 +34,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
 import org.apache.royale.compiler.clients.problems.ProblemQuery;
 import org.apache.royale.compiler.common.DependencyType;
 import org.apache.royale.compiler.common.DependencyTypeSet;
@@ -1351,15 +1352,43 @@ public class GoogDepsWriter {
String sourceMapFn = 
outputFolderPath + File.separator + classPath + ".js.map";
File sourceMapDestFile 
= new File(sourceMapFn);
inStream = 
sourceMapFileEntry.createInputStream();
-   outStream = 
FileUtils.openOutputStream(sourceMapDestFile);
-   b = new byte[1024 * 
1024];
-   while ((bytes_read = 
inStream.read(b)) != -1)
+   String 
sourceMapContents = IOUtils.toString(inStream, Charset.forName("utf8"));
+   SourceMapConsumerV3 
sourceMapConsumer = new SourceMapConsumerV3();
+   try
{
-   
outStream.write(b, 0, bytes_read);
+   
sourceMapConsumer.parse(sourceMapContents);
+   }
+   
catch(SourceMapParseException e)
+   {
+   
sourceMapConsumer = null;
+   }
+   if(sourceMapConsumer != 
null)
+   {
+   String 
sourceRoot = sourceMapConsumer.getSourceRoot();
+   int index = 
sourceRoot.indexOf("/frameworks/js/projects/");
+   if(index != -1)
+   {
+   File 
royalelib = new File(System.getProperty("royalelib"));
+   File 
newSourceRoot = new File(royalelib.getParent(), sourceRoot.substring(index + 
1));
+   
SourceMapGeneratorV3 sourceMapGenerator = 
sourceMapConsumerToGenerator(sourceMapConsumer);
+   String 
newSourceRootUri = convertSourcePathToURI(newSourceRoot.getAbsolutePath());
+   
sourceMapGenerator.setSourceRoot(newSourceRootUri);
+   
StringBuilder builder = new StringBuilder();
+   try
+   {
+   
sourceMapGenerator.appendTo(builder, destFile.getName());
+   }
+

[royale-asjs] branch develop updated: jewel-topappbar: some refactoring and fixes

2020-10-28 Thread carlosrovira
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
 new cab15e8  jewel-topappbar: some refactoring and fixes
cab15e8 is described below

commit cab15e8a98c38d7b315866e26987a4ab389365c5
Author: Carlos Rovira 
AuthorDate: Wed Oct 28 16:47:16 2020 +0100

jewel-topappbar: some refactoring and fixes
---
 .../apache/royale/jewel/ApplicationMainContent.as  | 11 --
 .../royale/org/apache/royale/jewel/TopAppBar.as| 24 +++---
 2 files changed, 3 insertions(+), 32 deletions(-)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationMainContent.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationMainContent.as
index 1fdfad9..d35f11f 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationMainContent.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationMainContent.as
@@ -53,7 +53,6 @@ package org.apache.royale.jewel
}

private var _hasTopAppBar:Boolean;
-
 /**
  *  a boolean flag to indicate if the container needs to make some room
 *  for a TopAppBar so content doesn't be hide
@@ -73,16 +72,11 @@ package org.apache.royale.jewel
 if (_hasTopAppBar != value)
 {
 _hasTopAppBar = value;
-
-COMPILE::JS
-{
 toggleClass("has-topappbar", _hasTopAppBar);
-}
 }
}

private var _hasFooterBar:Boolean;
-
 /**
  *  a boolean flag to indicate if the container needs to make some room
 *  for a FooterBar so content doesn't be hide
@@ -96,17 +90,12 @@ package org.apache.royale.jewel
{
 return _hasFooterBar;
}
-
public function set hasFooterBar(value:Boolean):void
{
 if (_hasFooterBar != value)
 {
 _hasFooterBar = value;
-
-COMPILE::JS
-{
 toggleClass("has-footerbar", _hasFooterBar);
-}
 }
}
 
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TopAppBar.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TopAppBar.as
index a3a53f0..e39c6fe 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TopAppBar.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TopAppBar.as
@@ -18,12 +18,6 @@
 

 package org.apache.royale.jewel
 {
-   COMPILE::SWF
-{
-   import flash.display.DisplayObject;
-
-   import org.apache.royale.core.IRenderedObject;
-}
import org.apache.royale.events.Event;
 
/**
@@ -52,7 +46,6 @@ package org.apache.royale.jewel
super();
 
 typeNames = "jewel topappbar";
-   setListenersForFixed();
}
 
override protected function get headerClassName():String
@@ -69,14 +62,13 @@ package org.apache.royale.jewel
 {
COMPILE::JS
{
+   element.classList.toggle("fixed", _fixed);
if(_fixed)
{
-   element.classList.add("fixed");
window.removeEventListener('scroll', 
scrollHandler, false);
}
else
{
-   element.classList.remove("fixed");
window.addEventListener('scroll', 
scrollHandler, false);
}
}
@@ -137,8 +129,6 @@ package org.apache.royale.jewel
 if (_fixed != value)
 {
 _fixed = value;
-
-//toggleClass("fixed", _fixed);
setListenersForFixed();
 }
 }
@@ -164,18 +154,10 @@ package org.apache.royale.jewel
 if (_hasDrawer != value)
 {
 _hasDrawer = value;
-
-COMPILE::JS
-{
-   if(_hasDrawer)
-   {
-   element.classList.add("has-drawer");
-   }
-   else
+   COMPILE::JS
{
-   element.classList.remove("has-drawer");
+ 

[royale-asjs] branch develop updated: tour-de-jewel: fix show/hide footerbar and drawerfooter

2020-10-28 Thread carlosrovira
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
 new 08d846b  tour-de-jewel: fix show/hide footerbar and drawerfooter
08d846b is described below

commit 08d846bce3fdc1116d7d179f0622fe8e58765e61
Author: Carlos Rovira 
AuthorDate: Wed Oct 28 12:21:24 2020 +0100

tour-de-jewel: fix show/hide footerbar and drawerfooter
---
 examples/jewel/TourDeJewel/src/main/royale/MainContent.mxml | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/examples/jewel/TourDeJewel/src/main/royale/MainContent.mxml 
b/examples/jewel/TourDeJewel/src/main/royale/MainContent.mxml
index bb741a0..eb96f21 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/MainContent.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/MainContent.mxml
@@ -198,6 +198,11 @@ limitations under the License.
 
 [Bindable]
 public var orientation:String = "No Orientation";
+
+private function switchFooterBar():void
+{
+drawerFooter.visible = footerbar.visible = main.hasFooterBar = 
!footerbar.visible;
+}
 ]]>
 
 
@@ -245,7 +250,7 @@ limitations under the License.
 
 
 
-
+
 
 
 
@@ -327,7 +332,7 @@ limitations under the License.
 
 
 
-
+
 
 
 



[royale-asjs] 02/02: This import should not be necessary

2020-10-28 Thread harbs
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 7098f4a3caef4e49e4bd39b915c8c0a5a694fedd
Author: Harbs 
AuthorDate: Wed Oct 28 12:17:03 2020 +0200

This import should not be necessary
---
 .../Core/src/main/royale/org/apache/royale/debugging/assertType.as  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
index 647c60f..6a97e1b 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
@@ -18,7 +18,7 @@
 

 package org.apache.royale.debugging
 {
-
+import org.apache.royale.debugging.assert;
 COMPILE::JS
 {
 import goog.DEBUG;



[royale-asjs] 01/02: Revert "Fix assertType for js"

2020-10-28 Thread harbs
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 32eba631f241dbdd914a53993fa4d1f51d0cce96
Author: Harbs 
AuthorDate: Wed Oct 28 12:15:12 2020 +0200

Revert "Fix assertType for js"

This reverts commit 00c5b2ac31a1bbef87a7d388f1bc80476f6ff187.
---
 .../Core/src/main/royale/org/apache/royale/debugging/assertType.as  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
index 27c28a2..647c60f 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/debugging/assertType.as
@@ -36,7 +36,7 @@ package org.apache.royale.debugging
 COMPILE::JS
 {
 if(goog.DEBUG)
-console.assert((obj is type),message); 
+assert((obj is type),message); 
 }
 }
 }



[royale-asjs] branch develop updated (481e547 -> 7098f4a)

2020-10-28 Thread harbs
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


from 481e547  jewel-sectioncontent: fix recent issue causing all section 
content add "is-selected" making impossible to select it.
 new 32eba63  Revert "Fix assertType for js"
 new 7098f4a  This import should not be necessary

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../Core/src/main/royale/org/apache/royale/debugging/assertType.as| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)